:root {
  --bg: #F5F6FA; /* Вернул чуть сероватый фон, чтобы белые карточки выделялись */
  --surface: #FFFFFF;
  --surface-2: #F0F2F8;
  --surface-3: #E9ECF5;
  --text: #0F172A;
  --muted: #667085;
  --muted-2: #98A2B3;

  --primary: #5B5CF6;
  --primary-700: #3F40D7;
  --primary-100: #EEF0FF;

  --success: #2BCB7A;
  --danger: #FF4D6D;
  --warning: #FBBF24;

  --border: rgba(15, 23, 42, .10);
  --shadow: 0 16px 40px rgba(15, 23, 42, .06);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, .08);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --container: 1200px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;
  --sp-10: 40px; --sp-12: 48px;

  --header-h: 72px;
  --bottom-nav-h: 70px;
  --checkout-bar-h: 80px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.35;

  /* Sticky Footer Fix */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
    flex: 1; /* Растягивает контент */
    width: 100%;
    position: relative;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
::selection { background: rgba(91, 92, 246, .25); }

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

hr.sep {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--sp-6) 0;
}

/* ---------- Типографика ---------- */
.h1 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
.h2 { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.h3 { font-size: 18px; line-height: 1.2; margin: 0; }
.p { margin: 0; color: var(--muted); }
.kicker { color: var(--muted); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 12px; }
.small { font-size: 13px; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Карточки/поверхности ---------- */
.card, .surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.card { box-shadow: var(--shadow); }
.card.pad, .surface.pad { padding: var(--sp-6); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.pill:hover { background: var(--surface-3); }
.pill[aria-pressed="true"], .pill.is-active {
  background: var(--primary-100);
  border-color: rgba(91, 92, 246, .25);
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  background: var(--surface-2);
  color: var(--text);
}
.badge.sale { background: rgba(43, 203, 122, .14); color: #159a55; }
.badge.discount { background: rgba(255, 77, 109, .14); color: #D61A45; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 22px rgba(91, 92, 246, .25);
}
.btn.primary:hover { background: var(--primary-700); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.link { padding: 0; background: transparent; border-color: transparent; color: var(--primary); }
.btn.block { width: 100%; }

.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; }

/* ---------- Поля ввода ---------- */
.field { display: grid; gap: 8px; }
.label { font-size: 12px; color: var(--muted); font-weight: 700; }
.input, .select, .textarea {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border); /* ВОТ ОНА, ОБВОДКА */
  background: var(--surface-2);
  padding: 16px 18px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(91, 92, 246, .40);
  box-shadow: 0 0 0 4px rgba(91, 92, 246, .10);
  background: #fff;
}
.input[aria-invalid="true"] { border-color: rgba(255, 77, 109, .55); box-shadow: 0 0 0 4px rgba(255, 77, 109, .10); }

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95); /* Чуть плотнее */
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  height: auto;
  display: block;
  padding: 12px 0;
}
.header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.header__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.brand__mark {
  width: 45px; height: 45px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 18px rgba(91, 92, 246, .25);
}
.brand__title { display: grid; line-height: 1.1; }
.brand__title b { font-size: 15px; }
.brand__title span { font-size: 12px; color: var(--muted); font-weight: 700; }

.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a { padding: 10px 12px; border-radius: 14px; font-weight: 800; color: var(--muted); }
.nav__links a:hover { color: var(--text); background: var(--surface-2); }

.city, .phone {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800; color: var(--text);
  cursor: pointer;
}
.header__actions { display: flex; gap: 14px; align-items: center; }
.action-btn {
    position: relative;
    color: var(--text);
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    gap: 4px;
}
.action-btn:hover { color: var(--primary); }
.action-btn svg { width: 24px; height: 24px; }

/* ---------- Слайдер (Promo) ---------- */
.promo-section { padding-top: 24px; padding-bottom: 10px; }
.promo-slider {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    height: 550px;
    background: #0f172a;
    box-shadow: var(--shadow);
}
.promo-slide { display: none; height: 100%; width: 100%; position: relative; }
.promo-slide.active { display: block; animation: fadeIn 0.6s ease-in-out; }
.promo-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0; filter: none;
}
.promo-content {
    position: relative; z-index: 1; height: 100%;
    display: flex; flex-direction: column; justify-content: center;
    padding: 40px 60px; color: #fff; max-width: 800px;
}
.promo-title { font-size: clamp(24px, 4vw, 42px); font-weight: 900; line-height: 1.1; margin-bottom: 16px; }
.promo-desc { font-size: 18px; font-weight: 500; opacity: 0.9; margin-bottom: 24px; }
.slider-controls {
    position: absolute; bottom: 30px; right: 30px; z-index: 10;
    display: flex; gap: 12px;
}
.slider-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #fff; transition: 0.2s;
}
.slider-btn:hover { background: #fff; color: var(--primary); }

@keyframes fadeIn { from { opacity: 0.4; } to { opacity: 1; } }

/* ---------- Секции и Гриды ---------- */
.section { padding: 42px 0; }
.section--tight { padding: 26px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* Hero Card (Static) */
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: center; }
.hero__card {
  padding: 26px; border-radius: 32px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hero__fineprint { margin-top: 14px; display: flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 700; }
.hero__mock { padding: 22px; }
.phone-mock {
  border-radius: 34px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  background: #000; aspect-ratio: 10/16;
}
.phone-mock img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Магазин и Карточки ---------- */
.shop-top { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.search {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 22px; background: var(--surface-2); border: 1px solid var(--border);
}
.search input { border: none; background: transparent; outline: none; width: 100%; font-weight: 700; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.shop-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* КАРТОЧКА ТОВАРА (ФИНАЛ) */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(15, 23, 42, .12); }

.product-card__img {
    width: 100%;
    height: 220px; min-height: 220px;
    flex-shrink: 0;
    background: #fff; border-bottom: 1px solid var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.product-card__img img { width: 100%; height: 100%; object-fit: contain; padding: 15px; }

.product-card__body { padding: 14px; display: flex; flex-direction: column; flex-grow: 1; }
.product-card__body .title {
    font-weight: 800; font-size: 15px; line-height: 1.3;
    margin-bottom: 8px; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; height: 2.6em;
}
.product-card__actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.product-card .price { font-size: 18px; font-weight: 900; }
.product-card__meta { margin-top: 8px; display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }

/* Слайдер в карточке */
.product-card__slider {
    position: relative; width: 100%; height: 220px; min-height: 220px;
    background: #fff; border-bottom: 1px solid var(--surface-2);
}
.pc-slides {
    display: flex; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; height: 100%; width: 100%;
    scrollbar-width: none;
}
.pc-slides::-webkit-scrollbar { display: none; }
.pc-slide {
    min-width: 100%; height: 100%; scroll-snap-align: center;
    display: flex; align-items: center; justify-content: center;
}
.pc-slide img { width: 100%; height: 100%; object-fit: contain; padding: 15px; }
.pc-dots {
    position: absolute; bottom: 8px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 4px; pointer-events: none;
}
.pc-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,0.2); transition: 0.2s; }
.pc-dot.active { background: var(--primary); transform: scale(1.2); }

/* ---------- Корзина и Оформление ---------- */
.cart, .checkout {
    display: grid;
    /* 1fr - контент, 380px - фиксированная ширина сайдбара */
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}
.cart-item {
    display: grid;
    /* Картинка | Инфо | Кнопка удаления */
    grid-template-columns: 120px 1fr auto;
    gap: 16px;
    padding: 16px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.cart-item__img {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0; /* Не сжимать картинку */
}
.cart-item__img img {
    width: 100%; height: 100%; object-fit: contain;
}
.cart-item__title { font-weight: 900; }
.cart-item__controls { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 16px;
  border: 1px solid transparent; background: var(--surface-2);
  cursor: pointer; display:grid; place-items:center;
    margin-left: 25px;
}
.icon-btn:hover { background: var(--surface-3); }

.summary {
    position: sticky;
    top: 100px; /* Отступ сверху при прокрутке */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.summary__row { display:flex; justify-content: space-between; gap: 12px; font-weight: 800; color: var(--muted); margin-top: 10px; }
.summary__row strong { color: var(--text); }
.summary__total { display:flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.summary__total b { font-size: 22px; }

/* Методы доставки и оплаты */
.delivery-options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.delivery-card-label, .pay-label { display: block; cursor: pointer; height: 100%; }
.delivery-card, .pay {
    border: 1px solid var(--border); border-radius: 16px; padding: 16px;
    height: 100%; background: var(--surface); transition: 0.2s;
    display: flex; flex-direction: column; justify-content: space-between;
}
.delivery-card-label:has(input:checked) .delivery-card,
.pay-label:has(input:checked) .pay {
    border-color: var(--primary); background: var(--primary-100);
    box-shadow: 0 4px 12px rgba(91, 92, 246, 0.15);
}
.pay__top, .delivery-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dot { width: 18px; height: 18px; border-radius: 999px; border: 3px solid rgba(15,23,42,.25); }
.pay-label:has(input:checked) .dot { border-color: rgba(91,92,246,.25); background: var(--primary); }

.warehouse-item {
    padding: 14px; border: 1px solid var(--border); border-radius: 16px;
    margin-bottom: 10px; cursor: pointer; background: #fff; transition: 0.2s;
}
.warehouse-item:has(input:checked) { border-color: var(--primary); background: var(--primary-100); }

/* Поля ввода (адаптив) */
.grid-responsive-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Футер ---------- */
.footer { padding: 32px 0 40px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 14px; }
.social-links { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.social-btn {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); transition: 0.2s; border: 1px solid transparent;
}
.social-btn:hover { background: #fff; border-color: var(--primary); transform: translateY(-2px); }
.social-btn img { width: 20px; height: 20px; object-fit: contain; }

/* ---------- МОБИЛЬНЫЕ ЭЛЕМЕНТЫ ---------- */
.mnav {
    position: fixed; inset: 0; width: 100%; height: 100vh;
    background: #ffffff; z-index: 2000;
    padding: 20px; padding-top: max(20px, env(safe-area-inset-top));
    overflow-y: auto; display: flex; flex-direction: column;
    will-change: transform;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.mnav.is-open { transform: translateY(0); }
.mnav__grid { display: grid; gap: 8px; margin-top: 15px; }
.mnav a { padding: 14px 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); font-weight: 900; }

.bottom-nav {
    height: var(--bottom-nav-h); position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 100; background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--border); backdrop-filter: blur(12px); display: none;
}
.bottom-nav__inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 10px 10px; }
.btab {
    display: grid; place-items: center; gap: 6px; padding: 10px 8px;
    border-radius: 16px; color: var(--muted); font-weight: 900; font-size: 12px; border: none; background: transparent; cursor: pointer;
}
.btab svg { width: 22px; height: 22px; }
.btab[aria-current="page"] {
    color: var(--primary);
    background: rgba(91, 92, 246, .08);
}

.checkout-bottom {
    display: none; position: fixed; left: 0; right: 0;
    bottom: var(--bottom-nav-h); z-index: 90;
    padding: 10px 10px 14px;
    background: rgba(245, 246, 250, 0.95); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
}
.checkout-bottom__bar {
    border-radius: 22px; background: var(--primary); color: #fff;
    padding: 16px 16px; display: flex; justify-content: space-between; align-items: center;
    font-weight: 900; box-shadow: 0 18px 30px rgba(91, 92, 246, .30);
}

.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none;
}
.toast {
    background: #fff; border-radius: var(--radius-md); padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-left: 4px solid var(--primary);
    max-width: 300px; pointer-events: auto; animation: slideIn 0.3s ease-out forwards;
    display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

.modal {
  position: fixed;
  inset: 0; /* top:0, right:0, bottom:0, left:0 */
  z-index: 9999 !important; /* Самый верхний слой, выше тостов и меню */
  display: none; /* Скрыто по умолчанию */
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .6); /* Чуть темнее фон */
  backdrop-filter: blur(8px);
}

.modal__head {
    margin-top: 25px;
    text-align: center;
}

/* Когда добавлен класс is-open — показываем */
.modal.is-open {
  display: flex !important;
}

.modal__panel {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px rgba(15, 23, 42, .25);
  overflow: hidden;
  position: relative;
  /* Анимация появления */
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Кнопки внутри модалки делаем широкими и красивыми */
.modal__body .pill {
    width: 100%;
    justify-content: flex-start; /* Текст слева */
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    text-decoration: none; /* Убираем подчеркивание */
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal__body .pill:hover {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.modal__body .pill.is-active {
    background: var(--primary-100);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.modal__body .pill svg {
    color: var(--muted);
    flex-shrink: 0;
}
.modal__body .pill.is-active svg {
    color: var(--primary);
}


/* --- ИСПРАВЛЕНИЕ КНОПОК КОЛИЧЕСТВА (.qty) --- */
.qty {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px; /* Чуть меньше радиус */
    padding: 4px;
    height: 40px; /* Фикс высота */
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.qty button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--surface-2); /* Серый фон кнопкам */
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: 0.2s;
    padding: 0; /* Убираем внутренние отступы */
}

.qty button:hover {
    background: var(--primary-100);
    color: var(--primary);
}

.qty .num {
    min-width: 36px; /* Фикс ширина для цифры */
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}


/* --- ИСПРАВЛЕНИЕ КАРТИНКИ В КОРЗИНЕ --- */
.cart-item__img {
    width: 100px; /* Фикс размер */
    height: 100px;
    min-width: 100px; /* Чтобы не сжималось */
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item__img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Вписываем картинку целиком */
    padding: 5px;
}

.product-page {
    display: grid;
    /* Десктоп: 2 колонки. Картинка (55%) | Инфо (45%) */
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px; /* Большой отступ между фото и инфо */
    align-items: start;
    margin-top: 20px;
}

/* --- ЛЕВАЯ КОЛОНКА: ГАЛЕРЕЯ --- */
.gallery {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    /* На десктопе можно сделать галерею "липкой", если описание длинное */
    position: sticky;
    top: 90px;
}

.gallery__main {
    width: 100%;
    height: 500px; /* Фиксированная высота на десктопе */
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gallery__main img,
.gallery__main video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Картинка вписывается, не обрезаясь */
    display: block;
}

/* Миниатюры снизу */
.gallery__thumbs {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--surface-2);
    overflow-x: auto; /* Скролл, если много фото */
}

.thumb {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px;
    background: #fff;
    transition: 0.2s;
}

.thumb:hover { border-color: var(--muted); }
.thumb.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(91, 92, 246, 0.1);
}

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


/* --- ПРАВАЯ КОЛОНКА: ИНФОРМАЦИЯ --- */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-info .surface {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

/* Выбор цены (радио-карточки) */
.options {
    display: grid;
    /* На десктопе цены в 2 колонки, чтобы влезали */
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.radio-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    background: var(--surface-2);
    position: relative;
}
.radio-card:hover { border-color: var(--muted); }

/* Скрытый инпут внутри */
.radio-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.radio-card:has(input:checked) {
    background: var(--primary-100);
    border-color: var(--primary);
    color: var(--primary-700);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: bottom; /* Выравниваем по нижней линии шрифта */
}

/* Название (слева) */
.table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600; /* Чуть тоньше для названия */
    width: 40%;       /* Ширина колонки названия */
    padding-right: 10px;
}

/* Значение (справа) */
.table td {
    text-align: right; /* ВАЖНО: Прижимаем к правому краю */
    font-weight: 800;  /* Жирный для значения */
    color: var(--text);
}

/* Убираем линию у последнего ряда, чтобы было аккуратно */
.table tr:last-child th,
.table tr:last-child td {
    border-bottom: none;
}

.date-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto; /* Горизонтальный скролл */
    padding-bottom: 5px; /* Место под скроллбар (если виден) */

    /* Скрываем скроллбар */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.date-scroll::-webkit-scrollbar { display: none; }

.date-card-label {
    flex-shrink: 0; /* Чтобы не сжимались */
    cursor: pointer;
    min-width: 90px;
}

.date-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 10px 12px;
    text-align: center;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-card b {
    display: block;
    font-size: 14px;
    font-weight: 800;
}

.date-card span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* Активное состояние */
.date-card-label:has(input:checked) .date-card {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(91, 92, 246, 0.25);
}

.date-card-label:has(input:checked) .date-card span {
    color: rgba(255,255,255, 0.9);
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary); /* Цвет галочки в современных браузерах */
    border: 1px solid var(--border);
    border-radius: 4px;
}

.grid-3, .grid-4 {
    display: grid;
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

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

/* --- КАРТОЧКА "FEATURE" (Преимущества и Категории) --- */
.feature {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none; /* Если это ссылка */
    color: var(--text);
    height: 100%; /* Чтобы все были одной высоты */
}

.feature__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.feature__icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--surface-2); /* Светло-серый фон */
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: 0.2s;
}

/* При наведении на карточку красим иконку */
.feature:hover .feature__icon {
    background: var(--primary);
    color: #fff;
}

.feature b {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.feature p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
    font-weight: 500;
}


/* ========== MEDIA QUERIES (АДАПТИВ) ========== */
@media (hover: hover) {
    .feature:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.06);
        border-color: var(--primary);
    }
}

