/* =============================================================
   iStore — ЕДИНЫЙ ФАЙЛ СТИЛЕЙ
   Объединены: styles.css + adaption.css
   Рефакторинг: дизайн-система, каскад вместо !important
   ============================================================= */

/* =====================================================
   ДИЗАЙН-СИСТЕМА: CSS-ПЕРЕМЕННЫЕ
   ===================================================== */
:root {
  /* --- Цвета --- */
  --pink:          #e10075;
  --pink-light:    #ff2c9c;
  --pink-dark:     #d40073;
  --pink-darker:   #c4005f;
  --pink-bg:       #fff5fb;
  --pink-light-bg: #ffe6f2;

  /* --- Высота шапки (используется в padding-top body и позиционировании) --- */
  --header-topbar:   40px;   /* .top-bar */
  --header-main:     55px;   /* .main-header */
  --header-nav:      61px;   /* .nav-bar (реальная высота по getBoundingClientRect) */
  --header-total:   156px;   /* сумма всех трёх полос: 40+55+61 */

  /* --- Z-индексы (чёткая иерархия слоёв) ---

     Ключевой принцип: один и тот же псевдоэлемент (body::after)
     меняет z-index в зависимости от состояния:

     blur-active (выпадающее меню):
       overlay z-index = --z-blur-content (100)
       → НИЖЕ навигации (1000) → nav чёткий, контент за ним затемнён

     modal-blur-active (поиск / корзина / избранное):
       overlay z-index = --z-blur-modal (10000)
       → ВЫШЕ навигации (1002) → nav уходит под оверлей
       → НИЖЕ модалок (20001) → модалки плавают над оверлеем          */
  --z-topbar:         1002;  /* Верхняя полоса */
  --z-mainheader:     1001;  /* Шапка с поиском */
  --z-navbar:         1000;  /* Навигационная полоса */
  --z-bottom-nav:      500;  /* Мобильная нижняя панель */
  --z-burger-overlay: 1200;  /* Затемнение за бургер-меню */
  --z-dropdown:        999;  /* Выпадающее меню — уходит ПОД navbar */
  --z-burger:         1300;  /* Бургер-меню */
  --z-blur-content:    100;  /* Оверлей при dropdown — НИЖЕ nav, выше обычного контента */
  --z-blur-modal:    10000;  /* Оверлей при модалке — ВЫШЕ nav, НИЖЕ modal-content */
  --z-blur-overlay:  10000;  /* Алиас для обратной совместимости */
  --z-modal-overlay: 20000;  /* Фон поиска / корзины / избранного */
  --z-modal-content: 20001;  /* Сами окна поиска / корзины / избранного */
  --z-modal:         20001;  /* Алиас → modal-content */
  --z-search-modal:  20001;  /* Алиас → modal-content */
  --z-city-confirm:  99998;
  --z-city-modal:    99999;
  --z-toast:        100000;

  /* --- Скругления --- */
  --radius-sm:   8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-pill:50%;

  /* --- Переходы --- */
  --transition-fast: 0.2s ease;
  --transition:      0.3s ease;
  --transition-slow: 0.4s ease;

  /* --- Отступы --- */
  --container-width: 95%;
  --container-max:  1200px;
}


/* =====================================================
   БАЗОВЫЙ СБРОС И ГЛОБАЛЬНЫЕ СТИЛИ
   ===================================================== */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  overflow-x: hidden;
  padding-top: var(--header-total);
  color: #000;
  -webkit-text-size-adjust: 100%;
  max-width: 100vw;
}

a {
  color: #000;
  -webkit-tap-highlight-color: transparent;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* Серая подложка под фиксированную шапку */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-total);
  background: #f0f0f0;
  z-index: 997;
  pointer-events: none;
}


/* =====================================================
   ГЛОБАЛЬНЫЕ TOUCH-ПРАВИЛА (из adaption.css)
   Без !important — работают по каскаду
   ===================================================== */

