/* ──────────────────────────────────────────────────────────
   Магазин на Береговой — PWA
   Направление: «Fresh Confident»
   Кремовая бумага + изумрудный + коралловый акцент.
   Display = Unbounded, Body = Manrope.
   ────────────────────────────────────────────────────────── */

:root {
  /* Палитра */
  --primary:        #0d8a3f;
  --primary-dark:   #0a6e32;
  --primary-soft:   #d8f3df;
  --primary-tint:   #effaf1;

  --accent:         #ea580c;
  --accent-dark:    #c2410c;
  --accent-soft:    #fff1e6;

  --bg:             #ffffff;
  --bg-warm:        #fbf8f1;   /* кремовая бумага */
  --bg-alt:         #f4f1ea;
  --bg-card:        #ffffff;

  --text:           #14110f;
  --text-muted:     #6b6660;
  --text-subtle:    #a09a92;

  --border:         #ebe6dc;
  --border-soft:    #f1ede4;

  --danger:         #c1272d;
  --warning:        #d97706;

  /* Тени — мягкие, многослойные, с цветовыми рефлексами */
  --shadow-xs:      0 1px 3px rgba(20, 17, 15, .04), 0 0 1px rgba(20, 17, 15, .06);
  --shadow-sm:      0 2px 8px rgba(20, 17, 15, .06), 0 0 1px rgba(20, 17, 15, .08);
  --shadow-md:      0 4px 12px rgba(20, 17, 15, .06), 0 12px 28px rgba(20, 17, 15, .06);
  --shadow-lg:      0 8px 18px rgba(20, 17, 15, .06), 0 24px 48px rgba(20, 17, 15, .08);
  --shadow-cta:     0 4px 14px rgba(13, 138, 63, .30), 0 1px 3px rgba(13, 138, 63, .18);
  --shadow-accent:  0 4px 14px rgba(234, 88, 12, .28), 0 1px 3px rgba(234, 88, 12, .15);
  --shadow-card:    0 1px 2px rgba(20, 17, 15, .04), 0 4px 16px rgba(20, 17, 15, .04);

  --radius-sm:      10px;
  --radius:         16px;
  --radius-lg:      22px;
  --radius-pill:    999px;

  --header-h:       60px;
  --hero-h:         36px;
  --bottomnav-h:    66px;

  --font-body:      "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display:   "Unbounded", "Manrope", sans-serif;

  --easing:         cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-warm);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; min-height: 100dvh; }

button {
  font: inherit;
  font-family: var(--font-body);
  cursor: pointer; border: none; background: none; color: inherit;
}
input, select, textarea {
  font: inherit;
  font-family: var(--font-body);
  color: inherit;
}
a { color: inherit; text-decoration: none; }

/* ── Splash ─────────────────────────────────────────────── */
.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 14px;
  background: var(--bg-warm);
}
.splash-icon { font-size: 64px; }
.splash-text { color: var(--text-muted); font-weight: 600; }

/* ── Шапка ──────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background:
    linear-gradient(90deg, rgba(255,255,255,.06) 0%, transparent 40%, rgba(255,255,255,.04) 100%),
    linear-gradient(135deg, #0d9944 0%, #0a6e32 50%, #085a28 100%);
  color: white;
  display: flex; align-items: center; padding: 0 14px;
  box-shadow: 0 2px 8px rgba(10, 60, 28, .25), 0 8px 24px rgba(10, 60, 28, .12);
}
.app-header-back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-right: 6px;
  border-radius: 12px;
  transition: background .18s var(--easing);
}
.app-header-back:active { background: rgba(255, 255, 255, .2); }
.app-header-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header-cart {
  position: relative;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border-radius: 12px;
  transition: background .18s var(--easing);
}
.app-header-cart:active { background: rgba(255, 255, 255, .2); }
.app-header-cart-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--accent); color: white;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--primary-dark);
  animation: badge-pop .22s var(--easing);
}
@keyframes badge-pop {
  0%   { transform: scale(.4); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ── Hero-полоска под шапкой ────────────────────────────── */
