/* ============================================================
   xl-cards.css — эталон: форматы + карточка товара
   Новые классы xl-fmt / xl-goods — без наследия старой сетки
   ============================================================ */

:root {
  --xl-c-bg: #f6f1e9;
  --xl-c-card: #ffffff;
  --xl-c-text: #171513;
  --xl-c-muted: #6f6a64;
  --xl-c-line: #eadfd3;
  --xl-c-accent: #ff651f;
  --xl-c-accent-hover: #ef5310;
  --xl-c-radius: 16px;
  --xl-c-shadow: 0 10px 28px rgba(39, 27, 17, 0.07);
}

/* ---------- Навигационные плитки по макету (23 категории) ---------- */
body.xl-redesign .xl-tiles {
  --xl-t-accent: #ff6a00;
  --xl-t-text: #1f1f1f;
  --xl-t-muted: #686868;
  margin: 0 0 32px !important;
  padding: 20px 16px !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: #fff8f2 !important;
  box-sizing: border-box !important;
}

body.xl-redesign .xl-tiles__head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 0 16px !important;
}
body.xl-redesign .xl-tiles__intro {
  min-width: 0 !important;
}
body.xl-redesign .xl-tiles__title {
  margin: 0 0 4px !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: var(--xl-t-text) !important;
  line-height: 1.15 !important;
}
body.xl-redesign .xl-tiles__sub {
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  color: var(--xl-t-muted) !important;
}
body.xl-redesign .xl-tiles__more {
  flex: 0 0 auto !important;
  margin-top: 2px !important;
  color: var(--xl-t-accent) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}
body.xl-redesign .xl-tiles__more:hover {
  color: #e85a00 !important;
}

body.xl-redesign .xl-tiles__grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}
@media (max-width: 1200px) {
  body.xl-redesign .xl-tiles__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 780px) {
  body.xl-redesign .xl-tiles__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}
@media (max-width: 520px) {
  body.xl-redesign .xl-tiles {
    padding: 14px 10px !important;
  }
  body.xl-redesign .xl-tiles__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.xl-redesign .xl-tiles__title {
    font-size: 20px !important;
  }
  body.xl-redesign .xl-tiles__head {
    flex-direction: column !important;
    gap: 6px !important;
  }
}

body.xl-redesign a.xl-tiles__item {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 138px !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 12px 8px 30px !important;
  border: 1.5px solid transparent !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05) !important;
  text-decoration: none !important;
  color: var(--xl-t-text) !important;
  box-sizing: border-box !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
  overflow: hidden !important;
}
body.xl-redesign a.xl-tiles__item:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09) !important;
  border-color: var(--xl-t-accent) !important;
  color: var(--xl-t-text) !important;
}

body.xl-redesign .xl-tiles__ico {
  display: block !important;
  width: 48px !important;
  height: 48px !important;
  margin: 0 0 8px !important;
  object-fit: contain !important;
  flex: 0 0 48px !important;
  transition: transform .18s ease !important;
}
body.xl-redesign a.xl-tiles__item:hover .xl-tiles__ico {
  transform: scale(1.05) !important;
}

body.xl-redesign .xl-tiles__name {
  display: block !important;
  width: 100% !important;
  margin: 0 0 3px !important;
  padding: 0 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  color: var(--xl-t-text) !important;
}
body.xl-redesign .xl-tiles__note {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  text-align: center !important;
  color: var(--xl-t-muted) !important;
}

/* стрелка на hover не нужна — достаточно обводки и анимации плитки */
body.xl-redesign .xl-tiles__go {
  display: none !important;
}

/* скрыть старые варианты блока */
body.xl-redesign .xl-fmt,
body.xl-redesign .xl-formats,
body.xl-redesign table#icSet2.catalog,
body.xl-redesign table#icSet2 {
  display: none !important;
}

/* ---------- Товары (концепт блока на главной) ---------- */
body.xl-redesign .xl-goods,
body.xl-redesign #content .xl-goods,
body.xl-redesign .xl-product-grid .xl-goods {
  display: block !important;
  visibility: visible !important;
  margin: 8px 0 48px !important;
  padding: 0 !important;
  clear: both !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
}

/* если модуль всё ещё обёрнут в старый wrapper — не прячем его */
body.xl-redesign #content section.xl-product-grid:has(.xl-goods),
body.xl-redesign #xlProducts.xl-product-grid:has(.xl-goods) {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.xl-redesign .xl-product-heading { display: none !important; }

body.xl-redesign .xl-goods__head {
  margin: 0 0 18px !important;
}
body.xl-redesign .xl-goods__head-main {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 16px !important;
}
body.xl-redesign .xl-goods__title {
  margin: 0 !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: var(--xl-c-text) !important;
  line-height: 1.15 !important;
}
body.xl-redesign .xl-goods__catalog {
  color: var(--xl-c-accent) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}