/* Отключаем двойной тап для зума на всех интерактивных элементах */
button,
a,
input,
textarea,
select,
label,
[role="button"],
[onclick] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Для текстовых полей разрешаем выделение текста */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Убираем outline */
input,
textarea,
button,
select,
a {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  outline: none;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
button:focus,
button:focus-visible,
select:focus,
select:focus-visible,
a:focus,
a:focus-visible {
  outline: none;
}

/* Модальное окно поиска */
.search-modal {
  touch-action: manipulation;
}

.search-input-wrapper {
  touch-action: manipulation;
}

.search-input-wrapper input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#desktopSearchInput,
#searchInput {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Кнопки */
.cart-btn,
.buy-btn,
.checkout-btn,
.qty-btn,
.qty-minus,
.qty-plus,
.qty-minus-fav,
.qty-plus-fav,
.cart-btn-fav,
.fav-remove,
.cart-item-remove,
.search-clear,
.search-modal-close,
.favorites-close,
.cart-close,
.burger-btn,
.color-btn,
.mem-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.bottom-nav-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.catalog-card,
.fav-card,
.cart-item,
.search-result-card,
.model-card {
  touch-action: manipulation;
}

.catalog-card a,
.fav-card a,
.search-result-card a,
.model-card a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.icon,
.search-icon {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Слайдер — разрешаем вертикальный скролл страницы */
.hero-slider {
  touch-action: pan-y;
}

.slider-dots button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.iphone-tab {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Оверлеи — блокируем жесты */
.burger-overlay,
.favorites-modal,
.cart-modal,
.search-modal {
  touch-action: none;
}

/* Внутри модалок — разрешаем скролл */
.favorites-body,
.cart-body,
.search-modal-body {
  touch-action: pan-y;
}

.product-gallery {
  touch-action: manipulation;
}

.thumbs img {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.search-dropdown-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Скрываем нижнюю навигацию на ПК */
.bottom-nav {
  display: none;
}

/* Счётчик корзины на ПК */
.cart-count {
  right: -8px;
}


/* =====================================================
   ВЕРХНЯЯ ПАНЕЛЬ (.top-bar)
   ===================================================== */
.top-bar {
  background: #000;
  color: #fff;
  font-size: 14px;
  padding: 10px 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-topbar);
}

.top-bar .container {
  width: var(--container-width);
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar .left,
.top-bar .right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-bar .left span {
  margin-right: 30px;
  color: #fff;
}

.top-bar a {
  color: #ccc;
  text-decoration: none;
  font-weight: 500;
}

.top-bar a:hover {
  color: #fff;
}


/* =====================================================
   ОСНОВНОЕ МЕНЮ (.main-header)
   ===================================================== */
.main-header {
  background: #fff;
  border-bottom: 1px solid #c9c9c9;
  padding: 10px 0;
  position: fixed;
  top: var(--header-topbar);
  left: 0;
  width: 100%;
  z-index: var(--z-mainheader);
}

.main-header .container {
  width: var(--container-width);
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  text-decoration: none;
}

.logo span {
  color: var(--pink);
}

.icons {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon {
  color: #111;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}

.icon svg {
  width: 26px;
  height: 26px;
  transition: stroke var(--transition-fast);
}

.icon:hover {
  color: var(--pink);
  transform: scale(1.1);
}

.icon:hover svg {
  stroke: var(--pink);
}

.search input {
  width: 400px;
  padding: 8px 15px;
  border: 1px solid #ccc;
  border-radius: 20px;
  color: #000;
}

.header-links a,
.header-links span {
  margin-left: 20px;
  text-decoration: none;
  color: #000;
  font-weight: 500;
}

.header-links .pink {
  color: var(--pink);
}


/* =====================================================
   НАВИГАЦИОННАЯ ПОЛОСА (.nav-bar)
   ===================================================== */
.nav-bar {
  background: #fff;
  border-bottom: 1px solid #c9c9c9;
  position: fixed;
  top: 95px;
  left: 0;
  width: 100%;
  z-index: var(--z-navbar);          /* 1000 — выше дропдауна (999) */
  box-shadow: 0 2px 0 0 #fff;        /* затирает субпиксельный зазор под панелью */
}

.nav-bar .container {
  width: var(--container-width);
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  padding: 10px 0;
  justify-content: left;
}

.menu {
  display: flex;
  /* gap убран: пункты прилегают «стенка к стенке»,
     визуальный отступ создаётся padding'ом самих пунктов */
  gap: 0;
  position: relative;
}

.menu-item {
  position: relative;
  /* Горизонтальный padding — визуальный зазор между текстами,
     но активная зона элементов непрерывна */
  padding: 0 20px;
}

.menu-item::before {
  content: "";
  position: absolute;
  top: -10px;
  /* Увеличен вниз: перекрывает щель между nav-bar и поверхностью */
  bottom: -20px;
  /* Горизонтально — ровно по краям, gap=0 устраняет «мёртвую зону» */
  left: 0;
  right: 0;
  background: transparent;
  z-index: 1;
}

.menu-item > a,
.menu-item > button.menu-trigger {
  position: relative;
  z-index: 2;
  text-decoration: none;
  color: #000;
  font-weight: 500;
  font-size: 15px;
  transition: color var(--transition-fast);
  padding: 10px 0;
}

.menu-item > a:hover,
.menu-item:hover > button.menu-trigger {
  color: var(--pink);
}


/* =====================================================
   ВЫПАДАЮЩЕЕ МЕНЮ (.dropdown)
   ===================================================== */
.dropdown {
  position: fixed;
  left: 0;
  top: var(--header-total);
  width: 100%;
  background: #f5f5f5;
  box-shadow: 0 8px 20px rgba(0,0,0,0);
  overflow: hidden;
  opacity: 1;
  max-height: 0;
  transition: max-height var(--transition);
  pointer-events: none;
  z-index: var(--z-dropdown);
}

/* Old dropdown hover suppressed — replaced by JS Shared Surface */
.menu-item:hover .dropdown {
  max-height: 0;
  pointer-events: none;
}

.dropdown-content {
  width: var(--container-width);
  max-width: var(--container-max);
  margin: 20px auto;
  color: #333;
  font-size: 15px;
  text-align: center;
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px;
  padding: 25px 5%;
  box-sizing: border-box;
}

.dropdown-grid h4 {
  font-size: 16px;
  color: #000;
  margin-bottom: 10px;
  font-weight: 600;
}

.dropdown-grid a {
  display: block;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 6px;
  transition: color var(--transition-fast);
}

.dropdown-grid a:hover {
  color: var(--pink);
}


/* =====================================================
   ОСНОВНОЙ КОНТЕНТ
   ===================================================== */
.main-content {
  width: var(--container-width);
  max-width: var(--container-max);
  margin: 1px auto;
  color: #333;
}

/* =====================================================
   ОВЕРЛЕЙ БЛЮРА (body::after) — двухуровневая система
   =====================================================

   Сценарий А — blur-active (выпадающее меню навигации):
     z-index: var(--z-blur-content) = 100
     Оверлей НИЖЕ навигации (z 1000+) → nav-bar и dropdown-surface
     остаются чёткими и кликабельными. Контент за ними затемняется.

   Сценарий Б — modal-blur-active (поиск / корзина / избранное):
     z-index: var(--z-blur-modal) = 10000
     Оверлей ВЫШЕ навигации (z 1002) → вся навигация уходит под
     тёмное стекло. Модалки (z 20001) плавают выше оверлея.

   Почему именно так, а не filter на элементах:
     filter: blur() на элементах с белыми фонами суммирует
     засветку → экран «белеет». backdrop-filter на одном
     псевдоэлементе работает как стекло: размывает то, что
     физически находится ЗА ним, не трогая сам слой.
   ===================================================== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-blur-content); /* 100 — базовое значение (dropdown-сценарий) */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, background 0.35s ease;
  will-change: opacity;
}

/* ── Сценарий А: выпадающее меню открыто ────────────────────
   z-index: 100 → НИЖЕ nav-bar (1000). Навигация чёткая.
   Мягкое затемнение фокусирует внимание на dropdown-панели.  */
body.blur-active::after {
  opacity: 1;
  z-index: var(--z-blur-content); /* 100 */
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px) saturate(1.4);
  -webkit-backdrop-filter: blur(4px) saturate(1.4);
}

/* ── Сценарий Б: поиск / корзина / избранное открыты ────────
   z-index: 10000 → ВЫШЕ всей навигации (max 1300).
   Вся шапка уходит под тёмное стекло. Модалки (20001) сверху. */
body.modal-blur-active::after {
  opacity: 1;
  z-index: var(--z-blur-modal); /* 10000 */
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px) saturate(1.5);
  -webkit-backdrop-filter: blur(8px) saturate(1.5);
}

/* ── pointer-events: none на контент ────────────────────────
   Оверлей перехватывает клики сам (pointer-events: none у него,
   поэтому явно отключаем кликабельность у контента позади него). */
body.blur-active .main-content,
body.blur-active .bestsellers,
body.blur-active .categories-section,
body.blur-active .brands-section,
body.blur-active .catalog-page,
body.blur-active .checkout-page,
body.blur-active .product-container,
body.blur-active .model-page {
  pointer-events: none;
}

body.modal-blur-active .main-content,
body.modal-blur-active .bestsellers,
body.modal-blur-active .categories-section,
body.modal-blur-active .brands-section,
body.modal-blur-active .catalog-page,
body.modal-blur-active .checkout-page,
body.modal-blur-active .product-container,
body.modal-blur-active .model-page {
  pointer-events: none;
}

/* =====================================================
   BURGER BUTTON
   ===================================================== */
.burger-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  width: 25px;
  background: none;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.burger-btn span {
  height: 3px;
  background: #000;
  border-radius: 2px;
  width: 100%;
  display: block;
  transition: all var(--transition);
}


/* =====================================================
   BURGER MENU (SIDEBAR)
   ===================================================== */
.burger-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 85vw;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  background: #fff;
  z-index: var(--z-burger);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 20px rgba(0,0,0,0.15);
}

.burger-menu.active {
  transform: translateX(0);
}

.burger-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.burger-title {
  font-size: 18px;
  font-weight: 600;
}

.burger-back {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.burger-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.burger-content {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.burger-level {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  inset: 0;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  overflow-y: auto;
}

.burger-level.active {
  transform: translateX(0);
}

.burger-level.previous {
  transform: translateX(-100%);
}

.burger-level li {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  cursor: pointer;
}

.burger-level li a {
  text-decoration: none;
  color: #000;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.burger-footer {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid #eee;
}

.burger-catalog-btn {
  display: block;
  text-align: center;
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
}

.burger-catalog-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(225,0,117,0.4);
  color: #fff;
}

.burger-city {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #111;
  cursor: pointer;
  border-radius: 10px;
  transition: color var(--transition-fast), background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.burger-city svg {
  color: var(--pink);
  flex-shrink: 0;
}

.burger-city:hover {
  color: var(--pink);
  background: var(--pink-bg);
}


/* =====================================================
   КАРУСЕЛЬ / СЛАЙДЕР
   ===================================================== */
.hero-slider {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
}

.slides-wrapper {
  display: flex;
  transition: transform 1s ease-in-out;
  will-change: transform;
}

.slide {
  flex-shrink: 0;
  width: 100vw;
  height: 520px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slide-content {
  max-width: 45%;
}

.slide-content h1 {
  font-size: 46px;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
  margin: 15px 0;
}

.slide-content .pink {
  color: var(--pink);
}

.badge {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 10px;
  font-size: 16px;
}

.slide-buy-btn {
  background: #000;
  color: #fff;
  font-size: 18px;
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
}

.slide-buy-btn:hover {
  background: #333;
}

.slide-img {
  max-height: 520px;
  object-fit: contain;
  user-select: none;
}

.slider-dots {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.slider-dots span {
  width: 10px;
  height: 10px;
  background: #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
}

.slider-dots span.active {
  background: var(--pink);
}


/* =====================================================
   КНОПКА «КУПИТЬ» (глобальная)
   ===================================================== */
.buy-btn {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.buy-btn:hover {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(225,0,117,0.3);
}


/* =====================================================
   БЕСТСЕЛЛЕРЫ
   ===================================================== */
.bestsellers {
  background: #fff;
  padding: 60px 0;
  transition: filter var(--transition-slow);
}

.bestsellers .container {
  width: var(--container-width);
  max-width: var(--container-max);
  margin: 0 auto;
}

.bestsellers .catalog-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 40px;
  text-align: center;
  color: #000;
}

.catalog-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 40px;
  color: #000;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 55px 40px;
}

.catalog-card {
  text-align: center;
  max-width: 240px;
  margin: 0 auto;
}

.card-top img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 15px;
}

.price {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: #000;
}

.model-small {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.model-big {
  font-size: 20px;
  margin-bottom: 16px;
  color: #000;
}

.card-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.cart-btn {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  border: none;
  color: white;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
}

.cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(225,0,117,0.3);
}

.fav-mini {
  background: none;
  border: none;
  cursor: pointer;
}

.fav-mini svg {
  width: 22px;
  height: 22px;
  stroke: #111;
  fill: none;
  stroke-width: 2;
  transition: 0.2s;
}

.fav-mini:hover svg {
  stroke: var(--pink);
}

.fav-mini.active svg {
  fill: var(--pink);
  stroke: var(--pink);
}


/* =====================================================
   ПАГИНАЦИЯ
   ===================================================== */
.pagination {
  margin-top: 60px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.page {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid #eee;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
  color: #000;
}

.page:hover {
  border-color: var(--pink-light);
  color: var(--pink-light);
}

.page.active {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  color: white;
  border: none;
}


/* =====================================================
   МОДАЛЬНОЕ ОКНО ИЗБРАННОГО
   ===================================================== */
.favorites-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: none;
  z-index: var(--z-modal-content);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.favorites-modal.active {
  display: flex;
  opacity: 1;
}

.favorites-content {
  background: #fff;
  width: 90%;
  max-width: 1000px;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.favorites-modal.active .favorites-content {
  transform: scale(1);
}

.favorites-header {
  background: #fff;
  color: #111;
  padding: 24px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e5e5;
}

.modal-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.favorites-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #111;
}

.favorites-close {
  background: transparent;
  border: 1px solid #e5e5e5;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.favorites-close:hover {
  background: #f5f5f5;
  border-color: #000;
  color: #000;
}

.favorites-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  background: #fafafa;
}

.favorites-body::-webkit-scrollbar {
  width: 8px;
}

.favorites-body::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.favorites-body::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 4px;
}

.favorites-body::-webkit-scrollbar-thumb:hover {
  background: var(--pink-darker);
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.favorites-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.favorites-empty svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  stroke: #e5e5e5;
}

.favorites-empty h3 {
  font-size: 20px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 600;
}

.favorites-empty p {
  font-size: 14px;
  color: #999;
}

.fav-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  position: relative;
  transition: all var(--transition);
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.fav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--pink);
}

.fav-card img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 16px;
  transition: transform var(--transition);
}