.app-hero {
  position: sticky; top: var(--header-h); z-index: 45;
  height: var(--hero-h);
  background: #0a6e32;
  color: rgba(255, 255, 255, .96);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.005em;
  padding: 0 14px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.app-hero strong { color: #ffd089; font-weight: 800; }

/* ── Основная область ──────────────────────────────────── */
.app-main {
  padding-bottom: calc(var(--bottomnav-h) + 16px);
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

/* ── Sales hero (внутри каталога) ───────────────────────── */
.sales-hero {
  position: relative;
  margin: 14px 14px 8px;
  padding: 22px 22px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 0%, rgba(234, 88, 12, .15) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(13, 138, 63, .15) 0%, transparent 55%),
    linear-gradient(135deg, #ffffff 0%, #fbf8f1 100%);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sales-hero::before {
  content: '';
  position: absolute; top: -40px; right: -30px;
  font-size: 160px; line-height: 1; opacity: .12;
  transform: rotate(-12deg);
  pointer-events: none;
}
.sales-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sales-hero-title {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em;
  color: var(--text);
}
.sales-hero-title em { font-style: normal; color: var(--primary); }
.sales-hero-sub {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.5; max-width: 92%;
}
.sales-hero-perks {
  display: flex; gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.sales-hero-perk {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  color: var(--text);
}
.sales-hero-perk-icon { font-size: 14px; }

/* ── Главная: поиск + доставка стрип ──────────────────── */
.home-search-bar {
  padding: 10px 14px 6px;
  position: relative;
}
.home-search-icon {
  position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
  font-size: 16px; pointer-events: none;
}
.home-search-bar input {
  width: 100%; height: 48px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: 15px; font-weight: 500;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color .18s var(--easing);
}
.home-search-bar input::placeholder { color: var(--text-subtle); }
.home-search-bar input:focus { border-color: var(--primary); }

.home-delivery-strip {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 14px 10px;
  padding: 10px 16px;
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  color: var(--primary-dark);
}

/* ── Главная: плитки категорий (Пятёрочка-стиль) ─────── */
.home-cats { padding: 0 12px 20px; }
.home-section-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 4px 14px;
  color: var(--text);
}
.cat-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 440px) { .cat-tiles-grid { gap: 12px; } }
@media (min-width: 600px) { .cat-tiles-grid { grid-template-columns: repeat(3, 1fr); } }

.cat-tile {
  position: relative;
  display: flex; flex-direction: column;
  align-items: flex-start;
  padding: 14px 14px 12px;
  min-height: 130px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.6);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.55) 0%, transparent 60%),
    linear-gradient(160deg, var(--tile-bg) 0%, var(--tile-accent) 100%);
  cursor: pointer;
  transition: transform .18s var(--easing), box-shadow .18s var(--easing);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0,0,0,.04),
    0 8px 24px rgba(0,0,0,.03),
    inset 0 1px 0 rgba(255,255,255,.5);
}
.cat-tile:active { transform: scale(0.97); }
.cat-tile:hover {
  box-shadow:
    0 4px 12px rgba(0,0,0,.06),
    0 12px 32px rgba(0,0,0,.06),
    inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-2px);
}

.cat-tile-name {
  font-size: 14px; font-weight: 700;
  text-align: left;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  line-height: 1.25;
  max-width: 75%;
  position: relative;
  z-index: 1;
}
.cat-tile-count {
  font-size: 11px; font-weight: 600;
  color: rgba(0,0,0,.4);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* Кластер из 3 эмодзи в правом нижнем углу */
.cat-tile-icons {
  position: absolute;
  right: 6px; bottom: 6px;
  display: flex; gap: 0;
}
.cat-tile-emoji {
  font-size: 36px; line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.1));
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
/* Начальная раскладка */
.cat-tile-emoji[style*="--ei:0"] { transform: translate(8px, 4px) rotate(-8deg); z-index: 3; }
.cat-tile-emoji[style*="--ei:1"] { transform: translate(0, -6px) rotate(5deg); z-index: 2; font-size: 30px; }
.cat-tile-emoji[style*="--ei:2"] { transform: translate(-6px, 6px) rotate(-3deg); z-index: 1; font-size: 28px; opacity: .7; }