body.xl-redesign .xl-goods__catalog:hover {
  color: var(--xl-c-accent-hover) !important;
}

body.xl-redesign .xl-goods__grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  float: none !important;
}
@media (min-width: 1280px) {
  body.xl-redesign .xl-goods__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  body.xl-redesign .xl-goods__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}
@media (max-width: 560px) {
  body.xl-redesign .xl-goods__grid {
    grid-template-columns: 1fr !important;
  }
}

body.xl-redesign .xl-goods__card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 12px !important;
  min-height: 0 !important;
  width: auto !important;
  float: none !important;
  border: 1px solid #efe7dc !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
}
body.xl-redesign .xl-goods__card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1) !important;
}

body.xl-redesign .xl-goods__flags {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 4 !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
  pointer-events: none !important;
}
body.xl-redesign .xl-goods__badge {
  pointer-events: none !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 24px !important;
  padding: 0 9px !important;
  border-radius: 8px !important;
  background: #ff6a00 !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
}
body.xl-redesign .xl-goods__badge--new { background: #b42318 !important; }
body.xl-redesign .xl-goods__badge--sale { background: #e11d48 !important; }

body.xl-redesign .xl-goods__pic {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: auto !important;
  height: 118px !important;
  max-height: 118px !important;
  margin: 0 0 8px !important;
  padding: 8px !important;
  border-radius: 12px !important;
  background: #f6f6f6 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-decoration: none !important;
}
body.xl-redesign .xl-goods__pic img {
  width: auto !important;
  max-width: 100% !important;
  max-height: 100px !important;
  height: auto !important;
  object-fit: contain !important;
  transition: transform .2s ease !important;
}
body.xl-redesign .xl-goods__card:hover .xl-goods__pic img {
  transform: scale(1.03) !important;
}
body.xl-redesign .xl-goods__oos {
  position: absolute !important;
  inset: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: #44403c !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}
body.xl-redesign .xl-goods__card--oos .xl-goods__pic img {
  opacity: 0.45 !important;
}

body.xl-redesign .xl-goods__name {
  margin: 0 0 4px !important;
  min-height: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}
body.xl-redesign .xl-goods__name a {
  color: #171513 !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
}
body.xl-redesign .xl-goods__name a:hover {
  color: #ff6a00 !important;
}

body.xl-redesign .xl-goods__meta {
  margin: 0 0 6px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  color: #78716c !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  min-height: 0 !important;
}

/* Цена: крупно только текущая; «Вы экономите» и старая — мелко */
body.xl-redesign .xl-goods__price {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  gap: 2px 8px !important;
  margin: 0 0 8px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  color: #171513 !important;
}
body.xl-redesign .xl-goods__price > .b-rub {
  font-size: 14px !important;
  font-weight: 700 !important;
}
body.xl-redesign .xl-goods__price .productOldPrice,
body.xl-redesign .xl-goods__price .productsOldPrice,
body.xl-redesign .xl-goods__price s,
body.xl-redesign .xl-goods__price strike,
body.xl-redesign .xl-goods__price del {
  order: 2 !important;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #a8a29e !important;
  text-decoration: line-through !important;
}
body.xl-redesign .xl-goods__price font,
body.xl-redesign .xl-goods__price font[style] {
  order: 3 !important;
  display: block !important;
  flex: 1 0 100% !important;
  width: 100% !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  color: #c2410c !important;
}
body.xl-redesign .xl-goods__price font .b-rub {
  font-size: 11px !important;
  font-weight: 600 !important;
}
body.xl-redesign .xl-goods__price .productsNewPrice,
body.xl-redesign .xl-goods__price b {
  color: #171513 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

body.xl-redesign .xl-goods__buy {
  display: grid !important;
  grid-template-columns: 1fr 44px !important;
  gap: 6px !important;
  margin-top: auto !important;
  align-items: stretch !important;
}
body.xl-redesign .xl-goods__buy--oos {
  grid-template-columns: 1fr !important;
}
body.xl-redesign .xl-goods__qty {
  display: grid !important;
  grid-template-columns: 28px 1fr 28px !important;
  height: 38px !important;
  border: 1px solid #e7e5e4 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: #fff !important;
}
body.xl-redesign .xl-goods__qty-btn {
  border: 0 !important;
  background: #fafaf9 !important;
  color: #171513 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  line-height: 1 !important;
  padding: 0 !important;
}
body.xl-redesign .xl-goods__qty input {
  width: 100% !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 1px solid #e7e5e4 !important;
  border-right: 1px solid #e7e5e4 !important;
  border-radius: 0 !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

/* Кнопка покупки: только иконка корзины (текст не помещался) */
body.xl-redesign .xl-goods__cta {
  min-width: 44px !important;
  width: 44px !important;
}
body.xl-redesign .xl-goods__cta a.button,
body.xl-redesign .xl-goods__cta a.button:visited,
body.xl-redesign .xl-goods__cta a.button:hover,
body.xl-redesign .xl-goods__cta a.button:focus,
body.xl-redesign .xl-goods__cta a.button:active {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 38px !important;
  min-width: 44px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #ff6a00 !important;
  background-image: none !important;
  background-color: #ff6a00 !important;
  color: #fff !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transition: background .15s ease !important;
}
body.xl-redesign .xl-goods__cta a.button::before {
  content: "" !important;
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M3 5h2l2.2 11h10.6l2-8H7'/%3E%3Ccircle cx='10' cy='20' r='1.5' fill='%23fff' stroke='none'/%3E%3Ccircle cx='17' cy='20' r='1.5' fill='%23fff' stroke='none'/%3E%3C/svg%3E") !important;
}
body.xl-redesign .xl-goods__cta a.button span,
body.xl-redesign .xl-goods__cta a.button:hover span,
body.xl-redesign .xl-goods__cta a.button:focus span {
  display: none !important;
}
body.xl-redesign .xl-goods__cta a.button img {
  display: none !important;
}
body.xl-redesign .xl-goods__card:hover .xl-goods__cta a.button {
  background: #ef5310 !important;
  background-image: none !important;
}
body.xl-redesign .xl-goods__notify {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  background: #fff !important;
  background-image: none !important;
  border: 1.5px solid #ff6a00 !important;
  color: #ff6a00 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

body.xl-redesign .xl-goods__more {
  margin: 22px 0 0 !important;
  display: flex !important;
  justify-content: center !important;
}
body.xl-redesign .xl-goods__more-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: min(100%, 360px) !important;
  height: 48px !important;
  padding: 0 24px !important;
  border: 1.5px solid #ff6a00 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #ff6a00 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}
body.xl-redesign .xl-goods__more-btn:hover {
  background: #fff7f2 !important;
}

/* сначала показываем 8 карточек — плотность блока как в концепте */
body.xl-redesign .xl-goods__grid .xl-goods__card:nth-child(n+9) {
  display: none !important;
}
body.xl-redesign .xl-goods.is-expanded .xl-goods__grid .xl-goods__card {
  display: flex !important;
}

/* ---------- Плавающая корзина + тост ---------- */
body.xl-redesign .xl-float-cart {
  position: fixed !important;
  right: 22px !important;
  bottom: 110px !important;
  z-index: 99940 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 10px !important;
  pointer-events: none !important;
}
body.xl-redesign .xl-float-cart__btn {
  pointer-events: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  height: 52px !important;
  padding: 0 16px 0 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 999px !important;
  background: #171513 !important;
  color: #fff !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 2px 10px rgba(255, 255, 255, 0.16) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transform: translateX(0) !important;
  transition: transform .18s ease, box-shadow .18s ease, background .15s ease, border-color .15s ease !important;
}
body.xl-redesign .xl-float-cart__btn:hover {
  background: #292524 !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 4px 14px rgba(255, 255, 255, 0.2) !important;
}
body.xl-redesign .xl-float-cart.is-pulse .xl-float-cart__btn {
  animation: xlFloatPulse .55s ease;
  background: #ff6a00 !important;
}
@keyframes xlFloatPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
body.xl-redesign .xl-float-cart__ico {
  width: 22px !important;
  height: 22px !important;
  display: inline-block !important;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.8'%3E%3Cpath d='M3 5h2l2.2 11h10.6l2-8H7'/%3E%3Ccircle cx='10' cy='20' r='1.4'/%3E%3Ccircle cx='17' cy='20' r='1.4'/%3E%3C/svg%3E") !important;
}
body.xl-redesign .xl-float-cart__label {
  font-size: 13px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}
body.xl-redesign .xl-float-cart__badge {
  min-width: 22px !important;
  height: 22px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  background: #ff6a00 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.xl-redesign .xl-float-cart.is-empty .xl-float-cart__badge {
  background: #57534e !important;
}
body.xl-redesign .xl-float-cart__toast {
  pointer-events: none !important;
  opacity: 0 !important;
  transform: translateY(6px) !important;
  transition: opacity .2s ease, transform .2s ease !important;
  max-width: 240px !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #171513 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18) !important;
  border: 1px solid #eadfd3 !important;
}
body.xl-redesign .xl-float-cart__toast.is-on {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
@media (max-width: 760px) {
  body.xl-redesign .xl-float-cart {
    right: 14px !important;
    bottom: 96px !important;
  }
  body.xl-redesign .xl-float-cart__label {
    display: none !important;
  }
  body.xl-redesign .xl-float-cart__btn {
    width: 52px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}