.fav-card:hover img {
  transform: scale(1.05);
}

.fav-card .price {
  font-weight: 600;
  font-size: 18px;
  margin: 10px 0;
  color: #111;
}

.fav-card .model-name {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 400;
}

.fav-card-specs {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-bottom: 12px;
}

/* Кнопка «В корзину» в избранном */
.fav-card .cart-btn {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  border: none;
  color: white;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
  width: 100%;
  max-width: 200px;
  display: block;
  margin: 0 auto;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.fav-card .cart-btn:hover {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(225,0,117,0.3);
}

.fav-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.fav-card:hover .fav-remove {
  opacity: 1;
}

.fav-remove:hover {
  background: var(--pink);
  transform: scale(1.1);
  opacity: 1;
}

.fav-remove svg {
  width: 16px;
  height: 16px;
  stroke: #999;
  transition: stroke var(--transition-fast);
}

.fav-remove:hover svg {
  stroke: white;
}

.fav-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--pink);
  color: white;
  border-radius: 50%;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border: 1.5px solid white;
}

.fav-count.show {
  opacity: 1;
  transform: scale(1);
}

.clickable-title {
  cursor: pointer;
  transition: color var(--transition-fast);
  color: #000;
  text-decoration: none;
}

.clickable-title:hover {
  color: var(--pink);
}

.model-card .clickable-title {
  text-decoration: none;
}


/* =====================================================
   СТИЛИ ДЛЯ КНОПОК В ИЗБРАННОМ (cart-btn-fav)
   ===================================================== */
.fav-card .cart-btn-fav {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  border: none;
  color: white;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

.fav-card .cart-btn-fav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(225,0,117,0.3);
}

.fav-card .cart-btn-fav.hidden {
  display: none;
}

/* Круглые кнопки +/- в избранном */
.fav-card .quantity-controls {
  display: none;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 0;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.fav-card .quantity-controls.active {
  display: flex;
}

.fav-card .qty-minus-fav,
.fav-card .qty-plus-fav {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pink);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 6px rgba(225,0,117,0.3);
}

.fav-card .qty-minus-fav:hover,
.fav-card .qty-plus-fav:hover {
  background: var(--pink-darker);
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(225,0,117,0.4);
}

.fav-card .qty-minus-fav:active,
.fav-card .qty-plus-fav:active {
  transform: scale(0.9);
}

.fav-card .quantity-controls .qty-value {
  color: #111;
  font-weight: 600;
  font-size: 16px;
  min-width: 30px;
  text-align: center;
}


/* =====================================================
   МОДАЛЬНОЕ ОКНО КОРЗИНЫ
   ===================================================== */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: none;
  z-index: var(--z-modal-content);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.cart-modal.active {
  display: flex;
  opacity: 1;
}