/* Анимация при наведении / touch — пружинящий разлёт */
.cat-tile:hover .cat-tile-emoji[style*="--ei:0"],
.cat-tile.touching .cat-tile-emoji[style*="--ei:0"] {
  transform: translate(4px, -4px) rotate(-4deg) scale(1.18);
}
.cat-tile:hover .cat-tile-emoji[style*="--ei:1"],
.cat-tile.touching .cat-tile-emoji[style*="--ei:1"] {
  transform: translate(-8px, -12px) rotate(8deg) scale(1.12);
}
.cat-tile:hover .cat-tile-emoji[style*="--ei:2"],
.cat-tile.touching .cat-tile-emoji[style*="--ei:2"] {
  transform: translate(-14px, 2px) rotate(-6deg) scale(1.08);
  opacity: 1;
}

.cat-tile-skeleton {
  min-height: 130px;
  border-radius: var(--radius-lg);
}

/* ─── Плитка категории с реальными фото (Пятёрочка-стиль) ───
   Внешняя карточка — пастель, внутри — белая с заголовком и фото внизу. */
.cat-tile--photo {
  position: relative;
  padding: 14px;
  min-height: 260px;
  background: var(--tile-bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.25) 0%, transparent 55%);
  border: none;
  overflow: hidden;
}
.cat-tile--photo .cat-tile-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 232px;
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow:
    0 1px 2px rgba(60,50,20,.04),
    0 6px 18px rgba(60,50,20,.06);
}
.cat-tile--photo .cat-tile-text {
  text-align: left;
  z-index: 2;
}
.cat-tile--photo .cat-tile-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #14110f;
  margin: 0;
}
.cat-tile--photo .cat-tile-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #9a938b;
}
.cat-tile--photo .cat-tile-photos {
  margin-top: auto;
  padding-top: 10px;
  align-self: center;
  width: 100%;
  height: 104px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
}
.cat-tile--photo .cat-tile-photo {
  height: 100%;
  width: auto;
  max-width: 33%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.10));
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}

.cat-tile--photo:hover .cat-tile-photo[data-pi="0"],
.cat-tile--photo.touching .cat-tile-photo[data-pi="0"] {
  transform: translateY(-4px) rotate(-3deg);
}
.cat-tile--photo:hover .cat-tile-photo[data-pi="1"],
.cat-tile--photo.touching .cat-tile-photo[data-pi="1"] {
  transform: translateY(-7px) scale(1.04);
}
.cat-tile--photo:hover .cat-tile-photo[data-pi="2"],
.cat-tile--photo.touching .cat-tile-photo[data-pi="2"] {
  transform: translateY(-4px) rotate(3deg);
}

.cat-tile-spark {
  position: absolute;
  right: 14px;
  bottom: 10px;
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,.85);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.08));
  pointer-events: none;
  z-index: 3;
  animation: catSparkPulse 2.8s ease-in-out infinite;
}
@keyframes catSparkPulse {
  0%, 100% { opacity: .7; transform: scale(1) rotate(0deg); }
  50%      { opacity: 1;  transform: scale(1.15) rotate(12deg); }
}

@media (min-width: 600px) {
  .cat-tile--photo { min-height: 300px; }
  .cat-tile--photo .cat-tile-card { min-height: 272px; }
  .cat-tile--photo .cat-tile-title { font-size: 26px; }
  .cat-tile--photo .cat-tile-photos { height: 128px; }
  .cat-tile-spark { width: 22px; height: 22px; }
}

/* ── Поиск ──────────────────────────────────────────────── */
.search-bar {
  position: sticky; top: calc(var(--header-h) + var(--hero-h)); z-index: 40;
  background: var(--bg-warm);
  padding: 10px 14px;
}
.search-bar input {
  width: 100%; height: 48px;
  padding: 0 14px 0 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 15px; font-weight: 500;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color .18s var(--easing), box-shadow .18s var(--easing);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a09a92' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: 14px center;
}
.search-bar input::placeholder { color: var(--text-subtle); }
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 138, 63, .12);
}

