/* ==========================================================================
   ROKODIL — layout.css
   Хедер (top bar + main header + mega menu), футер, микро-корзина, overlay
   Источник: Figma frames Header #82:3414, Footer #5:206
   ========================================================================== */

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-bg);
}

/* --- Top Bar --- */
.header__topbar {
  background: #1E1E1E;
  color: var(--color-on-dark);
  height: 48px;
  display: flex;
  align-items: center;
}

.header__topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header__topbar-links {
  display: flex;
  gap: 32px;
}

.header__topbar-links a {
  font-size: var(--fs-13);
  line-height: var(--lh-20);
  opacity: 0.9;
}

.header__topbar-links a:hover { opacity: 1; color: var(--color-primary); }

.header__topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: var(--fs-13);
}

.header__callback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-on-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header__callback:hover { color: var(--color-primary); }

.header__work-hours {
  color: #9E9E9E;
  font-size: var(--fs-13);
}

/* --- Main Header --- */
.header__main {
  height: 70px;
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.95);
}

/* Главная: desktop header лежит поверх hero и становится плотным при прокрутке. */
@media (min-width: 1025px) {
  body.home .header__main {
    position: absolute;
    top: 48px;
    left: 0;
    z-index: 950;
    width: 100%;
    border-bottom-color: transparent;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  body.home .header:not(.is-scrolled):not(.is-searching) .header__nav-btn,
  body.home .header:not(.is-scrolled):not(.is-searching) .header__search-trigger,
  body.home .header:not(.is-scrolled):not(.is-searching) .header__action {
    color: #fff;
  }
  body.home .header:not(.is-scrolled):not(.is-searching) .header__logo--dark {
    display: none;
  }
  body.home .header:not(.is-scrolled):not(.is-searching) .header__logo--light {
    display: block;
  }
  body.home .header.is-scrolled .header__main,
  body.home .header.is-searching .header__main {
    position: fixed;
    top: 48px;
    border-bottom-color: var(--color-border);
    background: rgba(255, 255, 255, 0.95);
    color: inherit;
  }
}

.header__logo--light { display: none; }

.header__main-inner {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

.header__nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-15);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.header__nav-btn:hover { color: var(--color-primary); }

.header__nav-btn svg { flex-shrink: 0; }

/* Левая группа: Каталог + Поиск */
.header__left {
  display: flex;
  align-items: center;
  gap: 37px;
}

/* Кнопка Поиск */
.header__search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: #555B5C;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}


.header__search-trigger svg { flex-shrink: 0; }

/* Header search bar (shown when .header.is-searching — Figma 303:12310) */
.header__search-bar { display: none; align-items: center; gap: 12px; flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.header__search-bar-icon { color: #868686; flex-shrink: 0; }
.header__search-bar-input { flex: 1; height: 44px; border: none; background: transparent; font-family: 'Inter', sans-serif; font-size: 16px; line-height: 26px; color: #252B2B; outline: none; }
.header__search-bar-input::placeholder { color: #868686; }
.header__search-bar-close { background: none; border: none; cursor: pointer; color: #979E9F; display: flex; padding: 0; flex-shrink: 0; }
.header__search-bar-input::-webkit-search-cancel-button,
.hero-screen__search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.header__search-bar-input::-ms-clear,
.hero-screen__search-input::-ms-clear { display: none; width: 0; height: 0; }
.header__search-bar-close:hover { color: #252B2B; }
.header.is-searching .header__main-inner { position: relative; justify-content: space-between; }
.header.is-searching .header__left { display: none; }
/* [hidden] must win over component display:flex/block rules */
[hidden] { display: none !important; }

.header.is-searching .header__logo { position: static; transform: none; order: 0; margin: 0; }
.header.is-searching .header__actions { order: 2; }
.header.is-searching .header__search-bar { display: flex; order: 1; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 800px; max-width: calc(100% - 360px); }

.search-panel { z-index: 900; background: #FFFFFF; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 20px 60px -8px rgba(0,0,0,0.14), 0 4px 6px -1px rgba(0,0,0,0.04); max-height: 70vh; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; }
.search-panel__noresults { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px 48px; }
.search-panel__noresults img { width: 210px; height: 140px; object-fit: contain; margin-bottom: 20px; }
.search-panel__noresults-title { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 18px; line-height: 26px; color: #252B2B; margin: 0 0 4px; }
.search-panel__noresults-text { font-family: 'Inter', sans-serif; font-weight: 400; font-size: 14px; line-height: 20px; color: #979E9F; margin: 0; max-width: 534px; }
.search-section { padding: 16px 20px 8px; }
.search-section__label { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12px; line-height: 16px; color: #979E9F; margin-bottom: 8px; }
.search-list { display: flex; flex-direction: column; gap: 4px; }
.search-list__empty { font-family: 'Inter', sans-serif; font-size: 13px; color: #979E9F; padding: 8px 0; }
.search-divider { height: 1px; background: #F5F5F5; margin: 0 20px; }

/* Chips (history + popular) */
.search-chip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; background: none; border: none; cursor: pointer; text-align: left; font-family: 'Inter', sans-serif; font-size: 14px; line-height: 20px; color: #252B2B; border-radius: 4px; }
.search-chip:hover { background: #F9F9F9; }
.search-chip--hist { background: #F9F9F9; }
.search-chip--hist:hover { background: #F0F0F0; }
.search-chip__icon { display: flex; color: #979E9F; flex-shrink: 0; }
.search-chip--pop { padding: 8px 12px; }
.search-chip__dot { width: 20px; height: 20px; border-radius: 50%; background: rgba(0,108,102,0.08); flex-shrink: 0; display: inline-block; }

/* Product results (Figma 303:12595) */
.search-products { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.search-product { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: #252B2B; }
.search-product:hover { background: #F9F9F9; }
.search-product__img { width: 56px; height: 56px; border-radius: 4px; background: #F9F9F9; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-product__img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.search-product__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.search-product__title { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; line-height: 17.5px; color: #252B2B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-product__sub { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 11px; line-height: 16.5px; color: #979E9F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-product__meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.search-product__price { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; line-height: 20px; color: #252B2B; white-space: nowrap; }
.search-product__stock { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 10px; line-height: 15px; color: #006C66; background: rgba(0,108,102,0.08); border-radius: 8px; padding: 2px 6px; white-space: nowrap; }

/* Panel footer */
.search-panel__footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid rgba(0,0,0,0.06); }
.search-panel__count { font-family: 'Inter', sans-serif; font-size: 11px; line-height: 16px; color: #979E9F; }
.search-panel__all { display: inline-flex; align-items: center; gap: 4px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12px; line-height: 18px; color: #006C66; text-decoration: none; }
.search-panel__all:hover { text-decoration: underline; }
.search-panel__hint { padding: 16px 20px; font-family: 'Inter', sans-serif; font-size: 11px; line-height: 16px; color: #979E9F; }

@media (max-width: 768px) {
  .search-products { grid-template-columns: 1fr; }
  .search-panel { max-width: 100%; }
}

/* Логотип по центру */
.header__logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.header__logo img {
  height: 38px;
  width: auto;
}

/* Иконки справа */
.header__actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.header__action {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-dark);
  transition: background var(--transition);
}

.header__action:hover { background: var(--color-bg-gray); color: var(--color-primary); }

/* Счётчик на иконке */
.header__action-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-primary);
  color: var(--color-on-dark);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}



/* --- Поиск в хедере --- */
.header__search {
  position: relative;
  flex: 1;
  max-width: 600px;
}

.header__search-input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: var(--fs-14);
  background: var(--color-bg-gray);
  transition: border-color var(--transition), background var(--transition);
}

.header__search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg);
}

.header__search-input::placeholder { color: var(--color-gray); }

.header__search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-xs);
}

.header__search-btn:hover { color: var(--color-primary); }

/* --- Бургер (мобайл) --- */
.header__burger {
  display: none;
  width: 36px;
  height: 36px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
}

.header__burger span {
  display: block;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.header.is-nav-open .header__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header.is-nav-open .header__burger span:nth-child(2) { opacity: 0; }
.header.is-nav-open .header__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1024px) {
  .header__topbar { display: none; }
  .header__main { height: 50px; background: #FFFFFF; }
  .header__main-inner { display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 16px; position: relative; }
  .header__burger { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; background: transparent; border: none; cursor: pointer; color: #252B2B; flex-shrink: 0; margin-right: 16px; }
  .header__burger svg { width: 24px; height: 24px; display: block; }
  .header__left { display: flex; align-items: center; margin-left: auto; order: 3; }
  .header__left .header__nav-btn { display: none; }
  .header__left .header__search-trigger { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; font-family: var(--font-body); color: #252B2B; background: transparent; border: none; cursor: pointer; padding: 0; }
  .header__logo { position: static; transform: none; display: flex; align-items: center; margin-right: auto; }
  .header__logo img { width: 113px; height: 24px; object-fit: contain; display: block; }
  .header__actions { display: none; }
  .megamenu__grid { grid-template-columns: 1fr; }
}

.mobile-drawer {
  display: none;
}

@media (max-width: 1024px) {
  .header {
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  .header__main {
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.04), 0 10px 10px -3px rgba(0, 0, 0, 0.04);
  }

  .header__burger {
    position: relative;
  }

  .header__burger::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(45deg, transparent 47%, currentColor 48%, currentColor 52%, transparent 53%),
      linear-gradient(-45deg, transparent 47%, currentColor 48%, currentColor 52%, transparent 53%);
    opacity: 0;
    transform: rotate(-90deg);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .header.is-nav-open .header__burger svg {
    opacity: 0;
  }

  .header.is-nav-open .header__burger::after {
    opacity: 1;
    transform: rotate(0);
  }

  .mobile-drawer {
    position: fixed;
    top: 50px;
    bottom: 0;
    left: 0;
    display: block;
    width: min(375px, 100vw);
    visibility: visible;
    pointer-events: none;
    overflow: hidden;
    color: #252B2B;
    background: #FFFFFF;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1;
  }

  .header.is-nav-open .mobile-drawer {
    pointer-events: auto;
    transform: translateX(0);
  }

  .mobile-drawer__scroll {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: 100%;
    padding: 48px 16px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }

  .mobile-drawer__nav {
    display: grid;
    gap: 10px;
  }

  .mobile-drawer__group {
    margin: 0;
  }

  .mobile-drawer__row {
    display: flex;
    width: 100%;
    min-height: 40px;
    padding: 10px 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #252B2B;
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    list-style: none;
  }

  .mobile-drawer__row::-webkit-details-marker {
    display: none;
  }

  .mobile-drawer__row svg {
    flex: 0 0 auto;
    transition: transform 0.2s ease;
  }

  .mobile-drawer__group[open] > .mobile-drawer__row svg {
    transform: rotate(90deg);
  }

  .mobile-drawer__panel {
    display: grid;
    gap: 2px;
    padding: 4px 0 8px 26px;
  }

  .mobile-drawer__panel a {
    min-height: 40px;
    padding: 10px 0;
    color: #555B5C;
    font-size: 14px;
    line-height: 20px;
    text-decoration: underline;
    text-underline-offset: 3px;
    box-sizing: border-box;
  }

  .mobile-drawer__actions {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 40px;
  }

  .mobile-drawer__button {
    display: flex;
    width: 100%;
    height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 4px;
    font: 500 14px/20px var(--font-body);
    cursor: pointer;
  }

  .mobile-drawer__button--primary {
    color: #FFFFFF;
    background: #006C66;
  }

  .mobile-drawer__button--secondary {
    color: #252B2B;
    background: #F5F5F5;
  }

  .mobile-drawer__hours {
    margin: 8px 0 0;
    color: #9E9E9E;
    font-size: 13px;
    line-height: 16px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-drawer,
  .header__burger::after {
    transition: none;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--color-footer);
  color: var(--color-on-dark);
  position: relative;
  overflow: hidden;
}

.footer__pattern {
  position: absolute;
  top: 0;
  right: 0;
  width: 70%;
  height: 100%;
  background: linear-gradient(to right, rgba(1,1,1,0) 0%, var(--color-footer-pattern) 400px);
  z-index: 0;
}

.footer__pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/banners/footer-pattern.webp') center/cover no-repeat;
  opacity: 0.6;
}

.footer__inner {
  position: relative;
  z-index: 1;
  padding: 64px 0 32px;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--color-on-dark-border);
}

.footer__brand-logo {
  margin-bottom: 32px;
}

.footer__brand-logo img { height: 54px; }

.footer__about {
  font-size: var(--fs-16);
  line-height: var(--lh-26);
  color: var(--color-on-dark);
  max-width: 366px;
}

.footer__col-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

.footer__col-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer__col-list a {
  font-size: var(--fs-14);
  line-height: var(--lh-20);
  letter-spacing: 0;
  color: var(--color-on-dark);
}
.footer__col-list a:hover { color: var(--color-primary); }

/* Контакты в футере */
.footer__contacts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  padding: 32px 0;
  border-bottom: 1px solid var(--color-on-dark-border);
}

.footer__contact-label {
  font-size: var(--fs-14);
  color: var(--color-on-dark-muted);
  margin-bottom: 8px;
}

.footer__contact-value {
  font-size: var(--fs-18);
  line-height: var(--lh-26);
  color: var(--color-on-dark);
  white-space: nowrap;
}

.footer__contact-value a:hover { color: var(--color-primary); }

/* Соц.сети */
.footer__social {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.footer__social-link { display: inline-flex; }

.footer__social-link:hover { background: var(--color-primary); }

/* Нижняя строка */
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  font-size: var(--fs-14);
  color: var(--color-on-dark-muted);
}

.footer__bottom-links {
  display: flex;
  gap: 32px;
}

.footer__bottom-links a {
  color: var(--color-on-dark-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__bottom-links a:hover { color: var(--color-primary); }

@media (max-width: 1024px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__contacts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .footer__inner { padding: 32px 0 24px; }
  .footer__top,
  .footer__contacts { grid-template-columns: 1fr; gap: 24px; }
  .footer__brand-logo img { height: 36px; }
  .footer__brand-logo { margin-bottom: 16px; }
  .footer__bottom { flex-direction: column; text-align: center; gap: 16px; align-items: center; }
  .footer__bottom-links { flex-direction: column; gap: 12px; }
}

/* ==========================================================================
   CART MODAL (Figma 82:1183) — Centered Popup
   ========================================================================== */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cart-modal.is-open { display: flex; }

.cart-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 1;
}

.cart-modal__dialog {
  position: relative;
  width: 730px;
  max-width: 100%;
  max-height: 90vh;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.cart-modal__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 40px 40px 24px;
  border-bottom: 1px solid #F5F5F5;
}

.cart-modal__title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 28px;
  color: #242627;
  margin: 0;
}

.cart-modal__count {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 28px;
  color: #242627;
}

.cart-modal__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #FFFFFF;
  border: none;
  cursor: pointer;
  color: #242627;
  box-shadow: inset 0px -0.94px 0.94px 0px rgba(150, 161, 172, 0.12);
  transition: background 0.2s;
}

.cart-modal__close:hover { background: #F5F5F5; }

.cart-modal__items {
  flex: 1;
  overflow-y: auto;
  padding: 0 40px;
  max-height: calc(684px - 113px - 88px);
}

.cart-modal__item {
  display: grid;
  grid-template-columns: 117px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid #F5F5F5;
}

.cart-modal__item:last-child { border-bottom: none; }

.cart-modal__item-img {
  width: 117px;
  height: 117px;
  background: #F9F9F9;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-modal__item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* Body: top row (info + price) and bottom row (links + stepper) */
.cart-modal__item-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.cart-modal__item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cart-modal__item-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.cart-modal__item-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.cart-modal__item-price {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 26px;
  color: #252B2B;
}

.cart-modal__item-price-old {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 16px;
  color: #979E9F;
  text-decoration: line-through;
}

.cart-modal__item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.cart-modal__item-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.cart-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 14px;
  width: fit-content;
}

.cart-modal__badge svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.cart-modal__badge--instock {
  background: rgba(98, 169, 136, 0.12);
  color: #166534;
}

.cart-modal__badge--instock svg { stroke: #166534; }

.cart-modal__badge--low {
  background: rgba(198, 1, 0, 0.05);
  color: #C60100;
}

.cart-modal__badge--low svg { stroke: #C60100; }

.cart-modal__badge--warning {
  background: #FFF7D8;
  color: #B45309;
}

.cart-modal__badge--warning svg { stroke: #B45309; }

.cart-modal__item-title {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #242627;
  margin: 0;
}

.cart-modal__item-title a {
  color: inherit;
  text-decoration: none;
}

.cart-modal__item-title a:hover { text-decoration: underline; }

/* Favorite + Remove (bottom-left, side by side) */
.cart-modal__item-favorite,
.cart-modal__item-remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 16px;
  color: #979E9F;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.cart-modal__item-favorite:hover { color: #006C66; }
.cart-modal__item-remove:hover { color: #C60100; }

.cart-modal__item-favorite svg,
.cart-modal__item-remove svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Quantity Stepper (Figma 82:1821) — 132x40, circular buttons 24x24 */
.cart-modal-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 132px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid #F5F5F5;
  border-radius: 4px;
  background: #FFFFFF;
  flex-shrink: 0;
}

.cart-modal-stepper__btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #F5F5F5;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #252B2B;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.cart-modal-stepper__btn:hover { background: #EAEAEA; }

.cart-modal-stepper__input {
  width: 28px;
  border: none;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #252B2B;
  background: transparent;
  -moz-appearance: textfield;
}

.cart-modal-stepper__input::-webkit-outer-spin-button,
.cart-modal-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-modal__empty {
  padding: 60px 20px;
  text-align: center;
  color: #979E9F;
  font-size: 16px;
}

.cart-modal__footer {
  padding: 30px 40px;
  border-top: 1px solid #F5F5F5;
  background: #FFFFFF;
  box-shadow: 8px 0px 24px 0px rgba(0, 0, 0, 0.08), 20px 0px 60px 0px rgba(0, 0, 0, 0.12);
  border-radius: 0 0 8px 8px;
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Summary block: label+prices on line 1, savings on line 2 */
.cart-modal__summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-modal__total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cart-modal__total-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #242627;
}

.cart-modal__total-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cart-modal__total-price {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  color: #242627;
}

.cart-modal__total-old {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 16px;
  color: #979E9F;
  text-decoration: line-through;
}

.cart-modal__savings {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: #62A988;
  text-align: right;
}

.cart-modal__checkout {
  width: 230px;
  height: 48px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  background: #006C66;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
}

.cart-modal__checkout:hover { background: #005550; }

@media (max-width: 768px) {
  .cart-modal__dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .cart-modal__header,
  .cart-modal__items,
  .cart-modal__footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .cart-modal__item {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }
  
  .cart-modal__item-img {
    width: 80px;
    height: 80px;
  }
  
  .cart-modal__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .cart-modal__total-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  
  .cart-modal__savings { text-align: left; }
  
  .cart-modal__item-body { gap: 12px; }
  
  .cart-modal__item-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .cart-modal__item-prices { align-items: flex-start; }
  
  .cart-modal__item-top { flex-direction: column; gap: 4px; }
  
  .cart-modal__checkout {
    width: 100%;
  }
}

/* ==========================================================================
   OVERLAY
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   COOKIE BANNER
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 480px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 24px;
  z-index: var(--z-modal);
  transform: translateY(120%);
  transition: transform 0.4s ease;
}

.cookie-banner.is-visible { transform: translateY(0); }

.cookie-banner__title {
  font-size: var(--fs-18);
  font-weight: 600;
  margin-bottom: 8px;
}

.cookie-banner__text {
  font-size: var(--fs-14);
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.cookie-banner__text a { color: var(--color-primary); text-decoration: underline; }

.cookie-banner__actions {
  display: flex;
  gap: 12px;
}

/* ========== Footer Bounding/Alignment Overrides ========== */
.footer__inner {
  padding: 100px 32px 80px;
}
.footer__top {
  grid-template-columns: 386px repeat(4, 150px);
  gap: 85px;
  padding-bottom: 80px;
}
.footer__contacts {
  display: grid;
  grid-template-columns: 386px repeat(4, 150px);
  gap: 85px;
  padding: 78px 0 80px;
  border-top: 1px solid var(--color-on-dark-border);
  border-bottom: 1px solid var(--color-on-dark-border);
  align-items: flex-start;
}
.footer__bottom {
  display: grid;
  grid-template-columns: 386px 1fr;
  gap: 85px;
  align-items: center;
  padding-top: 79px;
}
.footer__bottom-links {
  display: grid;
  grid-template-columns: 218px 214px 128px;
  gap: 80px;
}
.footer__col-list li {
  height: 20px;
  line-height: 20px;
}
.footer__social {
  margin-bottom: 0;
}
.footer__contact-label {
  margin-bottom: 10px;
  line-height: 20px;
}
.footer__contacts > :nth-child(2) .footer__contact-value {
  line-height: 28px;
}
.footer__bottom {
  line-height: 20px;
}
.footer__bottom-links a {
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .footer__contacts {
    grid-template-columns: 1fr 1fr;
    padding: 32px 16px;
  }
}
@media (max-width: 640px) {
  .footer__contacts {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer__bottom {
    flex-direction: column;
    gap: 16px;
  }
}

.footer {
  position: relative;
  overflow: hidden;
}

.footer__blur {
  position: absolute;
  right: -317px;
  top: -150px;
  width: 635px;
  height: 1453px;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.footer__blur img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer__inner,
.footer__contacts,
.footer__bottom {
  position: relative;
  z-index: 2;
}
/* ===== Catalog Dropdown (336:6099) ===== */
.cat-dropdown {
  position: absolute;
  top: 100%;
  left: 32px;
  display: flex;
  width: 884px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  margin-top: 4px;
}

.header__main-inner:has(.header__nav-btn:hover) .cat-dropdown,
.cat-dropdown.is-open,
.cat-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cat-dropdown__main {
  flex: 1;
  padding: 20px;
}

.cat-dropdown__side {
  width: 344px;
  background: #F9F9F9;
  border-radius: 0 8px 8px 0;
  padding: 20px;
}

.cat-dropdown__section-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: #555B5C;
  padding-bottom: 8px;
}

.cat-dropdown__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  height: 76px;
  box-sizing: border-box;
  text-decoration: none;
  transition: background 0.15s;
}

.cat-card:hover {
  background: #F5F5F5;
}

.cat-card img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
}

.cat-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-card__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #252B2B;
  line-height: 1;
}

.cat-card__count {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: #979E9F;
  line-height: 1;
}

.cat-card--task {
  width: 100%;
}

.cat-dropdown__divider {
  height: 1px;
  background: #EAEAEA;
  margin: 8px 0;
}

.cat-dropdown__all-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: #006C66;
  text-decoration: none;
  padding: 8px 0;
}

.cat-dropdown__all-link:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .cat-dropdown { display: none; }
}

@media (max-width: 1024px) {
  .footer__inner {
    padding: 64px 32px 32px;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
  }

  .footer__contacts {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 32px 0;
  }

  .footer__bottom {
    display: flex;
    gap: 16px;
    padding-top: 24px;
  }

  .footer__bottom-links {
    display: flex;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .footer__inner {
    padding: 32px 16px 24px;
  }

  .footer__top,
  .footer__contacts {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer__contacts {
    padding: 32px 0;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    text-align: center;
  }

  .footer__bottom-links {
    flex-direction: column;
    gap: 12px;
  }

  .footer__bottom-links a {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .footer__contact-value {
    white-space: normal;
  }
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(80px + env(safe-area-inset-bottom, 0px));
    padding: 8px 0 env(safe-area-inset-bottom, 0px);
    color: #555B5C;
    background: #FFFFFF;
    box-shadow: 0 -8px 24px rgba(37, 43, 43, 0.08);
    box-sizing: border-box;
  }

  .mobile-bottom-nav__item {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    font-size: 10px;
    font-weight: 500;
    line-height: 14px;
    text-align: center;
    text-decoration: none;
  }

  .mobile-bottom-nav__item svg {
    display: block;
    width: 24px;
    height: 24px;
  }

  .mobile-bottom-nav__item.is-active {
    color: #006C66;
  }

  .mobile-bottom-nav__icon {
    position: relative;
    display: block;
  }

  .mobile-bottom-nav__badge {
    position: absolute;
    top: -6px;
    right: -9px;
    display: flex;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    border-radius: 999px;
    color: #FFFFFF;
    background: #C60100;
    font-size: 9px;
    font-weight: 600;
    line-height: 12px;
    box-sizing: border-box;
  }
}

.footer-mobile-links {
  display: none;
}

@media (max-width: 768px) {
  .footer {
    min-height: 1257px;
  }

  .footer__pattern {
    width: 100%;
    background: linear-gradient(to bottom, rgba(1, 1, 1, 0) 0, var(--color-footer-pattern) 420px);
  }

  .footer__pattern::after {
    background-position: 60% top;
    opacity: 0.45;
  }

  .footer__blur {
    top: -120px;
    right: -420px;
    opacity: 0.7;
  }

  .footer__inner {
    display: flex;
    min-height: 1257px;
    padding: 72px 16px 32px;
    flex-direction: column;
    box-sizing: border-box;
  }

  .footer__top {
    display: block;
    padding: 0;
  }

  .footer__top > :not(:first-child) {
    display: none;
  }

  .footer__brand-logo {
    margin-bottom: 20px;
  }

  .footer__brand-logo img {
    width: 169px;
    height: auto;
    filter: brightness(0) invert(1);
  }

  .footer__about {
    max-width: 343px;
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    line-height: 18px;
  }

  .footer-mobile-links {
    display: block;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .footer-mobile-links__group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .footer-mobile-links__group summary {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    list-style: none;
    cursor: pointer;
  }

  .footer-mobile-links__group summary::-webkit-details-marker {
    display: none;
  }

  .footer-mobile-links__group summary svg {
    transition: transform 0.2s ease;
  }

  .footer-mobile-links__group[open] summary svg {
    transform: rotate(180deg);
  }

  .footer-mobile-links__panel {
    display: grid;
    gap: 12px;
    padding: 0 0 20px;
  }

  .footer-mobile-links__panel a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 20px;
  }

  .footer__contacts {
    display: grid;
    margin: 0;
    padding: 40px 0 0;
    grid-template-columns: 1fr;
    gap: 28px;
    border: 0;
  }

  .footer__contacts > :nth-child(3) {
    display: none;
  }

  .footer__social-wrap {
    order: -1;
  }

  .footer__social-link,
  .footer__social-link img {
    width: 40px;
    height: 40px;
  }

  .footer__contact-label {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 18px;
  }

  .footer__contact-value {
    max-width: 300px;
    font-size: 13px;
    line-height: 20px;
  }

  .footer__bottom {
    margin-top: auto;
    padding-top: 32px;
    align-items: flex-start;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 11px;
    line-height: 16px;
  }

  .footer__bottom-links {
    align-items: flex-start;
    gap: 10px;
  }

  .footer__bottom-links a {
    font-size: 11px;
    line-height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-mobile-links__group summary svg {
    transition: none;
  }
}