.cart-content {
  background: #fff;
  width: 90%;
  max-width: 1000px;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.cart-modal.active .cart-content {
  transform: scale(1);
}

.cart-header {
  background: #fff;
  color: #111;
  padding: 24px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e5e5;
}

.cart-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #111;
}

.cart-close {
  background: transparent;
  border: 1px solid #e5e5e5;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.cart-close:hover {
  background: #f5f5f5;
  border-color: #000;
  color: #000;
}

.cart-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  background: #fafafa;
}

.cart-body::-webkit-scrollbar {
  width: 8px;
}

.cart-body::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.cart-body::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 4px;
}

.cart-body::-webkit-scrollbar-thumb:hover {
  background: var(--pink-darker);
}

.cart-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.cart-empty svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  stroke: #e5e5e5;
}

.cart-empty h3 {
  font-size: 20px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 600;
}

.cart-empty p {
  font-size: 14px;
  color: #999;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all var(--transition);
}

.cart-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--pink);
}

.cart-item img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

.cart-item-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.cart-item-specs {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

.cart-item-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--pink);
  margin-right: 20px;
  flex-shrink: 0;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pink);
  color: white;
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(225,0,117,0.3);
}

.qty-btn:hover {
  background: var(--pink-darker);
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(225,0,117,0.4);
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-btn:disabled:hover {
  background: var(--pink);
  transform: none;
  box-shadow: 0 2px 6px rgba(225,0,117,0.3);
}

.qty-display {
  min-width: 32px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  color: #111;
}

.cart-item-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.cart-item-remove:hover {
  background: var(--pink);
  transform: scale(1.1);
}

.cart-item-remove svg {
  width: 16px;
  height: 16px;
  stroke: #999;
  transition: stroke var(--transition-fast);
}

.cart-item-remove:hover svg {
  stroke: white;
}

.cart-footer {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 24px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.cart-footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Строка города в модалках корзины и избранного */
.modal-city-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #999;
}

.modal-city-row svg {
  color: var(--pink);
  flex-shrink: 0;
}

.modal-city-row span {
  color: #666;
  font-weight: 500;
}

.cart-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-total > span:first-child {
  font-size: 14px;
  color: #666;
}

.total-price {
  font-size: 28px;
  font-weight: 700;
  color: #111;
}

.checkout-btn {
  background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(225,0,117,0.4);
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--pink);
  color: white;
  border-radius: 50%;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border: 1.5px solid white;
}

.cart-count.show {
  opacity: 1;
  transform: scale(1);
}


/* =====================================================
   ПОИСК В ХЕДЕРЕ (ДЕСКТОП)
   ===================================================== */
.search {
  position: relative;
}

.search input {
  width: 400px;
  padding: 8px 15px;
  border: 1px solid #ccc;
  border-radius: 20px;
  color: #000;
  transition: border-color var(--transition-fast);
}

.search input:focus {
  outline: none;
  border-color: var(--pink);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
  z-index: var(--z-modal-content);
}

.search-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 3px;
}

.search-dropdown-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.search-dropdown-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
  display: none;
}

.search-dropdown-no-results.visible {
  display: block;
}

.search-dropdown-results {
  display: none;
  flex-direction: column;
}

.search-dropdown-results.visible {
  display: flex;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover {
  background: #f8f8f8;
}

.search-dropdown-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.search-dropdown-info {
  flex: 1;
  min-width: 0;
}

.search-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin-bottom: 2px;
}

.search-dropdown-desc {
  font-size: 12px;
  color: #666;
}

.search-dropdown-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--pink);
  flex-shrink: 0;
}

/* Иконка поиска скрыта на десктопе */
.search-icon {
  display: none;
}


/* =====================================================
   МОДАЛЬНОЕ ОКНО ПОИСКА (ТОЛЬКО МОБИЛЬНЫЕ)
   ===================================================== */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: none;
  z-index: var(--z-search-modal);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  transition: opacity var(--transition);
}

.search-modal.active {
  display: flex;
  opacity: 1;
}

.search-modal-content {
  background: #fff;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.search-modal.active .search-modal-content {
  transform: translateY(0);
}

.search-modal-header {
  background: #fff;
  padding: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e5e5e5;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within {
  background: #fff;
  border-color: var(--pink);
}

.search-input-wrapper svg {
  width: 20px;
  height: 20px;
  stroke: #999;
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: #000;
  outline: none;
}

.search-input-wrapper input::placeholder {
  color: #999;
}

.search-clear {
  background: transparent;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: #e5e5e5;
  color: #000;
}

.search-modal-close {
  background: transparent;
  border: 1px solid #e5e5e5;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-modal-close:hover {
  background: #f5f5f5;
  border-color: #000;
  color: #000;
}

.search-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  background: #fafafa;
}

.search-modal-body::-webkit-scrollbar {
  width: 8px;
}

.search-modal-body::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.search-modal-body::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 4px;
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.search-empty svg {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  stroke: #e5e5e5;
}

.search-empty h3 {
  font-size: 18px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}

.search-empty p {
  font-size: 14px;
  color: #999;
}

.search-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  display: none;
}

.search-no-results.visible {
  display: block;
}

.search-no-results svg {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  stroke: #e5e5e5;
}

.search-no-results h3 {
  font-size: 18px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}

.search-no-results p {
  font-size: 14px;
  color: #999;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.search-result-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 16px;
  cursor: pointer;
  border: 1px solid #e5e5e5;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.search-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: var(--pink);
}

.search-result-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.search-result-name {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

.search-result-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.search-result-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--pink);
}


/* =====================================================
   КОНТРОЛЫ КОЛИЧЕСТВА (глобальные)
   ===================================================== */
.quantity-controls {
  display: none;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  border-radius: var(--radius-md);
  padding: 6px 10px;
}

.quantity-controls.active {
  display: flex;
}

.qty-minus-card,
.qty-plus-card,
.qty-minus-fav,
.qty-plus-fav {
  background: none;
  border: none;
  color: #111;
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.qty-minus-card:hover,
.qty-plus-card:hover,
.qty-minus-fav:hover,
.qty-plus-fav:hover {
  background: var(--pink);
  color: white;
}

.qty-value {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #111;
}

.cart-btn.hidden {
  display: none;
}

.cart-btn-fav.hidden {
  display: none;
}

/* Круглые кнопки +/- в карточках каталога */
.catalog-card .card-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.catalog-card .quantity-controls {
  display: none;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 0;
}

.catalog-card .quantity-controls.active {
  display: flex;
}

.catalog-card .quantity-controls button {
  background: var(--pink);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 6px rgba(225,0,117,0.3);
}

.catalog-card .quantity-controls button:hover {
  background: var(--pink-darker);
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(225,0,117,0.4);
}

.catalog-card .quantity-controls button:active {
  transform: scale(0.9);
}

.catalog-card .quantity-controls span {
  color: #111;
  font-weight: 600;
  font-size: 16px;
  min-width: 30px;
  text-align: center;
}

.catalog-card .cart-btn.hidden {
  display: none;
}


/* =====================================================
   СЕКЦИЯ КАТЕГОРИЙ
   ===================================================== */
.categories-section {
  padding: 50px 0 60px;
  background: #fff;
  padding-top: 1px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid #e5e5e5;
  border-left: 1px solid #e5e5e5;
}

.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 24px;
  border-right: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  cursor: pointer;
  transition: background var(--transition-fast);
  background: #fff;
}