/* ── Лента категорий ────────────────────────────────────── */
.cat-tabs {
  position: sticky; top: calc(var(--header-h) + var(--hero-h) + 68px); z-index: 35;
  background: var(--bg-warm);
  padding: 4px 0 12px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  margin: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  transition: all .18s var(--easing);
}
.cat-tab:first-child { margin-left: 14px; }
.cat-tab:last-child  { margin-right: 14px; }
.cat-tab:active { transform: scale(.96); }
.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-cta);
}

/* ── Прогресс до бесплатной доставки ────────────────────── */
.free-delivery-strip {
  margin: 6px 14px 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-xs);
}
.free-delivery-strip.is-free {
  background: var(--primary-tint);
  border-color: #b6e4c4;
}
.free-delivery-text {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.free-delivery-text .icon { font-size: 16px; }
.free-delivery-text strong {
  color: var(--accent-dark); font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.free-delivery-strip.is-free .free-delivery-text strong {
  color: var(--primary-dark);
}
.free-delivery-bar {
  height: 6px; border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}
.free-delivery-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #f97316 100%);
  border-radius: 999px;
  transition: width .35s var(--easing);
}
.free-delivery-strip.is-free .free-delivery-bar-fill {
  background: linear-gradient(90deg, var(--primary) 0%, #16a34a 100%);
}

/* ── Сетка товаров ──────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 12px 16px;
}
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 8px 16px 20px; }
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  .product-grid { grid-template-columns: repeat(5, 1fr); }
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 10px 12px;
  display: flex; flex-direction: column;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform .2s var(--easing), box-shadow .2s var(--easing);
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.product-card:active {
  transform: translateY(0) scale(.98);
  box-shadow: var(--shadow-xs);
}
.product-card.unavailable { opacity: 0.5; filter: grayscale(.3); }

.product-photo {
  width: 100%; aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.6) 0%, transparent 60%),
    linear-gradient(135deg, #effaf1 0%, #d8f3df 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Тинты по категориям — нежные, многослойные */
.product-photo[data-cat="Молочные продукты"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65) 0%, transparent 60%),
              linear-gradient(135deg, #ebf4fd 0%, #c7dffa 100%);
}
.product-photo[data-cat="Хлебобулочные изделия"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.6) 0%, transparent 60%),
              linear-gradient(135deg, #fff5db 0%, #fde7a7 100%);
}
.product-photo[data-cat="Мясо и птица"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55) 0%, transparent 60%),
              linear-gradient(135deg, #fdebec 0%, #f9c5c8 100%);
}
.product-photo[data-cat="Овощи и фрукты"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65) 0%, transparent 60%),
              linear-gradient(135deg, #effaf1 0%, #c2ecd0 100%);
}
.product-photo[data-cat="Напитки"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65) 0%, transparent 60%),
              linear-gradient(135deg, #e7fbfd 0%, #b6ecf2 100%);
}
.product-photo[data-cat="Бакалея"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65) 0%, transparent 60%),
              linear-gradient(135deg, #fef9d6 0%, #fbf09b 100%);
}
.product-photo[data-cat="Заморозка"] {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65) 0%, transparent 60%),
              linear-gradient(135deg, #f1edff 0%, #d6cefb 100%);
}