@media (max-width: 1100px) {
  .shop-grid{ grid-template-columns: repeat(4, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__mock { display:none; }
}

@media (max-width: 760px) {
  /* Шапка */
  .nav__links, .phone { display:none; }
  .header__bottom { display: none; }
  .header__top { margin-bottom: 0; }
  .header__inner { padding: 10px 0; }

  /* Меню и Навигация */
  .bottom-nav { display: block; }
  .checkout-bottom { display: block; }
  body { padding-bottom: calc(var(--bottom-nav-h) + 20px); }
  body.has-checkout-bar { padding-bottom: calc(var(--bottom-nav-h) + var(--checkout-bar-h) + 20px) !important; }

  /* Сетки */
  .grid-3 { grid-template-columns: 1fr; }
  .grid-responsive-2 { grid-template-columns: 1fr !important; }
  .footer__grid { grid-template-columns: 1fr; }
  .cart, .checkout { grid-template-columns: 1fr; }
  .summary { position: static; margin-top: 20px;}
  .cart-item {
        grid-template-columns: 90px 1fr; /* Картинка и контент */
        gap: 12px;
        position: relative;
    }

    /* Кнопку удаления в абсолют, чтобы не мешала */
    .cart-item__actions {
        position: absolute;
        top: 12px;
        right: 12px;
    }
  .mobile-reverse-col { display: flex !important; flex-direction: column-reverse; gap: 24px; }
  .steps { grid-template-columns: 1fr; }

  /* Карточки */
  .shop-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2px !important;
    margin-left: -16px; margin-right: -16px; padding-bottom: 20px;
  }
  .product-card { border-radius: 0; border-right: none; border-left: none; box-shadow: none; }
  .product-card:nth-child(even) { border-left: 1px solid var(--surface-2); }

  .product-card__slider, .product-card__img, .pc-slide { height: 160px; min-height: 160px; }
  .product-card__body .title { font-size: 13px; height: 2.6em; margin-bottom: 6px; }
  .product-card .price { font-size: 15px; }
  .product-card__meta span { font-size: 10px; }

  .promo-slider { height: 450px; }
  .promo-content { padding: 30px; }

  /* Checkout */
  .pay-grid { grid-template-columns: 1fr !important; }
  .delivery-options-grid { grid-template-columns: 1fr !important; }
  .product-page {
        grid-template-columns: 1fr; /* Одна колонка */
        gap: 20px;
    }

    .gallery {
        position: static; /* Убираем липкость */
        border-radius: 0; /* На мобильном можно от края до края (опционально) */
        margin-left: -16px; /* Компенсация паддингов контейнера */
        margin-right: -16px;
        width: calc(100% + 32px);
        border-left: none;
        border-right: none;
    }

    .gallery__main {
        height: 350px; /* Поменьше высота на телефоне */
    }

    .gallery__thumbs {
        padding: 10px 16px; /* Отступы по бокам */
    }

    /* Цены в одну колонку на мобильном */
    .options {
        grid-template-columns: 1fr;
    }
    .grid-2, .grid-3, .grid-4 {
      grid-template-columns: 1fr !important;
      gap: 24px; /* Добавим отступ побольше, чтобы блоки не слипались */
  }
     .mobile-hidden {
        display: none !important;
    }

    /* ФИКС ПЕРЕПОЛНЕНИЯ (Горизонтальный скролл) */
    /* Запрещаем форме быть шире экрана */
    .checkout, .checkout form, .surface {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Поля ввода не должны вылезать за пределы */
    .input, .select, .textarea {
        max-width: 100%;
        min-width: 0; /* Важно для Grid/Flex */
    }
    .feature {
        flex-direction: row; /* На мобильном иконка слева, текст справа */
        align-items: center;
        padding: 16px;
    }

    .feature__top {
        margin-bottom: 0;
        margin-right: 12px;
    }

    /* Обертка для текста на мобильном */
    .feature__content {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
  .container { width: calc(100% - 24px); }
  .calc { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 100px 1fr; }
  .cart-item__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ========================================= */
/* СТИЛИ ДЛЯ НАТИВНОГО ПРИЛОЖЕНИЯ            */
/* ========================================= */

body.is-native-app {
    /* Отступ сверху: Шапка + Статус-бар */
    padding-top: calc(56px + env(safe-area-inset-top));

    /* Отступ снизу (ДЛЯ КОНТЕНТА): */
    /* Высота меню (70px) + Safe Area + Воздух (20px) */
    padding-bottom: calc(70px + env(safe-area-inset-bottom) + 20px) !important;
}

/* Если есть плашка Checkout, увеличиваем отступ контента еще больше */
body.is-native-app.has-checkout-bar {
    padding-bottom: calc(70px + 80px + env(safe-area-inset-bottom) + 20px) !important;
}

/* Скрываем лишнее */
body.is-native-app .header,
body.is-native-app .footer,
body.is-native-app .breadcrumb,
body.is-native-app nav[aria-label="breadcrumb"] {
    display: none !important;
}

/* --- App Header --- */
.app-header { display: none; }
body.is-native-app .app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(56px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
}
.app-back-btn {
    position: absolute;
    left: 16px;
    top: calc(env(safe-area-inset-top) + 10px);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent;
    color: var(--text); font-size: 20px; cursor: pointer;
}
.app-title {
    font-weight: 700; font-size: 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 70%;
}
body.is-native-app .promo-section { display: none; }

/* --- НИЖНИЕ ПАНЕЛИ В ПРИЛОЖЕНИИ --- */

/* 1. Нижнее меню */
body.is-native-app .bottom-nav {
    /* Сбрасываем фикс высоту, чтобы она растянулась на паддинг */
    height: auto;
    /* Добавляем отступ снизу под системную полоску */
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; /* Белый фон на всю высоту, включая safe area */
}

/* 2. Плашка Checkout (Корзина) */
body.is-native-app .checkout-bottom {
    /* Поднимаем её выше: Высота меню + Safe Area */
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    /* Если вдруг меню нет (редко), то просто от низа */
    padding-bottom: 10px;
}

/* 3. Мобильное меню "Еще" */
body.is-native-app .mnav {
    /* Чтобы крестик закрытия не улетал под шапку */
    padding-top: calc(20px + env(safe-area-inset-top) + 56px);
}

body.is-native-app .checkout-bottom {
    /*
       Высота меню (~70px) +
       Нижний отступ меню (Safe Area) +
       Небольшой зазор (10px)
    */
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 10px) !important;

    /* Тень, чтобы отделить визуально от меню */
    box-shadow: 0 -4px 10px rgba(0,0,0,0.08);
    z-index: 95; /* Между меню (100) и контентом */
}