.cat-card:hover {
  background: #fafafa;
  z-index: 10;
}

.cat-card img {
  width: 100%;
  max-width: 160px;
  height: 130px;
  object-fit: contain;
  margin-bottom: 16px;
  transition: transform 0.25s ease;
}

.cat-card:hover img {
  transform: scale(1.04);
}

.cat-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  text-align: center;
  transition: color var(--transition-fast);
}

.cat-card:hover .cat-name {
  color: var(--pink);
}

.cat-popup {
  display: none;
}


/* =====================================================
   КАРУСЕЛЬ БРЕНДОВ
   ===================================================== */
.brands-section {
  width: 100%;
  padding: 28px 0;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.brands-section::before,
.brands-section::after {
  content: '';
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.brands-section::before {
  left: 0;
  background: linear-gradient(to right, #fff 0%, transparent 100%);
}

.brands-section::after {
  right: 0;
  background: linear-gradient(to left, #fff 0%, transparent 100%);
}

.brands-track-wrapper {
  width: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x;
}

.brands-track-wrapper:active,
.brands-track-wrapper.is-dragging {
  cursor: grabbing;
}

.brands-track {
  display: flex;
  align-items: center;
  will-change: transform;
}

.brand-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 44px;
  height: 80px;
}

.brand-item img {
  height: 52px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: grayscale(100%);
  transition: filter var(--transition);
}

.brands-track-wrapper:not(.is-dragging) .brand-item:hover img {
  filter: grayscale(0%);
}

/* iStore в карусели брендов */
.brand-item-istore {
  text-decoration: none;
}

.istore-carousel-logo {
  font-size: 30px;
  font-weight: 700;
  color: #000;
  font-family: 'Segoe UI', sans-serif;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.istore-carousel-logo span {
  color: var(--pink);
}

.brand-item-istore:hover .istore-carousel-logo {
  opacity: 0.7;
}


/* =====================================================
   ВЫБОР ГОРОДА
   ===================================================== */
.city-label {
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.city-label:hover,
.city-label:hover #cityName {
  color: var(--pink);
  transition: color var(--transition-fast);
}

/* Модальное окно выбора города */
.city-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: var(--z-city-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.city-modal.active {
  display: flex;
  animation: cityFadeIn 0.25s ease;
}

@keyframes cityFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.city-modal-content {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 1100px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  animation: citySlideUp 0.28s ease;
  overflow: hidden;
}

@keyframes citySlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.city-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.city-modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.city-modal-close {
  background: #f5f5f5;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: all 0.2s;
}

.city-modal-close:hover {
  background: var(--pink);
  color: #fff;
}

.city-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid #f0f0f0;
  color: #aaa;
}

.city-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #111;
  background: transparent;
  font-family: 'Segoe UI', sans-serif;
}

.city-search-input::placeholder {
  color: #bbb;
}

.city-list {
  overflow-y: auto;
  padding: 12px 0 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.city-list::-webkit-scrollbar { width: 6px; }
.city-list::-webkit-scrollbar-track { background: #f5f5f5; }
.city-list::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 3px; }

.city-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  font-size: 15px;
  color: #222;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
}

.city-option:hover {
  color: var(--pink);
  background: var(--pink-bg);
}

.city-option.active {
  color: var(--pink);
  font-weight: 600;
}

.city-no-results {
  padding: 30px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
  grid-column: 1 / -1;
}

/* Тост */
.city-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111;
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
  white-space: nowrap;
}

.city-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* =====================================================
   ПОДТВЕРЖДЕНИЕ ГОРОДА (авто-определение)
   ===================================================== */
.city-confirm {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: var(--z-city-confirm);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 480px;
}

.city-confirm.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.city-confirm-inner {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #111;
  border: 1px solid #f0f0f0;
}

.city-confirm-inner svg {
  color: var(--pink);
  flex-shrink: 0;
}

.city-confirm-inner span {
  flex: 1;
}

.city-confirm-yes {
  background: var(--pink);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.city-confirm-yes:hover {
  background: var(--pink-darker);
}

.city-confirm-no {
  background: #f5f5f5;
  color: #555;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.city-confirm-no:hover {
  background: #eaeaea;
}


/* =====================================================
   БАННЕР КУКИ
   ===================================================== */
.cookie-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 99997;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 600px;
}

.cookie-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.cookie-banner-inner {
  background: #1a1a1a;
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.cookie-text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: #ddd;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn-accept {
  background: var(--pink);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.cookie-btn-accept:hover {
  background: var(--pink-darker);
}

.cookie-btn-decline {
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.cookie-btn-decline:hover {
  border-color: #888;
  color: #fff;
}


/* =====================================================
   МОБИЛЬНОЕ БЫСТРОЕ МЕНЮ
   ===================================================== */
.mobile-quick-nav {
  display: none;
}


/* =====================================================
   КАРТОЧКА ТОВАРА (product page)
   ===================================================== */
.product-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 80px;
  padding: 80px 60px;
  flex-wrap: wrap;
  font-family: Arial, sans-serif;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

.product-info {
  flex: 1;
  max-width: 400px;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.product-info h1 {
  font-size: 28px;
  margin-bottom: 10px;
  color: #000;
}

/* Кнопки цветов и памяти */
.color-options,
.memory-options,
.sim-options {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sim-options {
  justify-content: center;
}

.color-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  right: -2px;
}

.color-btn.active {
  border-color: var(--pink);
  transform: scale(1.1);
}

.mem-btn,
.sim-btn {
  border: 1px solid #ccc;
  background: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
  color: #000;
  -webkit-tap-highlight-color: transparent;
}

.mem-btn.active,
.sim-btn.active {
  border-color: var(--pink);
  color: var(--pink);
  background: var(--pink-bg);
}

.mem-btn:hover,
.sim-btn:hover {
  border-color: var(--pink);
}

/* Секция SIM */
.sim-section {
  margin-bottom: 20px;
}

.sim-section p {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 14px;
  color: #333;
}

/* Кнопки действий: В корзину + Избранное */
.product-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.product-fav {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.product-fav svg {
  width: 24px;
  height: 24px;
  stroke: #000;
  fill: none;
  stroke-width: 2;
  transition: all var(--transition-fast);
}

.product-fav:hover {
  background: var(--pink-light-bg);
  border-color: var(--pink);
}

.product-fav:hover svg {
  stroke: var(--pink);
  transform: scale(1.1);
}

.product-fav.active {
  background: var(--pink-light-bg);
  border-color: var(--pink);
}

.product-fav.active svg {
  fill: var(--pink);
  stroke: var(--pink);
}

/* Характеристики */
.specifications {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e5e5e5;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.specifications h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #111;
}

.specs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  gap: 15px;
  width: 100%;
  box-sizing: border-box;
}

.spec-label {
  color: #666;
  font-weight: 400;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

.spec-value {
  color: #111;
  font-weight: 500;
  text-align: right;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

/* Галерея */
.product-gallery {
  position: relative;
  text-align: center;
}

.product-gallery img {
  width: 400px;
  border-radius: 10px;
  transition: opacity var(--transition-slow);
}

.product-gallery img#mainImg {
  width: 420px;
  height: 420px;
  object-fit: contain;
  border-radius: 10px;
  transition: opacity 0.4s ease;
  background-color: #fff;
}

.thumbs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.thumbs img {
  width: 60px;
  height: 60px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.thumbs img.active {
  border-color: var(--pink);
  transform: scale(1.05);
}

.arrow {
  position: absolute;
  top: 40%;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  transition: 0.3s;
  color: #000;
  -webkit-tap-highlight-color: transparent;
}

.arrow.left  { left: -50px; }
.arrow.right { right: -50px; }

.arrow:hover {
  background: var(--pink);
  color: white;
}


/* =====================================================
   СТРАНИЦА ТОВАРОВ (CATALOG PAGE)
   ===================================================== */

/* Мобильное быстрое меню — на ПК скрыто, показывается в @media */

/* Стили checkout-page и catalog-page зависят от конкретных шаблонов,
   базовые blur-правила уже прописаны выше в .main-content */


/* =====================================================
   =======================================================
   МЕДИА-ЗАПРОСЫ (весь адаптив — в конце, без !important)
   =======================================================
   ===================================================== */

/* ─── Бренды: 768px ─── */
@media (max-width: 768px) {
  .brands-section::before,
  .brands-section::after {
    width: 60px;
  }

  .brand-item {
    padding: 0 30px;
    height: 60px;
  }

  .brand-item img {
    height: 36px;
    width: auto;
    max-width: 110px;
  }
}

/* ─── Категории: 900px ─── */
@media (max-width: 900px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Категории / cookie / city: 600px ─── */
@media (max-width: 600px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-card {
    padding: 20px 12px 18px;
  }

  .cat-card img {
    height: 90px;
  }

  .cat-popup {
    display: none;
  }

  .cookie-banner-inner {
    flex-direction: column;
    gap: 12px;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-btn-accept,
  .cookie-btn-decline {
    flex: 1;
    text-align: center;
  }

  .city-confirm {
    top: 70px;
  }

  .city-confirm-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  .city-modal {
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  .city-modal-content {
    max-height: 70vh;
    border-radius: var(--radius-xl);
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    max-width: 100%;
    margin: 0;
  }

  .city-modal-header {
    padding: 16px 18px 10px;
  }

  .city-modal-header h2 {
    font-size: 18px;
  }

  .city-search-wrap {
    padding: 10px 18px;
  }

  .city-list {
    grid-template-columns: repeat(2, 1fr);
    padding: 6px 0 10px;
  }

  .city-option {
    padding: 9px 18px;
    font-size: 13px;
  }
}

/* ─── Планшеты: 1100px ─── */
@media (max-width: 1100px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .favorites-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .model-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Планшеты: 1024px ─── */
@media (max-width: 1024px) {
  .model-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Планшеты: 800px ─── */
@media (max-width: 800px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .favorites-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 8px;
  }
}

/* ─── Планшеты: 768px ─── */
@media (max-width: 768px) {
  .model-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 8px;
    overflow-x: hidden;
    max-width: 100%;
  }

  .iphone-tab {
    padding: 12px 24px;
    font-size: 15px;
  }

  .model-title {
    font-size: 32px;
    margin-left: 0;
    padding: 0 8px;
  }

  .model-page {
    padding: 0;
  }

  .breadcrumbs-container {
    margin-left: 0;
    padding: 0 8px;
  }

  .iphone-tabs-wrapper {
    padding: 0 8px;
  }
}

/* ─── Каталог: 500px ─── */
@media (max-width: 500px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 10px;
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
  }

  .catalog-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  .card-top img {
    width: 100px;
    height: 100px;
  }

  .model-big {
    font-size: 14px;
  }

  .price {
    font-size: 13px;
  }

  .cart-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .catalog-card .quantity-controls {
    gap: 5px;
  }

  .catalog-card .quantity-controls button {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .catalog-card .quantity-controls span {
    font-size: 15px;
    min-width: 26px;
  }
}

/* ─── Мобильные: 480px ─── */
@media (max-width: 480px) {
  .model-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 8px;
    overflow-x: hidden;
    max-width: 100%;
  }

  .iphone-tab {
    padding: 10px 20px;
    font-size: 14px;
  }

  .model-title {
    font-size: 24px;
    margin-left: 0;
    padding: 0 8px;
  }

  .model-page {
    padding: 0;
    margin: 20px auto 60px;
  }

  .breadcrumbs-container {
    margin-left: 0;
    padding: 0 8px;
  }

  .iphone-tabs-wrapper {
    padding: 0 8px;
  }

  .model-card {
    padding: 10px;
  }

  .model-card img {
    max-width: 120px;
  }

  .model-name {
    font-size: 14px;
  }

  .model-price {
    font-size: 14px;
  }

  .model-buy {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* ─── Каталог catalog-page: 900px ─── */
@media (max-width: 900px) {
  .catalog-page {
    margin: 20px auto 20px;
    padding: 0 12px;
  }

  .catalog-page-title {
    font-size: 24px;
  }

  .catalog-brands-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .brand-card-inner {
    padding: 16px 18px;
    gap: 12px;
  }

  .brand-logo-wrap {
    width: 52px;
    height: 52px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-desc {
    font-size: 12px;
  }

  .catalog-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-card-img-wrap {
    height: 100px;
    padding: 10px;
  }

  .category-card-body {
    padding: 12px 14px 16px;
  }

  .category-card-name {
    font-size: 15px;
    margin-bottom: 4px;
  }

  .category-card-sub {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .category-card-link {
    font-size: 12px;
  }
}

/* ─── catalog-categories: 400px ─── */
@media (max-width: 400px) {
  .catalog-categories-grid {
    gap: 8px;
  }

  .category-card-img-wrap {
    height: 85px;
    padding: 8px;
  }
}

/* ─── Категории: 3 колонки если много (1101px+) ─── */
@media (min-width: 1101px) {
  .catalog-categories-grid.has-many {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ══════════════════════════════════════════════════════
   ГЛАВНЫЙ МОБИЛЬНЫЙ БЛОК (≤ 900px)
   Шапка становится статичной, появляется bottom-nav,
   бургер-кнопка, адаптируются все компоненты
   ══════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ── Общие правила ── */
  * {
    box-sizing: border-box;
  }

  html {
    overflow-x: hidden;
  }

  body {
    padding-top: 0;
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    margin: 0;
  }

  /* Убираем серый фон */
  body::before {
    display: none;
  }

  /* Убираем отступы у контейнеров */
  .main-content,
  .bestsellers,
  .container {
    width: 100%;
    max-width: 100vw;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }

  /* Скрытие всех меню ПК */
  .top-bar,
  .nav-bar,
  .header-links,
  .search {
    display: none;
  }

  /* ── Шапка: статичная на мобиле ── */
  .main-header {
    position: static;
    top: auto;
    padding: 15px 0;
    border-bottom: 1px solid #e5e5e5;
    overflow-x: hidden;
    margin-bottom: 0;
  }

  .main-header .container {
    justify-content: space-between;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 15px;
    box-sizing: border-box;
  }

  .logo {
    font-size: 22px;
  }

  .icons {
    display: flex;
    gap: 15px;
    margin-left: auto;
    margin-right: 15px;
  }

  .icon svg {
    width: 24px;
    height: 24px;
  }

  /* Счётчики избранного и корзины на мобиле */
  .fav-count {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    top: -3px;
    right: -3px;
    border-width: 2px;
  }

  .cart-count {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    top: -3px;
    right: -3px;
    border-width: 2px;
  }

  /* ── Основной контент ── */
  .main-content {
    margin-top: 0;
    padding-top: 0;
    overflow-x: hidden;
  }

  .bestsellers {
    padding-top: 40px;
    padding-bottom: 20px;
    overflow-x: hidden;
  }

  .bestsellers .container {
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 0 8px;
  }

  /* ── Model page ── */
  .model-page {
    overflow-x: hidden;
    max-width: 100vw;
    margin-top: 0;
    padding-top: 20px;
  }

  .model-page * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ── Слайдер ── */
  .hero-slider {
    position: relative;
    width: 100vw;
    left: calc(-1 * (100vw - 100%) / 2);
    margin-top: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    touch-action: pan-y;
  }

  .slides-wrapper {
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .slide {
    height: auto;
    padding: 30px 0;
    margin: 0;
    box-sizing: border-box;
    width: 100%;
  }

  .slide-inner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 0 15px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .slide-content {
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
  }

  .slide-content h1 {
    font-size: 26px;
    line-height: 1.3;
  }

  .badge {
    font-size: 14px;
  }

  .buy-btn {
    font-size: 16px;
    padding: 10px 22px;
  }

  .slide-img {
    max-width: 85%;
    max-height: 280px;
    padding: 0;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .slider-dots {
    bottom: 15px;
  }

  .dropdown {
    top: 60px;
  }

  /* ── Модальное окно избранного ── */
  .favorites-content {
    width: 95%;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .favorites-header {
    padding: 18px 20px;
  }

  .favorites-header h2 {
    font-size: 18px;
  }

  .favorites-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .favorites-body {
    padding: 15px 12px;
    overflow-x: hidden;
  }

  .favorites-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0;
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fav-card {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
    position: relative;
  }

  .fav-card img {
    width: 100%;
    height: auto;
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    margin: 0 auto;
  }

  .fav-card .price {
    font-size: 13px;
    text-align: center;
    margin: 4px 0;
  }

  .fav-card .model-name {
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
  }

  .fav-card .cart-btn-fav {
    width: 100%;
    padding: 8px 10px;
    font-size: 11px;
    margin-top: 4px;
  }

  .fav-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    opacity: 1;
    background: #f5f5f5;
    z-index: 10;
  }

  .fav-remove:hover {
    background: var(--pink);
    opacity: 1;
  }

  .fav-remove svg {
    width: 14px;
    height: 14px;
  }

  .fav-remove:hover svg {
    stroke: white;
  }

  /* Избранное: кнопки +/- мобиле */
  .fav-card .cart-btn-fav {
    padding: 8px 10px;
    font-size: 11px;
    margin-top: 4px;
  }

  .fav-card .qty-minus-fav,
  .fav-card .qty-plus-fav {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .fav-card .quantity-controls .qty-value {
    font-size: 15px;
    min-width: 26px;
  }

  /* ── Модальное окно корзины ── */
  .cart-content {
    width: 95%;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .cart-header {
    padding: 18px 20px;
  }

  .cart-header h2 {
    font-size: 18px;
  }

  .cart-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .cart-body {
    padding: 15px 12px;
    overflow-x: hidden;
  }

  .cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .cart-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px;
    gap: 12px;
    position: relative;
    border-bottom: 1px solid #eee;
  }
  .cart-item img {
    width: 65px;
    height: 65px;
    min-width: 65px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .cart-item-info {
    flex: 1;
    min-width: 0;
  }
  .cart-item-name {
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 2px;
  }
  .cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pink);
  }
  .cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .cart-item-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
  }

  .cart-footer {
    padding: 18px 15px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .cart-total {
    text-align: center;
  }

  .cart-total > span:first-child {
    font-size: 13px;
  }

  .total-price {
    font-size: 24px;
  }

  .checkout-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }

  .search input {
    width: 200px;
  }

  /* ── Burger button: показываем ── */
  .burger-btn {
    display: flex;
  }

  /* ── Карточка товара ── */
  .product-container {
    flex-direction: column;
    padding: 15px 8px;
    gap: 20px;
    align-items: center;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .product-container * {
    box-sizing: border-box;
  }

  .product-info {
    max-width: 100%;
    width: 100%;
    text-align: center;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .product-info h1 {
    font-size: 18px;
    word-wrap: break-word;
  }

  .price {
    font-size: 18px;
  }

  .product-actions {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
  }

  .color-options,
  .memory-options {
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-left: 0;
  }

  .color-btn {
    width: 28px;
    height: 28px;
  }

  .mem-btn {
    padding: 6px 12px;
    font-size: 14px;
  }

  .buy-btn {
    background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
    color: white;
    border: none;
    width: 100%;
    max-width: 300px;
    padding: 10px 0;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
  }

  .buy-btn:hover {
    background: linear-gradient(180deg, var(--pink-light), var(--pink-dark));
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(225,0,117,0.3);
  }

  .specifications {
    margin-top: 20px;
    padding-top: 20px;
    width: 100%;
    overflow-x: hidden;
  }

  .spec-item {
    gap: 10px;
    display: block;
    text-align: left;
  }

  .spec-label {
    font-size: 12px;
    max-width: 100%;
    word-wrap: break-word;
    display: block;
    text-align: left;
    margin-bottom: 4px;
    color: #666;
  }

  .spec-value {
    max-width: 100%;
    font-size: 13px;
    word-wrap: break-word;
    display: block;
    text-align: left;
    color: #111;
    font-weight: 500;
  }

  .product-gallery {
    width: 100%;
    max-width: 100%;
    position: relative;
    padding: 30px 15px 0;
    margin-top: 20px;
  }

  .product-gallery img#mainImg {
    width: 100%;
    height: auto;
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
  }

  .thumbs {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  .thumbs img {
  width: 45px;
  height: 45px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  }

  .arrow {
    width: 32px;
    height: 32px;
    font-size: 18px;
    display: none;
  }

  .arrow.left  { left: 5px; }
  .arrow.right { right: 5px; }

  /* ── Overlay бургер-меню ── */
  .burger-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: var(--z-burger-overlay);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .burger-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  /* ── Нижняя навигация ── */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    z-index: var(--z-bottom-nav);
    align-items: stretch;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-family: 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 2px;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }

  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    transition: stroke var(--transition-fast);
    flex-shrink: 0;
  }

  .bottom-nav-item span {
    line-height: 1;
    white-space: nowrap;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item:active {
    color: var(--pink);
  }

  .bottom-nav-item.active {
    color: var(--pink);
  }

  .bottom-nav-item.active svg {
    stroke: var(--pink);
  }

  /* ── Поиск на мобиле ── */
  .search-icon {
    display: flex;
  }

  .main-header .search {
    display: none;
  }

  .search-modal {
    padding-top: 20px;
  }

  .search-modal-content {
    width: 95%;
    max-height: 85vh;
    border-radius: var(--radius-md);
  }

  .search-modal-header {
    padding: 16px;
  }

  .search-input-wrapper {
    padding: 10px 14px;
  }

  .search-input-wrapper input {
    font-size: 15px;
  }

  .search-modal-close {
    width: 36px;
    height: 36px;
  }

  .search-modal-body {
    padding: 16px;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
  }

  .search-result-card {
    padding: 12px;
    gap: 12px;
  }

  .search-result-img {
    width: 70px;
    height: 70px;
  }

  .search-result-name {
    font-size: 14px;
  }

  .search-result-desc {
    font-size: 12px;
  }

  .search-result-price {
    font-size: 14px;
  }

  .search-empty {
    padding: 40px 20px;
  }

  .search-empty svg {
    width: 50px;
    height: 50px;
  }

  .search-empty h3 {
    font-size: 16px;
  }

  .search-empty p {
    font-size: 13px;
  }

  /* ── Мобильное быстрое меню ── */
  .mobile-quick-nav {
    display: block;
    background: #111;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .mobile-quick-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-quick-nav-track {
    display: flex;
    gap: 0;
    white-space: nowrap;
    padding: 0 4px;
  }

  .mq-item {
    display: inline-block;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
  }

  .mq-item:hover,
  .mq-item.active {
    color: #fff;
  }
.mobile-nav-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: var(--z-mainheader);
    will-change: transform;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .mobile-nav-wrapper.nav-hidden {
    transform: translateY(-100%);
  }
  .mobile-nav-wrapper .mobile-quick-nav { position: static; }
  .mobile-nav-wrapper .main-header      { position: static; }
} /* END @media (max-width: 900px) */


/* ─── Очень маленькие экраны: 360px ─── */
@media (max-width: 360px) {
  .product-gallery img#mainImg {
    max-width: 140px;
    max-height: 140px;
  }

  .product-info h1 {
    font-size: 16px;
  }

  .model-title {
    font-size: 20px;
    padding: 0 8px;
  }

  .breadcrumbs-container {
    padding: 0 8px;
  }

  .iphone-tabs-wrapper {
    padding: 0 8px;
  }

  .catalog-grid {
    padding: 0 8px;
  }

  .thumbs img {
    width: 40px;
    height: 40px;
  }

  .fav-card img {
    max-width: 80px;
    max-height: 80px;
  }

  .fav-card .model-name {
    font-size: 11px;
  }

  .favorites-body {
    padding: 12px 8px;
  }

  .bottom-nav-item {
    font-size: 9px;
  }

  .bottom-nav-item svg {
    width: 20px;
    height: 20px;
  }
}

/* =====================================================
   SHARED SURFACE DROPDOWN (Apple-style)
   Единая анимированная подложка для всех пунктов меню.
   ===================================================== */

/* ── Подложка ──────────────────────────────────────── */
.nav-dropdown-surface {
  position: fixed;
  left: 0;
  top: var(--header-total);
  width: 100%;
  /* Frosted glass */
  background: rgba(248, 248, 248, 0.90);
  backdrop-filter: blur(8px) saturate(1.5);
  -webkit-backdrop-filter: blur(8px) saturate(1.5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.09);
  overflow: hidden;
  /* Скрыта по умолчанию */
  height: 0;
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-dropdown);           /* 999 — под nav-bar (1000) */
  /* Нахлёст 5px: перекрывает субпиксельный зазор под nav-bar */
  margin-top: -5px;
  /* Изолирует backdrop-filter и перекраску от остальной страницы —
     устраняет мерцание секций при открытии меню */
  contain: paint;
  /* Плавная анимация высоты и появления */
  transition:
    height  0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Невидимый мост 40px: зона перехвата курсора между nav-bar и панелью */
.nav-dropdown-surface::before {
  content: "";
  position: absolute;
  top: -35px;
  left: 0;
  right: 0;
  height: 40px;
  background: transparent;
  z-index: 1; /* перекрывает любые зазоры — курсор не «проваливается» */
  /* pointer-events наследуется от родителя:
     none когда закрыто, auto когда .active */
}

.nav-dropdown-surface.active {
  opacity: 1;
  pointer-events: auto !important; /* панель гарантированно видит мышку */
  overflow: visible; /* ::before с top:-35px выходит за границы — нужно его открыть */
}

/* ── Панели контента ───────────────────────────────── */
.nav-dropdown-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* Скрыта (прозрачна) — становится видна только активная */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown-panel.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── На мобиле поверхность не нужна ───────────────── */
@media (max-width: 900px) {
  .nav-dropdown-surface {
    display: none;
  }
}
/* =====================================================
   ПРОМО-БАННЕРЫ (главная страница, под brand-carousel)
   ===================================================== */
.promo-banners {
  padding: 0 0 60px;
}

/* Контейнер-сетка: 2 колонки, 2 ряда */
.promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Базовые стили каждого баннера ── */
.promo-banner {
  display: block;
  position: relative;
  border-radius: 20px;
  overflow: hidden;           /* img scale не вылезает за скруглённые углы */
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Широкий баннер: занимает оба столбца (верхний ряд) */
.promo-banner--wide {
  grid-column: 1 / -1;
  height: 380px;
}

/* Половинные баннеры: каждый — один столбец (нижний ряд) */
.promo-banner--half {
  height: 380px;
}

/* ── Обёртка изображения (scale живёт здесь) ── */
.promo-banner__img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.promo-banner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;   /* снимаем любой глобальный max-width с img */
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s ease;
  will-change: transform;
}

/* Плавное увеличение картинки при hover */
.promo-banner:hover .promo-banner__img {
  transform: scale(1.05);
}

/* ── Тёмный градиентный оверлей ── */
.promo-banner__overlay {
  position: absolute;
  inset: 0;
  /* Градиент снизу-вверх: текст всегда читается */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.30) 45%,
    rgba(0, 0, 0, 0.04) 100%
  );
  transition: background 0.35s ease;
}

.promo-banner:hover .promo-banner__overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.80) 0%,
    rgba(0, 0, 0, 0.38) 50%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

/* ── Текстовый блок (поверх оверлея) ── */
.promo-banner__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 32px;
  color: #fff;
  /* text не участвует в scale — он вне __img-wrap */
  transform: translateZ(0); /* GPU-слой, убирает мерцание */
}

.promo-banner__title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.promo-banner--half .promo-banner__title {
  font-size: 26px;
}

.promo-banner__cta {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.25s ease, letter-spacing 0.25s ease;
}

.promo-banner:hover .promo-banner__cta {
  color: #fff;
  letter-spacing: 0.3px;
}

/* ── Мобильная адаптация ── */
@media (max-width: 768px) {
  .promo-grid {
    grid-template-columns: 1fr; /* все блоки в одну колонку */
    gap: 12px;
  }

  .promo-banner--wide,
  .promo-banner--half {
    grid-column: 1 / -1; /* каждый на 100% ширины */
    height: 220px;
  }

  .promo-banner__content {
    padding: 20px 22px;
  }

  .promo-banner__title {
    font-size: 24px;
  }

  .promo-banner--half .promo-banner__title {
    font-size: 22px;
  }

  .promo-banner__cta {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .promo-banner--wide,
  .promo-banner--half {
    height: 185px;
    border-radius: 14px;
  }
}
/* Reset browser defaults for nav modal trigger buttons.
   These buttons replace <a href="#"> — must look identical to the old links. */
button.menu-trigger,
button.icon {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: inherit;
}

/* Иконка поиска скрыта на десктопе.
   Специфичность выше чем у button.icon выше — побеждает в каскаде. */
button.icon.search-icon {
    display: none;
}

/* product page — breadcrumbs hidden visually, present in DOM for SEO/JSON-LD */
.product-container .breadcrumbs-container {
    display: none;
}