/* Бейджи в углу карточки — социальное доказательство */
.product-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}
.product-badge {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
}
.product-badge.hit  { background: var(--accent); color: white; }
.product-badge.new  { background: #2563eb; color: white; }
.product-badge.sale { background: var(--danger); color: white; }
.product-badge.low  { background: rgba(255, 245, 230, .92); color: var(--accent-dark); }
.product-badge.out  { background: rgba(255, 235, 235, .92); color: var(--danger); }

.product-name {
  font-size: 14px; font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
  color: var(--text);
}
.product-meta-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}
.product-price {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.product-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.product-action {
  margin-top: auto;
  height: 42px;
}
.btn-add {
  width: 100%; height: 42px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: transform .12s var(--easing), background .15s var(--easing);
  box-shadow: var(--shadow-cta);
  letter-spacing: -0.01em;
}
.btn-add:active {
  background: var(--primary-dark);
  transform: scale(.96);
}
.btn-add::before { content: '+'; font-size: 18px; font-weight: 700; line-height: 1; }

.qty-controls {
  display: flex; align-items: center; justify-content: space-between;
  height: 42px;
  background: var(--primary);
  border-radius: 12px;
  color: white;
  overflow: hidden;
  box-shadow: var(--shadow-cta);
}
.qty-btn {
  width: 42px; height: 42px;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s var(--easing);
}
.qty-btn:active { background: var(--primary-dark); }
.qty-value {
  flex: 1; text-align: center;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Skeleton-загрузка ──────────────────────────────────── */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 12px 16px;
}
@media (min-width: 600px) { .skeleton-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 8px 16px; } }
@media (min-width: 900px) { .skeleton-grid { grid-template-columns: repeat(4, 1fr); } }
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 10px 12px;
  border: 1px solid var(--border-soft);
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 0%, #faf6ec 50%, var(--bg-alt) 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.4s linear infinite;
}
.skeleton-photo { aspect-ratio: 1; border-radius: 14px; margin-bottom: 10px; }
.skeleton-line  { height: 14px; margin-bottom: 6px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.price { height: 18px; width: 40%; margin-top: 8px; margin-bottom: 12px; }
.skeleton-action { height: 42px; border-radius: 12px; }
.cat-tabs-skeleton {
  display: flex; gap: 8px; padding: 4px 14px 12px;
  overflow: hidden;
}
.skeleton-tab {
  display: inline-block;
  height: 38px; min-width: 80px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.skeleton-tab:nth-child(2) { min-width: 110px; }
.skeleton-tab:nth-child(3) { min-width: 70px; }
.skeleton-tab:nth-child(4) { min-width: 95px; }
.skeleton-tab:nth-child(5) { min-width: 85px; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Sticky мини-корзина ───────────────────────────────── */
.mini-cart {
  position: fixed; bottom: var(--bottomnav-h); left: 0; right: 0;
  z-index: 48;
  padding: 10px 14px;
  pointer-events: none;
  transform: translateY(120%);
  transition: transform .28s var(--easing);
}
.mini-cart.is-visible { transform: translateY(0); pointer-events: auto; }
.mini-cart-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: var(--primary);
  color: white;
  height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-cta), 0 0 0 4px rgba(13, 138, 63, .12);
  transition: transform .12s var(--easing);
}
.mini-cart-btn:active { transform: scale(.98); }
.mini-cart-icon { font-size: 22px; }
.mini-cart-count {
  background: rgba(255, 255, 255, .22);
  border-radius: 10px;
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 800;
}
.mini-cart-text { flex: 1; text-align: left; letter-spacing: -0.01em; }
.mini-cart-total {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ── Нижняя навигация ──────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 49;
  height: var(--bottomnav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.98) 100%);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 -4px 20px rgba(0,0,0,.03);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-subtle);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.01em;
  position: relative;
  transition: color .15s var(--easing);
}
.bottom-nav-item .icon { font-size: 22px; line-height: 1; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute; top: 6px;
  width: 28px; height: 3px; border-radius: 999px;
  background: var(--primary);
}
.bottom-nav-item .nav-badge {
  position: absolute; top: 8px; right: calc(50% - 22px);
  background: var(--accent); color: white;
  border-radius: 999px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── Корзина (страница) ─────────────────────────────────── */
.cart-list {
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.cart-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; gap: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
}
.cart-item-photo {
  width: 64px; height: 64px;
  background: var(--primary-tint);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px; font-weight: 600;
  margin-bottom: 4px; line-height: 1.3;
}
.cart-item-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.cart-item-controls {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
}
.cart-item-qty {
  display: flex; align-items: center;
  background: var(--bg-warm);
  border-radius: 10px;
  height: 36px;
  border: 1px solid var(--border);
}
.cart-item-qty button {
  width: 36px; height: 36px;
  font-size: 18px; font-weight: 700;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.cart-item-qty button:active { background: var(--primary-soft); }
.cart-item-qty .qty-value {
  min-width: 36px; text-align: center;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  color: var(--text);
}
.cart-item-total {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.cart-item-remove {
  width: 36px; height: 36px;
  color: var(--text-subtle);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.cart-item-remove:active { background: #fce8e6; color: var(--danger); }

.cart-summary {
  margin: 16px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.cart-summary-row {
  display: flex; justify-content: space-between;
  padding: 7px 0;
  font-size: 14px; font-weight: 500;
  color: var(--text);
}
.cart-summary-row.total {
  border-top: 1px dashed var(--border);
  margin-top: 8px; padding-top: 14px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px;
  letter-spacing: -0.01em;
}
.cart-summary-row.total span:last-child { font-variant-numeric: tabular-nums; }
.cart-summary-hint {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-tint);
  border-radius: 10px;
}
.cart-summary-warning {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 12px;
  font-size: 13px; font-weight: 600;
  border: 1px solid #ffd9b8;
  line-height: 1.45;
}

/* ── Кнопка-фиксация снизу ──────────────────────────────── */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--bg);
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(20, 17, 15, .06);
}
.btn-primary {
  width: 100%; height: 56px;
  background: var(--primary);
  color: white;
  border-radius: 16px;
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-cta);
  transition: transform .12s var(--easing), background .15s var(--easing);
}
.btn-primary:disabled {
  background: var(--bg-alt);
  color: var(--text-subtle);
  box-shadow: none;
}
.btn-primary:not(:disabled):active {
  background: var(--primary-dark);
  transform: scale(.99);
}

/* ── Пустые состояния ───────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px 60px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 80px; margin-bottom: 18px; opacity: .9; }
.empty-state-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--text); margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.empty-state-text { font-size: 14px; line-height: 1.55; max-width: 300px; font-weight: 500; }
.empty-state-cta {
  margin-top: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 24px;
  background: var(--primary); color: white;
  border-radius: 14px;
  font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-cta);
}

/* ── Магазин закрыт ─────────────────────────────────────── */
.shop-closed-banner {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: white;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(217, 119, 6, .25);
}

/* ── Тосты ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + 16px);
  transform: translateX(-50%);
  background: rgba(20, 17, 15, .95);
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  animation: toast-in 0.24s var(--easing);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Загрузка (старый спиннер, оставляем для checkout) ── */
.loader { display: flex; justify-content: center; padding: 40px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bg-alt);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-center {
  display: flex; justify-content: center; align-items: center;
  padding: 60px 20px; color: var(--text-muted);
}
.muted { color: var(--text-muted); }

/* ── Форма оформления ─────────────────────────────────── */
.checkout-form {
  padding: 14px; padding-bottom: calc(var(--bottomnav-h) + 80px);
  display: flex; flex-direction: column; gap: 14px;
}
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-xs);
}
.form-label {
  display: block; font-weight: 700;
  font-size: 14px; color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.form-label .req { color: var(--danger); }
.form-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  outline: none;
  font-size: 16px;
  font-weight: 500;
  min-height: 48px;
  transition: border-color .18s var(--easing), box-shadow .18s var(--easing);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 138, 63, .12);
}
textarea.form-input { resize: vertical; min-height: 64px; }
.form-hint { margin-top: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-hint.error { color: var(--danger); font-weight: 600; }

.form-select {
  width: 100%;
  padding: 13px 42px 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  outline: none;
  font-size: 16px; font-weight: 600;
  min-height: 48px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b6660' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color .18s var(--easing), box-shadow .18s var(--easing);
}
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 138, 63, .12);
}
.form-select:disabled {
  background-color: var(--bg-alt);
  color: var(--text-subtle);
  cursor: not-allowed;
}

/* старый радио-блок, оставлен для совместимости */
.windows-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.window-option {
  display: flex; align-items: center; gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg); cursor: pointer;
  min-height: 46px; font-size: 14px; font-weight: 500;
  transition: all .15s var(--easing);
}
.window-option input { accent-color: var(--primary); }
.window-option:has(input:checked) {
  border-color: var(--primary); background: var(--primary-tint);
  font-weight: 700;
}

.payment-block .payment-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--primary-tint);
  border: 1.5px solid var(--primary);
}
.payment-option-icon { font-size: 28px; }
.payment-option-title { font-weight: 700; letter-spacing: -0.01em; }
.payment-option-hint { font-size: 13px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

/* ── Trust signals ──────────────────────────────────────── */
.trust-block {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}
.trust-item {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
}
.trust-icon { font-size: 26px; margin-bottom: 6px; }
.trust-title {
  font-size: 12px; font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--text);
}
.trust-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

/* ── Статус заказа ────────────────────────────────────── */
.order-status-card {
  padding: 28px 18px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.7) 0%, transparent 50%),
    linear-gradient(135deg, #d8f3df 0%, #b6e4c4 100%);
  border-radius: var(--radius-lg);
  margin: 16px 14px;
  text-align: center;
  border: 1px solid #b6e4c4;
}
.order-status-card.is-error {
  background: linear-gradient(135deg, #fce8e6 0%, #f8c5c8 100%);
  border-color: #f8c5c8;
}
.order-status-icon { font-size: 60px; line-height: 1; }
.order-status-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  margin-top: 10px; letter-spacing: -0.02em;
}
.order-status-hint {
  color: var(--text-muted); margin-top: 6px; font-size: 14px;
  font-weight: 500;
}

.status-timeline {
  padding: 0 18px 8px;
  display: flex; flex-direction: column; gap: 0;
  position: relative;
}
.status-step {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  position: relative;
}
.status-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 14px; top: 38px;
  width: 2px; height: calc(100% - 18px);
  background: var(--border);
}
.status-step.done:not(:last-child)::after { background: var(--primary); }
.status-step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--primary);
  flex-shrink: 0; z-index: 1;
}
.status-step.done .status-step-dot {
  background: var(--primary); border-color: var(--primary); color: white;
}
.status-step.active .status-step-dot {
  box-shadow: 0 0 0 6px var(--primary-soft);
}
.status-step-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.status-step.done .status-step-label   { color: var(--text); font-weight: 600; }
.status-step.active .status-step-label { color: var(--text); font-weight: 700; }

.order-info-block,
.order-items-block {
  margin: 14px; padding: 14px;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
}
.order-info-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 14px; font-weight: 500;
  border-bottom: 1px dashed var(--border);
}
.order-info-row:last-child { border-bottom: none; }
.order-info-row > span:first-child { color: var(--text-muted); flex-shrink: 0; }
.order-info-row > span:last-child  { text-align: right; font-weight: 600; }

.order-items-title {
  font-family: var(--font-display);
  font-weight: 700; margin-bottom: 10px; font-size: 16px;
  letter-spacing: -0.01em;
}
.order-item-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 10px; padding: 8px 0; font-size: 14px; font-weight: 500;
  border-bottom: 1px dashed var(--border);
}
.order-item-row:last-child { border-bottom: none; }
.order-item-qty { color: var(--text-muted); min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.order-item-sum { min-width: 80px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-item-row.summary { grid-template-columns: 1fr auto auto; color: var(--text-muted); }
.order-item-row.summary.total {
  font-family: var(--font-display);
  font-weight: 700; color: var(--text); font-size: 18px;
  border-top: 2px solid var(--border); padding-top: 12px; margin-top: 6px;
  letter-spacing: -0.01em;
}

.order-footer-hint {
  text-align: center; color: var(--text-muted);
  font-size: 13px; padding: 8px 16px 24px;
  font-weight: 500;
}
