/* TulKoza — пастельная витрина */
:root {
  --sage: #8fafa0;
  --sage-deep: #4a6b5c;
  --sage-soft: #d5e6de;
  --peach: #f0c5b5;
  --peach-deep: #c4785c;
  --butter: #efe3b5;
  --sky: #b8d0df;
  --sky-deep: #5a7f96;
  --blush: #e8c8d4;
  --ink: #2a3530;
  --muted: #6a7a72;
  --line: rgba(74, 107, 92, 0.16);
  --paper: #f3f7f5;
  --paper-2: #eaf2ee;
  --surface: #fffcfb;
  --shadow: 0 18px 40px rgba(42, 53, 48, 0.08);
  --radius: 18px;
  --nav-h: 72px;
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* ИСПРАВЛЕНИЕ: Блокируем горизонтальный скролл (чтобы страница не ездила вправо-влево) */
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
          radial-gradient(1200px 600px at 10% -10%, rgba(240, 197, 181, 0.45), transparent 55%),
          radial-gradient(900px 500px at 95% 0%, rgba(184, 208, 223, 0.5), transparent 50%),
          radial-gradient(800px 500px at 50% 100%, rgba(213, 230, 222, 0.7), transparent 55%),
          var(--paper);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* ИСПРАВЛЕНИЕ: Дублируем блокировку для body */
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ——— Утилиты ——— */
.hidden {
  display: none !important;
}

/* ——— Toast ——— */
.toast-host {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 12px 16px;
  min-width: 220px;
  max-width: 320px;
  animation: toast-in 0.35s var(--ease);
  font-size: 0.92rem;
}

.toast.error {
  border-color: rgba(196, 120, 92, 0.45);
  background: #fff6f2;
}

.toast.success {
  border-color: rgba(143, 175, 160, 0.55);
  background: #f3faf6;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ——— Nav ——— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(243, 247, 245, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.site-nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 252, 251, 0.9);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
  /* ИСПРАВЛЕНИЕ: Разрешаем перенос блоков в шапке, если места совсем нет */
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap; /* ИСПРАВЛЕНИЕ: Запрещаем разрывать логотип */
}

.brand span {
  color: var(--sage-deep);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a,
.nav-action {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 560;
  font-size: 0.94rem;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active,
.nav-action:hover {
  color: var(--ink);
  background: rgba(143, 175, 160, 0.18);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap; /* ИСПРАВЛЕНИЕ: Позволяем кнопкам сжиматься/переноситься */
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-weight: 650;
  white-space: nowrap;
}

.cart-count {
  width: 1.4rem;
  height: 1.4rem;
  min-width: 1.4rem;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--peach-deep);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  font-weight: 650;
  transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--sage-deep);
  color: #f7fbf8;
  box-shadow: 0 10px 24px rgba(74, 107, 92, 0.25);
}

.btn-primary:hover {
  background: #3d5c4e;
}

.btn-soft {
  background: rgba(255, 252, 251, 0.75);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.btn-ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1px solid var(--line);
}

.btn-peach {
  background: var(--peach);
  color: #5c3428;
}

.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
          linear-gradient(120deg, rgba(42, 53, 48, 0.55) 0%, rgba(74, 107, 92, 0.28) 45%, rgba(240, 197, 181, 0.2) 100%),
          url("https://images.unsplash.com/photo-1486297678162-eb2a19b0a32d?auto=format&fit=crop&w=1800&q=80")
          center / cover no-repeat;
  transform: scale(1.04);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
          radial-gradient(circle at 70% 30%, rgba(239, 227, 181, 0.28), transparent 40%),
          linear-gradient(to top, rgba(42, 53, 48, 0.55), transparent 45%);
}

@keyframes hero-drift {
  from {
    transform: scale(1.04) translateY(0);
  }
  to {
    transform: scale(1.08) translateY(-1.5%);
  }
}

.hero-content {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto 4.5rem;
  color: #f8fbf9;
  animation: rise 0.9s var(--ease) both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 580;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.hero-lead {
  max-width: 28rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  margin: 0 0 1.6rem;
  color: rgba(248, 251, 249, 0.9);
  font-weight: 450;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ——— Sections ——— */
.section {
  padding: 4.5rem 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head h2,
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 580;
}

.section-head p,
.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

.view {
  display: none;
  animation: rise 0.45s var(--ease);
}

.view.active {
  display: block;
}

/* ——— Catalog filters ——— */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chip {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(255, 252, 251, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
}

.chip:hover,
.chip.active {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
}

/* ——— Product grid ——— */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, var(--sage-soft), var(--butter));
  position: relative;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.product-card:hover .product-media img {
  transform: scale(1.05);
}

.product-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 252, 251, 0.9);
  color: var(--sage-deep);
}

.badge.hit {
  background: var(--peach);
  color: #5c3428;
}

.badge.new {
  background: var(--sky);
  color: #2f4a5a;
}

.badge.promo {
  background: var(--butter);
  color: #5a4d20;
}

.product-body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.product-cat {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.product-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.price {
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--sage-deep);
}

.old-price {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: line-through;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.product-actions .btn {
  flex: 1 1 auto;
  min-width: 110px;
}

.empty-state,
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: rgba(255, 252, 251, 0.55);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ——— Product Detail (Двухколоночная карточка товара) ——— */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.detail-media {
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(145deg, var(--sage-soft), var(--butter));
  width: 100%;
  aspect-ratio: 1 / 1;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.detail-price {
  font-size: 1.75rem;
  font-weight: 750;
  color: var(--sage-deep);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.2rem 0;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.detail-blocks {
  display: grid;
  gap: 0.85rem;
  margin: 0.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.detail-block h3 {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sage-deep);
}

.detail-block p {
  font-size: 0.92rem;
  margin: 0;
}

.qty-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.qty-row .qty-control {
  height: 48px;
}

.qty-row .btn-primary {
  flex: 1 1 auto;
  height: 48px;
  border-radius: 999px;
  min-width: 150px;
}

/* ——— Cart drawer ——— */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 53, 48, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer,
.modal {
  position: fixed;
  z-index: 60;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drawer {
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.4s var(--ease);
}

.drawer.open {
  transform: none;
}

.drawer-head,
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2,
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 580;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 1.1rem;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  align-items: center;
}

.cart-item strong {
  font-weight: 680;
}

.cart-item .meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.qty-control button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  color: var(--sage-deep);
  background: transparent;
  transition: background 0.2s;
}

.qty-control button:hover {
  background: var(--paper-2);
}

.qty-control input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  outline: none;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-control input[type="number"] {
  -moz-appearance: textfield;
}

.drawer-foot {
  padding: 1rem 1.25rem 1.35rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.05rem;
}

.total-row strong {
  font-size: 1.35rem;
  color: var(--sage-deep);
}

/* ——— Modal auth / checkout ——— */
.modal {
  top: 50%;
  left: 50%;
  width: min(460px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  border-radius: 22px;
  transform: translate(-50%, -46%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s var(--ease);
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal.wide {
  width: min(560px, calc(100% - 2rem));
}

.modal-body {
  padding: 1.25rem;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
  background: var(--paper);
  padding: 0.3rem;
  border-radius: 999px;
}

.tab {
  flex: 1;
  padding: 0.55rem;
  border-radius: 999px;
  font-weight: 650;
  color: var(--muted);
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(42, 53, 48, 0.06);
}

/* ——— Checkout: Карта и Выбор времени доставки ——— */
.map-container {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.address-display {
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.time-slot {
  padding: 0.85rem 0.5rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-size: 0.88rem;
  user-select: none;
  color: var(--muted);
  font-weight: 560;
}

.time-slot:hover {
  border-color: var(--sage);
  color: var(--ink);
}

.time-slot.active {
  border: 2px solid var(--sage-deep);
  background: var(--paper-2);
  color: var(--sage-deep);
  font-weight: 650;
  padding: calc(0.85rem - 1px) calc(0.5rem - 1px);
}

/* ——— Формы и отступы ——— */
.form-stack,
.auth-step.active {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-stack .field,
.auth-step.active .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 175, 160, 0.25);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
  margin-top: 0.3rem;
  margin-bottom: 0.2rem;
}

.checkbox-field input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  accent-color: var(--sage-deep);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.checkbox-field a {
  color: var(--sage-deep);
  text-decoration: underline;
}

.form-stack .btn,
.auth-step.active .btn {
  width: 100%;
  margin-top: 0.4rem;
}

.auth-step {
  display: none;
}

.auth-step.active {
  display: flex;
  flex-direction: column;
}

/* ——— Выпадающий список сортировки ——— */
.select-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem; /* Отступ до карточек товаров */
}

.custom-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  height: 42px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 2.5rem 0 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234a6b5c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px;
}

.custom-select:hover {
  background-color: var(--paper-2);
  border-color: var(--sage);
  color: var(--ink);
}

.custom-select:focus {
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(143, 175, 160, 0.25);
  color: var(--ink);
}

.custom-select option {
  background-color: var(--surface);
  color: var(--ink);
  font-weight: 500;
  padding: 0.5rem;
}

/* ——— Account / orders ——— */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.panel h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 580;
  font-size: 1.3rem;
}

.order-card {
  padding: 1rem;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.order-card:last-child {
  margin-bottom: 0;
}

.order-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.status {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.order-items {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.35rem 0;
}

/* ——— Blog ——— */
.articles {
  display: grid;
  gap: 1rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.article-card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  font-weight: 580;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

/* ——— Footer ——— */
.site-footer {
  margin-top: 2rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--sage-deep);
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .story,
  .product-detail,
  .account-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
  }

  .detail-media {
    position: static;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 760px) {
  /* ИСПРАВЛЕНИЕ 1: Позволяем шапке растягиваться, если элементы переносятся на новую строку */
  .site-nav {
    height: auto;
    min-height: var(--nav-h);
    padding: 12px 0;
  }

  /* ИСПРАВЛЕНИЕ 2: Делаем отступы и размеры элементов в шапке компактнее на мобилках */
  .nav-inner {
    gap: 0.5rem;
    row-gap: 12px; /* Добавляем отступ между строками при переносе */
  }

  .brand {
    font-size: 1.2rem;
  }

  .nav-actions {
    gap: 0.2rem;
  }

  .nav-action, .cart-btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
  }

  .cart-count {
    min-width: 1.2rem;
    height: 1.2rem;
    font-size: 0.7rem;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
  }

  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    left: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.5rem;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: 0.25s var(--ease);
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .hero-content {
    margin-bottom: 3rem;
  }

  .section {
    padding: 3.25rem 0;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }

  .select-wrapper {
    width: 100%;
    margin-bottom: 1.25rem;
  }

  .custom-select {
    width: 100%;
  }
}

/* ——— Дополнительные анимации интерфейса ——— */

/* Затемнение фона */
.overlay {
  transition:
          opacity 0.35s ease,
          visibility 0.35s ease;
}

/* Плавное открытие корзины */
.drawer {
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer.open {
  transform: translateX(0);
}

/* Плавное появление модального окна */
.modal {
  transition:
          opacity 0.28s ease,
          transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.open {
  animation: modal-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Появление карточек товаров */
.product-card {
  animation: product-appear 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes product-appear {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Лёгкий эффект при добавлении товара */
.cart-count.bump {
  animation: cart-bump 0.35s ease;
}

@keyframes cart-bump {
  0%, 100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.3);
  }
}

/* Анимация мобильного меню */
.nav-links {
  transition:
          opacity 0.25s ease,
          transform 0.25s ease,
          visibility 0.25s ease;
}

.nav-links.open {
  visibility: visible;
}

/* Небольшой отклик кнопок */
.btn,
.cart-btn,
.icon-btn,
.chip {
  -webkit-tap-highlight-color: transparent;
}

.btn:active,
.cart-btn:active,
.icon-btn:active,
.chip:active {
  transform: scale(0.97);
}

/* Уважение к настройке уменьшения анимации */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================
   TulKoza — дополнительные анимации
========================================= */

/* Счётчик корзины */

.cart-count {
  transform-origin: center;
  will-change: transform;
}

.cart-count.bump {
  animation: cart-bump 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cart-bump {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.32);
  }

  65% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
}

/* Карточки товаров в корзине */

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  animation: cart-item-in 0.35s var(--ease) both;
  animation-delay: calc(var(--item-index, 0) * 35ms);
}

.cart-item-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cart-item-info strong {
  display: block;
  font-weight: 680;
}

.cart-item .meta {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.cart-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cart-item-price > strong {
  color: var(--sage-deep);
  white-space: nowrap;
}

.cart-item-price .btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
}

@keyframes cart-item-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Пустая корзина */

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(243, 247, 245, 0.65);
  animation: cart-item-in 0.35s var(--ease) both;
}

.cart-empty-icon {
  font-size: 2.3rem;
  margin-bottom: 0.25rem;
}

.cart-empty p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.cart-empty > span:last-child {
  max-width: 250px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Затемнение фона */

.overlay {
  visibility: hidden;
  transition:
          opacity 0.35s ease,
          visibility 0.35s ease;
}

.overlay.open {
  visibility: visible;
}

/* Уменьшаем прокрутку фона при открытых панелях */

body.panel-open {
  overflow: hidden;
}

/* Обратная связь кнопок */

.btn,
.cart-btn,
.icon-btn,
.chip {
  -webkit-tap-highlight-color: transparent;
}

.btn:active,
.cart-btn:active,
.icon-btn:active,
.chip:active {
  transform: scale(0.97);
}

/* Анимация модальных окон */

.modal.open {
  animation: modal-pop 0.35s var(--ease) both;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Анимация появления карточек каталога */

.products-grid .product-card {
  animation: product-appear 0.45s var(--ease) both;
}

.products-grid .product-card:nth-child(2) {
  animation-delay: 35ms;
}

.products-grid .product-card:nth-child(3) {
  animation-delay: 70ms;
}

.products-grid .product-card:nth-child(4) {
  animation-delay: 105ms;
}

.products-grid .product-card:nth-child(5) {
  animation-delay: 140ms;
}

.products-grid .product-card:nth-child(6) {
  animation-delay: 175ms;
}

@keyframes product-appear {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Мобильная адаптация */

@media (max-width: 480px) {
  .cart-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-item-price {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .drawer-head,
  .modal-head {
    padding: 1rem;
  }

  .drawer-body {
    padding: 0.85rem;
  }

  .drawer-foot {
    padding: 0.85rem 1rem 1rem;
  }
}

/* Уважение к системной настройке уменьшения анимации */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================
   ГЛОБАЛЬНЫЕ АНИМАЦИИ
================================ */

/* Плавное появление содержимого */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Карточки и блоки */
.product-card,
.panel,
#ordersList > div,
#adminOrdersList > div,
#adminProductsList > div,
#adminArticlesList > div,
#adminReviewsList > div {
  animation: fadeInUp 0.4s ease both;
}

/* Карточки товаров */
.product-card {
  transition:
          transform 0.25s ease,
          box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
}

/* Кнопки */
.btn,
button,
.chip {
  transition:
          transform 0.2s ease,
          box-shadow 0.2s ease,
          background-color 0.2s ease,
          color 0.2s ease,
          opacity 0.2s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
}

.btn:active,
button:active {
  transform: scale(0.97);
}

/* Поля ввода */
.input,
input,
textarea,
select {
  transition:
          border-color 0.2s ease,
          box-shadow 0.2s ease;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--sage-deep, #4a6b5c);
  box-shadow: 0 0 0 3px rgba(74, 107, 92, 0.13);
}

/* Модальные окна */
.modal,
#authModal,
#reviewModal,
#productModal,
#editArticleModal {
  transition:
          opacity 0.25s ease,
          transform 0.25s ease;
}

/* Изображения */
.product-media img,
.detail-media img {
  transition: transform 0.4s ease;
}

.product-media:hover img {
  transform: scale(1.04);
}

/* Переключение вкладок */
.admin-tab-content {
  animation: fadeIn 0.3s ease;
}

/* Сообщения о загрузке */
.loading-state {
  animation: fadeIn 0.3s ease;
}

/* Уважение к настройкам пользователя */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================= Тема «погреб и воск» (переопределяет стили выше) ================= */
/* Тульская Коза — тема «погреб и воск». Подключается ПОСЛЕ shop.css и только переопределяет его. */
:root {
  --cellar: #1d3a2e;
  --cellar-2: #2b5242;
  --rind: #e3a93a;
  --rind-soft: #f6e2b0;
  --wax: #b53b2c;
  --milk: #f5f7f1;
  --whey: #dde7df;
  /* перекрашиваем переменные старой темы */
  --sage: #7fa793; --sage-deep: var(--cellar); --sage-soft: var(--whey);
  --peach: var(--rind-soft); --peach-deep: var(--wax); --butter: var(--rind-soft);
  --paper: var(--milk); --paper-2: #ebf0e7; --surface: #fffefa; --ink: #15231b;
  --muted: #5d6f64; --line: rgba(29, 58, 46, .14); --radius: 22px;
  --shadow: 0 24px 50px -24px rgba(21, 35, 27, .28);
  --font-display: "Unbounded", "Onest", sans-serif;
  --font-body: "Onest", system-ui, sans-serif;
}
body { background: var(--milk); font-size: 1.02rem; }
h1, h2, h3, .page-title { font-family: var(--font-display); letter-spacing: -.02em; }
.section-head h2, .page-title { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 500; line-height: 1.1; }

/* Навигация */
.site-nav { background: rgba(245, 247, 241, .85); }
.brand { font-size: 1.1rem; font-weight: 600; }
.brand span { color: var(--wax); font-size: .72rem; font-weight: 600; }
.nav-links a.active { background: var(--cellar); color: #f5f7f1; }
.nav-links a:hover:not(.active) { background: var(--rind-soft); }
.cart-btn { background: var(--cellar); color: #f5f7f1; transition: transform .25s var(--ease), background .2s; }
.cart-btn:hover { background: var(--cellar-2); transform: translateY(-1px); }
.cart-count { background: var(--rind); color: var(--ink); font-weight: 700; }
.cart-count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 30% { transform: scale(1.5) rotate(-8deg); } 100% { transform: none; } }

/* Кнопки: зелёная заливка, при наведении «заливается воском» */
.btn { position: relative; overflow: hidden; isolation: isolate; font-weight: 600; }
.btn-primary { background: var(--cellar); box-shadow: 0 12px 26px -12px rgba(29, 58, 46, .55); }
.btn-primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--rind);
  transform: translateY(101%); transition: transform .35s var(--ease); border-radius: inherit; }
.btn-primary:hover { background: var(--cellar); color: var(--ink); }
.btn-primary:hover::before { transform: none; }
.btn-ghost:hover { background: var(--whey); }
.btn.is-added { background: var(--rind) !important; color: var(--ink) !important; }

/* Hero */
.hero-media { background:
        linear-gradient(105deg, rgba(21, 40, 31, .88) 0%, rgba(29, 58, 46, .55) 50%, rgba(29, 58, 46, .15) 100%),
        url("https://images.unsplash.com/photo-1486297678162-eb2a19b0a32d?auto=format&fit=crop&w=1800&q=80") center / cover no-repeat; }
.hero-media::after { background: linear-gradient(to top, rgba(21, 35, 27, .6), transparent 50%); }
.hero-content { animation: none; margin-bottom: 5rem; }
.hero-brand { font-size: clamp(2.3rem, 6.4vw, 4.9rem); line-height: 1.04; font-weight: 600; letter-spacing: -.035em; max-width: 12ch; text-shadow: none; }
.hero-brand .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-right: .22em; }
.hero-brand .w > span { display: inline-block; transform: translateY(112%); animation: wordUp 1s var(--ease) forwards; animation-delay: calc(var(--i) * .1s + .15s); }
@keyframes wordUp { to { transform: none; } }
.hero-lead, .hero-actions { opacity: 0; animation: fadeIn .9s var(--ease) forwards; }
.hero-lead { animation-delay: .65s; color: rgba(245, 247, 241, .88); }
.hero-actions { animation-delay: .8s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero .btn-primary { background: var(--rind); color: var(--ink); }
.hero .btn-primary::before { background: #fff; }
.hero-seal { position: absolute; right: max(2rem, 6vw); bottom: 5rem; width: 128px; height: 128px; color: var(--rind-soft);
  opacity: 0; animation: fadeIn 1s 1.1s var(--ease) forwards; }
.hero-seal svg { width: 100%; height: 100%; animation: spin 26s linear infinite; }
.hero-seal text { font: 600 10.5px var(--font-body); letter-spacing: .14em; fill: currentColor; text-transform: uppercase; }
.hero-seal b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 1.3rem var(--font-display); color: var(--rind); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Карточки товаров */
.products-grid { gap: 1.5rem; }
.product-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: none; overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(29, 58, 46, .3); }
.product-media { display: block; overflow: hidden; aspect-ratio: 4 / 3.2; background: var(--whey); position: relative; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.product-card:hover .product-media img { transform: scale(1.07); }
.product-cat { color: var(--wax); font-size: .8rem; font-weight: 600; }
.product-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 500; line-height: 1.25; }
.price { font-family: var(--font-display); font-weight: 600; color: var(--cellar); }
.old-price { text-decoration: line-through; color: var(--muted); }
.badge { border-radius: 8px; font-weight: 700; padding: .3rem .6rem; font-size: .75rem; backdrop-filter: blur(6px); }
.badge.hit { background: var(--rind); color: var(--ink); }
.badge.new { background: var(--cellar); color: #f5f7f1; }
.badge.promo { background: var(--wax); color: #fff; }

/* Фильтры */
.chip { background: var(--surface); transition: background .25s, color .25s, transform .25s var(--ease); }
.chip:hover { background: var(--rind-soft); transform: translateY(-2px); }
.chip.active, .chip[aria-pressed="true"], .chip.is-active { background: var(--cellar); color: #f5f7f1; border-color: var(--cellar); }

/* Корзина и окна */
.overlay { background: rgba(21, 35, 27, .5); backdrop-filter: blur(5px); transition: opacity .35s var(--ease); }
.drawer { transition: transform .5s var(--ease); border-radius: 26px 0 0 26px; }
.modal.open .modal-dialog { animation: pop .45s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }
.cart-item { animation: fadeIn .4s var(--ease) both; }
.input:focus, input:focus, textarea:focus, select:focus { border-color: var(--cellar); box-shadow: 0 0 0 4px rgba(227, 169, 58, .28); outline: none; }
:focus-visible { outline: 3px solid var(--rind); outline-offset: 2px; }

/* Подвал */
.site-footer { background: var(--cellar); color: rgba(245, 247, 241, .8); border-top: none; }
.site-footer a:hover { color: var(--rind); }

/* Появление при скролле (классы добавляет animations.js) */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }
.product-card.rv.in { transition: opacity .8s var(--ease) var(--d, 0ms), transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }

/* Полёт товара в корзину */
.fly-dot { position: fixed; z-index: 120; width: 18px; height: 18px; border-radius: 50%; background: var(--rind);
  box-shadow: 0 0 0 4px rgba(227, 169, 58, .3); pointer-events: none; }

@media (max-width: 760px) { .hero-seal { display: none; } .hero-brand { max-width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .rv, .hero-lead, .hero-actions, .hero-seal { opacity: 1; transform: none; }
  .hero-brand .w > span { transform: none; }
}

/* ===== Нарядный слой: мягкие пятна, «дырки» сыра, лента, волны ===== */
body { background:
        radial-gradient(520px 520px at 8% 18%, rgba(246, 226, 176, .75), transparent 70%),
        radial-gradient(620px 620px at 96% 42%, rgba(221, 231, 223, .95), transparent 70%),
        radial-gradient(480px 480px at 20% 92%, rgba(227, 169, 58, .16), transparent 70%), var(--milk); }

/* Бегущая лента */
.marquee { background: var(--rind); color: var(--ink); overflow: hidden; white-space: nowrap; padding: .85rem 0;
  font: 600 .95rem var(--font-body); transform: rotate(-1.2deg) scale(1.03); margin: -1.4rem 0 .5rem; position: relative; z-index: 3;
  box-shadow: 0 14px 30px -18px rgba(21, 35, 27, .6); }
.marquee-track { display: inline-flex; gap: 2.2rem; animation: marq 32s linear infinite; padding-left: 2.2rem; }
.marquee-track i { font-style: normal; color: var(--wax); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(-50%); } }

/* Заголовки секций: волнистое подчёркивание */
.section-head h2::after, .page-title::after { content: ""; display: block; width: 92px; height: 12px; margin-top: .6rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='12' viewBox='0 0 92 12'%3E%3Cpath d='M2 6 Q13 -2 24 6 T46 6 T68 6 T90 6' fill='none' stroke='%23e3a93a' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
  transform-origin: left; animation: draw 1.1s .3s var(--ease) both; }
@keyframes draw { from { transform: scaleX(0); } }

/* Карточки: фото в рамке, круглая кнопка, милые детали */
.product-card { padding: 10px; border-radius: 28px; }
.product-media { border-radius: 20px; aspect-ratio: 1 / 1; }
.product-body { padding: 1rem .7rem .6rem; }
.product-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: .35rem; flex-wrap: wrap; }
.badge { border-radius: 999px; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .4); }
.product-card:hover .btn-add-card { animation: wiggle .6s var(--ease); }
@keyframes wiggle { 25% { transform: rotate(-3deg) scale(1.04); } 60% { transform: rotate(2deg) scale(1.04); } }
.btn-add-card { border-radius: 999px; }
.product-price-row .price { font-size: 1.25rem; }
.products-grid .product-card:nth-child(3n+1):hover { transform: translateY(-8px) rotate(-.6deg); }
.products-grid .product-card:nth-child(3n):hover { transform: translateY(-8px) rotate(.6deg); }

/* Hero: ниже округлый край */
.hero { border-radius: 0 0 48px 48px; }
.hero-content .btn { padding: 1rem 1.7rem; }

/* Волна над подвалом */
.site-footer { position: relative; margin-top: 4rem; border-radius: 48px 48px 0 0; }
.chip { border-radius: 999px; padding: .6rem 1.15rem; }
.panel, .article-card, .order-card { border-radius: 26px; }
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.article-card { transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
@media (max-width: 760px) { .hero { border-radius: 0 0 32px 32px; } .marquee { font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none !important; } }

/* Hero компактнее: фото не на весь экран */
.hero { min-height: min(66svh, 620px); }
.hero-media { background-position: center 40%; }

/* ===== Окно входа и ввода кода ===== */
#authModal .modal-dialog { max-width: 440px; width: calc(100% - 2rem); padding: 0; overflow: hidden; border-radius: 30px; background: var(--surface); }
#authModal .modal-head { position: relative; overflow: hidden; background: var(--cellar); color: #f5f7f1; padding: 1.7rem 1.8rem 1.4rem; border: 0; }
#authModal .modal-head::before { content: ""; position: absolute; right: -34px; top: -38px; width: 136px; height: 136px; border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #f3c764, var(--rind) 55%, #c68a1f); }
#authModal .modal-head::after { content: ""; position: absolute; right: 38px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: rgba(29, 58, 46, .35);
  box-shadow: -26px 34px 0 -3px rgba(29, 58, 46, .3), 18px 38px 0 -5px rgba(29, 58, 46, .28); }
#authModal .modal-head h2 { position: relative; z-index: 1; color: #f5f7f1; font-size: 1.55rem; margin: 0; }
#authModal .modal-head .icon-btn { position: relative; z-index: 2; background: rgba(255, 255, 255, .16); color: #fff; }
#authModal .modal-head .icon-btn:hover { background: rgba(255, 255, 255, .28); }
#authModal .modal-body { padding: 1.4rem 1.8rem 1.9rem; }
#authModal .tabs { display: flex; gap: 4px; padding: 5px; background: var(--whey); border-radius: 999px; margin-bottom: 1.3rem; }
#authModal .tab { flex: 1; border-radius: 999px; padding: .65rem .5rem; font-weight: 600; color: var(--muted); transition: background .3s var(--ease), color .3s; }
#authModal .tab.active { background: #fff; color: var(--cellar); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .4); }
#authModal .field label { font-weight: 600; font-size: .88rem; margin-bottom: .35rem; display: block; }
#authModal .field input { width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: .9rem 1.1rem; }
#authModal .form-stack { gap: 1rem; animation: fadeIn .45s var(--ease) both; }
#authModal .form-stack .btn-primary { width: 100%; padding: 1rem; font-size: 1rem; }
#authModal .form-hint { margin: 0; padding: .85rem 1.05rem; border-radius: 16px; background: var(--rind-soft); color: #5a4410; font-size: .93rem; }
#authModal #forgotPasswordLink { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
#authModal #loginConfirmForm .form-hint, #authModal #registerConfirmForm .form-hint { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:10px; font-size:.82rem; line-height:1.35; white-space:nowrap; }
#loginConfirmForm .form-hint::before, #registerConfirmForm .form-hint::before { content: "✉"; display:inline-block; flex:0 0 auto; font-size:1rem; line-height:1; margin:0; }

/* ===== Правки по результатам теста ===== */
#authModal.modal { padding: 0; overflow: hidden; border-radius: 30px; }
#authModal .modal-dialog { max-width: none; width: 100%; box-shadow: none; }
.hero-brand { font-size: clamp(2rem, 5.2vw, 4.1rem); }
.hero-content { margin-bottom: 4.2rem; padding-top: 2.5rem; }
input[type="range"] { accent-color: var(--cellar); }

.hero-seal { z-index: 2; }
.hero-seal b { position: absolute; inset: 0; }

/* ===== Ввод кода: 6 ячеек ===== */
.otp { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.otp .code-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0 !important; opacity: 0; font-size: 16px; cursor: text; z-index: 2; }
.otp-cell { position: relative; display: grid; place-items: center; height: 3.5rem; border-radius: 16px; background: #fff; border: 1.5px solid var(--line);
  font: 600 1.55rem var(--font-display); color: var(--cellar); transition: border-color .2s, box-shadow .2s, background .2s; }
.otp-cell.filled { background: var(--rind-soft); border-color: rgba(29, 58, 46, .35); animation: pop .3s var(--ease); }
.otp-cell.active { border-color: var(--cellar); box-shadow: 0 0 0 4px rgba(227, 169, 58, .35); }
.otp-cell.active:empty::after { content: ""; width: 2px; height: 1.5rem; background: var(--cellar); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 400px) { .otp { gap: .35rem; } .otp-cell { height: 3.1rem; font-size: 1.35rem; border-radius: 13px; } }

/* ===== Телефонная версия ===== */
.hero-brand .w { margin-right: 0; }
@media (max-width: 760px) {
  /* шапка в одну строку: логотип — кнопки — бургер */
  .site-nav { height: var(--nav-h); min-height: var(--nav-h); padding: 0; }
  .nav-inner { flex-wrap: nowrap; row-gap: 0; gap: .5rem; width: calc(100% - 1.5rem); }
  .brand { order: 1; font-size: 1.05rem; white-space: nowrap; }
  .nav-actions { order: 2; margin-left: auto; flex-wrap: nowrap; gap: .35rem; }
  .menu-toggle { order: 3; flex: 0 0 auto; }
  #authBtn { padding: .5rem .85rem; font-size: .85rem; }
  .cart-btn { padding: .5rem .75rem; font-size: .85rem; }

  .hero { min-height: min(58svh, 500px); }
  .hero-content { margin-bottom: 3.4rem; padding-top: 1.5rem; }
  .hero-lead { font-size: 1rem; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

  .section-head { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .product-media { aspect-ratio: 4 / 3; }
  .product-card:hover { transform: none; box-shadow: none; }
  .product-card:hover .product-media img { transform: none; }

  /* фильтры каталога — горизонтальная лента вместо 4 строк */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -.75rem; padding: 0 .75rem .5rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; white-space: nowrap; }

  /* окно входа — «шторка» снизу */
  #authModal.modal { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; transform: none; border-radius: 28px 28px 0 0; max-height: 92svh; overflow-y: auto; }
  #authModal.modal { transform: none; }
  #authModal.modal.open { animation: sheet-up .45s var(--ease) both; }
  @keyframes sheet-up { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
  #authModal .modal-body { padding: 1.2rem 1.25rem 1.6rem; }
  #authModal .modal-head { padding: 1.4rem 1.25rem 1.1rem; }
  .site-footer { border-radius: 32px 32px 0 0; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
  .brand::after { content: " Коза"; color: var(--wax); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
}
/* Attachment layouts and calm, accessible interaction feedback. */
.media-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); gap:12px; margin:1rem 0; max-width:100%; }
.media-gallery .media-photo { display:block; overflow:hidden; border:0; padding:0; cursor:zoom-in; border-radius:14px; background:var(--paper-2,#f4f5f3); }
.media-gallery img,.media-gallery video { width:100%; height:240px; object-fit:cover; display:block; border-radius:14px; background:var(--paper-2,#f4f5f3); }
.media-gallery-single { grid-template-columns:minmax(0,1fr); }
.media-gallery-single img { height:auto; max-height:520px; object-fit:cover; }
.media-gallery video { object-fit:contain; background:#17231d; }
.media-gallery-single video { height:auto; max-height:520px; }
.upload-preview { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.upload-preview img,.upload-preview video { width:100px; height:100px; object-fit:cover; border-radius:12px; background:#f0f2ed; }
input[type=file] { padding:12px; border:1px dashed var(--line); border-radius:12px; max-width:100%; background:var(--paper-2,#f4f5f3); }
input[type=file]::file-selector-button { border:0; padding:9px 12px; margin-right:10px; border-radius:8px; background:var(--sage-deep,#4a6b5c); color:white; cursor:pointer; }
.consent-block { display:flex; align-items:flex-start; gap:10px; font-size:.9rem; line-height:1.5; }
.consent-block input { width:auto; margin-top:5px; }
.consent-block small { display:block; color:var(--muted); }
.btn:disabled { opacity:.55; cursor:not-allowed; transform:none; }
:where(button,a,input,select,textarea):focus-visible { outline:3px solid #86a58e; outline-offset:3px; }
form[aria-busy=true] { cursor:progress; }
.stock-status { color:var(--sage-deep,#4a6b5c); font-size:.9rem; }
@media(prefers-reduced-motion:no-preference) {
  .media-gallery img { transition:transform 220ms ease; }
  .media-gallery .media-photo:hover img { transform:scale(1.025); }
  .article-card,.detail-block { animation:gentle-appear 280ms ease both; }
  input,textarea,select { transition:border-color 160ms ease,box-shadow 160ms ease; }
  @keyframes gentle-appear { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media(max-width:600px) { .media-gallery {grid-template-columns:repeat(2,minmax(0,1fr));} .media-gallery-single {grid-template-columns:1fr;} .media-gallery img,.media-gallery video {height:170px;} }

.admin-article-card { display:grid; grid-template-columns:minmax(160px,240px) minmax(0,1fr); gap:22px; padding:20px 0; border-bottom:1px solid var(--line); }
.admin-article-preview .media-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:0; }
.admin-article-preview .media-gallery-single { grid-template-columns:1fr; }
.admin-article-preview .media-gallery img,.admin-article-preview .media-gallery video { height:110px; width:100%; object-fit:cover; }
.admin-article-preview .media-gallery-single img,.admin-article-preview .media-gallery-single video { height:180px; }
.admin-article-copy h3 { margin:0 0 8px; }
.admin-article-excerpt { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; white-space:pre-wrap; line-height:1.6; margin:12px 0; }
.admin-article-actions { display:flex; flex-wrap:wrap; gap:8px; }
.article-meta { color:var(--muted); font-size:.85rem; }
@media(max-width:600px) { .admin-article-card {grid-template-columns:1fr; gap:14px;} .admin-article-preview .media-gallery img,.admin-article-preview .media-gallery video {height:150px;} }

body.media-viewing { overflow:hidden; }
.photo-viewer { position:fixed; inset:0; width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; padding:64px 70px 40px; border:0; color:#fff; background:rgba(10,16,13,.94); box-sizing:border-box; }
.photo-viewer::backdrop { background:rgba(0,0,0,.7); }
.photo-viewer[open] { display:flex; align-items:center; justify-content:center; }
.photo-viewer figure { display:flex; flex-direction:column; align-items:center; justify-content:center; margin:0; width:100%; height:100%; gap:14px; }
.photo-viewer img { display:block; max-width:100%; max-height:calc(100dvh - 150px); object-fit:contain; border-radius:4px; }
.photo-viewer figcaption { color:#fff; font-size:.9rem; }
.photo-viewer button { position:absolute; display:grid; place-items:center; width:44px; height:44px; padding:0; border:1px solid #ffffff30; border-radius:50%; color:#fff; background:#ffffff18; font-size:32px; cursor:pointer; }
.photo-viewer button[hidden] { display:none; }
.photo-viewer .viewer-close { right:20px; top:16px; font-size:22px; }
.photo-viewer .viewer-prev { left:16px; top:calc(50% - 22px); }
.photo-viewer .viewer-next { right:16px; top:calc(50% - 22px); }
.photo-viewer button:hover { background:#ffffff35; }
@media(max-width:600px) { .photo-viewer {padding:60px 12px 80px;} .photo-viewer .viewer-prev,.photo-viewer .viewer-next {top:auto; bottom:20px;} }
@media(prefers-reduced-motion:no-preference) { .photo-viewer[open] {animation:gentle-appear 180ms ease;} }

/* Compact previews preserve the complete image and its intrinsic aspect ratio. */
.media-gallery { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:flex-start; gap:12px; }
.media-gallery .media-photo { flex:0 1 auto; width:auto; max-width:100%; background:transparent; }
.media-gallery .media-photo img { display:block; width:auto; height:auto; max-width:100%; max-height:360px; object-fit:contain; background:transparent; }
.media-gallery video { flex:1 1 280px; max-width:720px; }
.media-gallery-single { max-width:720px; }
.media-gallery-single .media-photo img { max-height:480px; }
.admin-article-preview .media-gallery { gap:6px; }
.admin-article-preview .media-photo { max-width:calc(50% - 3px); }
.admin-article-preview .media-photo img { width:auto; height:auto; max-height:160px; }
.admin-article-preview .media-gallery-single .media-photo { max-width:100%; }
@media(prefers-reduced-motion:no-preference) { .media-gallery .media-photo:hover img { transform:none; } }
@media(max-width:600px) { .media-gallery .media-photo {max-width:calc(50% - 6px);} .media-gallery-single .media-photo {max-width:100%;} }

.cart-item { grid-template-columns:64px minmax(0,1fr) minmax(100px,auto); gap:12px; align-items:start; }
.cart-product-image { width:64px; height:64px; object-fit:cover; border-radius:12px; }
.cart-item-price { min-width:0; max-width:160px; }
.cart-item-price input { width:100%; min-width:0; padding:8px; box-sizing:border-box; }
.cart-item-info { overflow-wrap:anywhere; }
#checkoutMap { min-height:320px; isolation:isolate; }
#checkoutMap img {max-width:none;}
@media(max-width:480px) { .cart-item {grid-template-columns:48px minmax(0,1fr);} .cart-product-image {width:48px;height:48px;} .cart-item-price {grid-column:2;max-width:100%;} }
.cart-stock-warning { display:block; color:#a44b25; margin-top:6px; }

/* Numbered pages, nutrition and reactions */
.pagination { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; margin:1rem 0; }
.pagination .page-number { min-width:42px; min-height:42px; padding:.4rem .7rem; }
.pagination [aria-current="page"] { opacity:1; background:var(--primary, #294f3e); color:#fff; border-color:transparent; }
.page-gap { padding:0 .3rem; color:var(--muted); }
.product-nutrition { display:flex; align-items:baseline; gap:8px; padding:6px 8px; border-radius:8px; background:#f3f5ef; margin:4px 0; }
.product-nutrition > span { flex:0 0 auto; white-space:nowrap; font-size:.7rem; color:var(--muted); }
.product-nutrition p { flex:1; min-width:0; margin:0; font-size:.8rem; line-height:1.4; overflow-wrap:anywhere; }
.article-reactions { display:flex; gap:.5rem; margin-top:1.2rem; }
.reaction-button { display:inline-flex; align-items:center; gap:.4rem; min-height:40px; padding:.4rem .85rem; border:1px solid var(--line); border-radius:24px; background:#f6f7f3; cursor:pointer; color:var(--text); transition:background .2s,transform .2s,border-color .2s; }
.reaction-button:hover { transform:translateY(-2px); border-color:#6b917b; }
.reaction-button[aria-pressed="true"] { background:#e0eddf; border-color:#6b917b; }
.reaction-button:disabled { opacity:.65; cursor:wait; }
.cart-item-price input[type="range"] { display:block; width:100%; min-width:100px; padding:0; height:30px; accent-color:#4a6b5c; cursor:pointer; }
.cart-item-price label { display:block; width:100%; }
.product-nutrition p { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.catalog-load-status { display:flex; flex-direction:column; align-items:center; gap:.8rem; padding:1.5rem; min-height:72px; text-align:center; color:var(--muted); }

/* Compact cart layout. */
#cartDrawer { width:min(100%,440px); border-radius:12px 0 0 12px; }
#cartDrawer .drawer-head { padding:16px; }
#cartDrawer .drawer-body { padding:0 16px; }
#cartDrawer .drawer-foot { padding:16px; }
.cart-item { grid-template-columns:52px minmax(0,1fr) auto 28px; grid-template-rows:auto auto; align-items:center; gap:4px 10px; padding:12px 0; margin:0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; box-shadow:none; }
.cart-product-image { grid-column:1; grid-row:1 / 3; width:52px; height:52px; border-radius:6px; }
.cart-item-info { grid-column:2; grid-row:1; }
.cart-item-info strong { font-size:.88rem; line-height:1.3; font-weight:600; }
.cart-item > .cart-line-total { grid-column:3; grid-row:1; font-size:.88rem; line-height:1.3; white-space:nowrap; color:var(--cellar); }
.cart-remove { grid-column:4; grid-row:1; display:grid; place-items:center; width:100%; height:32px; padding:0; border:0; border-radius:5px; background:none; color:var(--muted); font-size:22px; line-height:1; cursor:pointer; }
.cart-remove:hover { color:#a43d31; background:#f8eeeb; }
.cart-item-quantity { grid-column:2 / 5; grid-row:2; display:flex; align-items:center; gap:12px; min-width:0; }
.cart-item-quantity input[type="range"] { flex:1; width:0; min-width:0; height:24px; margin:0; padding:0; accent-color:#4a6b5c; cursor:pointer; }
.cart-item-quantity .cart-quantity-label { min-width:64px; text-align:right; font-size:.78rem; line-height:1.3; color:var(--muted); white-space:nowrap; }
.cart-stock-warning { font-size:.72rem; line-height:1.3; margin-top:4px; }

.toast { min-width:0; border-radius:8px; padding:10px 12px; font-size:.84rem; line-height:1.45; }
@media(max-width:480px) {
  .cart-item { grid-template-columns:44px minmax(0,1fr) auto 26px; gap:4px 8px; }
  .cart-product-image { width:44px; height:44px; }
  #cartDrawer .drawer-body { padding-inline:12px; }
  .cart-item-info strong,.cart-item > .cart-line-total { font-size:.82rem; }
}
#cartDrawer .drawer-body { gap:0; }
#cartDrawer .drawer-head h2 { font-size:1.2rem; }
#cartDrawer .drawer-head .icon-btn { width:32px; height:32px; border-radius:6px; }
#cartDrawer .drawer-foot .btn { min-height:40px; padding:10px 14px; border-radius:8px; font-size:.9rem; }

#checkoutModal [hidden] {
  display: none;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.5rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}

.legal-document {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.6;
}

.legal-document a, .legal-footer a, .consent-block a {
  text-decoration: underline;
}


/* Touch controls and layouts that also fit phone keyboards and safe areas. */
.modal, .drawer { visibility: hidden; }
.modal.open, .drawer.open { visibility: visible; }
.cart-mobile-icon { display: none; }
.nav-links a[hidden] { display: none !important; }
.admin-order-copy { min-width: 0; padding-right: 1rem; }
.admin-order-status { min-width: 130px; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--sage-deep);
  outline-offset: 3px;
}
.drawer-body { min-height: 0; overscroll-behavior: contain; }
.drawer-head, .drawer-foot { flex-shrink: 0; }
.modal { overscroll-behavior: contain; }
.field, .field-row > *, .detail-copy, .panel, .article-card { min-width: 0; }
.article-card, .admin-article-copy, .admin-order-copy, .admin-review-row, .admin-product-row {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .site-nav {
    height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .nav-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    gap: 6px;
    width: calc(100% - 24px);
    margin-inline: auto;
  }
  .brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: clamp(.78rem, 3.5vw, 1rem);
    line-height: 1.2;
    min-width: 0;
  }
  .brand span { display: inline; font-size: .65rem; }
  .brand::after { content: none; }
  .nav-actions { margin: 0; min-width: 0; gap: 4px; }
  #authBtn { min-height: 44px; padding: 8px 10px; font-size: .8rem; }
  .cart-btn { min-height: 44px; min-width: 44px; justify-content: center; padding: 8px; }
  .cart-label { display: none; }
  .cart-mobile-icon { display: inline; font-size: 1.1rem; line-height: 1; }
  .menu-toggle { display: inline-grid; place-items: center; order: 3; width: 44px; height: 44px; }
  .nav-links {
    position: fixed;
    left: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 6px);
    max-height: calc(var(--viewport-height, 100dvh) - var(--nav-h) - 20px);
    overflow-y: auto;
    visibility: hidden;
  }
  .nav-links.open { visibility: visible; opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { display: flex; align-items: center; min-height: 44px; white-space: normal; }
}

@media (max-width: 760px) {
  #appMain { padding-top: env(safe-area-inset-top, 0px); }
  .container { width: calc(100% - 24px); }
  .section { padding-block: 2rem; }
  .section-head, .panel-toolbar, .toolbar-actions, .filters-bar { min-width: 0; }
  .filters-bar { display: flex; flex-direction: column; gap: 12px; }
  .filters { width: auto; max-width: calc(100% + 24px); margin: 0 -12px; padding: 0 12px 8px; }
  .select-wrapper { width: 100%; margin-bottom: 1rem; }
  .btn, .chip, .tab, .reaction-button, .icon-btn { min-height: 44px; }
  .icon-btn { min-width: 44px; }
  .field input, .field select, .field textarea, .custom-select, .input {
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
  }
  .field input:not([type="checkbox"]):not([type="range"]), .field select, .custom-select {
    min-height: 46px;
  }
  .field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  input[type="file"] { overflow: hidden; }
  input[type="file"]::file-selector-button { min-height: 40px; max-width: 100%; }
  .product-detail, .account-grid, .story { padding: 1rem; gap: 1rem; }
  .product-detail { grid-template-columns: minmax(0, 1fr); }
  .detail-copy h1 { font-size: clamp(1.35rem, 6vw, 2rem); overflow-wrap: anywhere; }
  .detail-blocks { grid-template-columns: minmax(0, 1fr); }
  .product-actions, .hero-actions { flex-wrap: wrap; }
  .products-grid { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
  .product-body, .product-title { min-width: 0; overflow-wrap: anywhere; }
  .card-weight-slider, .cart-item-quantity input[type="range"] { min-height: 44px; touch-action: pan-y; }
  #cartDrawer {
    top: var(--viewport-top, 0px);
    height: var(--viewport-height, 100dvh);
    max-height: 100dvh;
    border-radius: 0;
  }
  #cartDrawer .drawer-head .icon-btn { width: 44px; height: 44px; }
  #cartDrawer .drawer-foot { padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .cart-item { grid-template-columns: 44px minmax(0, 1fr) auto 44px; }
  .cart-remove { min-height: 44px; min-width: 44px; }
  #cartDrawer .drawer-head { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
  .modal, .modal.wide, #authModal.modal {
    width: calc(100% - 16px);
    max-width: 560px;
    max-height: calc(var(--viewport-height, 100dvh) - 16px - env(safe-area-inset-bottom, 0px));
    left: 50%;
    right: auto;
    top: calc(var(--viewport-top, 0px) + 8px);
    bottom: auto;
    border-radius: 20px;
    transform: translateX(-50%);
  }
  .modal.open, #authModal.modal.open { transform: translateX(-50%); animation: none; }
  .modal-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 12px 16px; }
  .modal-head h2 { font-size: 1.1rem; }
  .modal-body, #authModal .modal-body { padding: 16px; }
  #authModal .modal-head { padding: 16px; }
  .modal-body { padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .map-container { height: clamp(180px, 32dvh, 280px); }
  .consent-block { font-size: .82rem; }
  .consent-block input { flex-shrink: 0; width: 20px; height: 20px; }
  .toast-host { left: 12px; right: 12px; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 8px); }
  .toast { max-width: 100%; overflow-wrap: anywhere; }
  .article-reactions, .pagination { flex-wrap: wrap; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
  .admin-tabs .tab { flex: 0 0 auto; }
  .panel-toolbar, .toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .panel-toolbar > *, .toolbar-actions > * { max-width: 100%; }
  .toolbar-actions select { flex: 1 1 160px; }
  .admin-order-row, .admin-review-row, .admin-product-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .admin-order-copy { padding-right: 0; }
  .admin-order-status { min-width: 0; width: 100%; }
  .admin-order-status select { width: 100%; }
  .admin-review-row > div, .admin-product-row > div { min-width: 0; flex-wrap: wrap; }
  .admin-product-row img { flex: 0 0 48px; }
  .photo-viewer { padding-top: max(60px, calc(env(safe-area-inset-top, 0px) + 44px)); }
  .photo-viewer .viewer-close { top: max(16px, env(safe-area-inset-top, 0px)); }
  .photo-viewer .viewer-prev, .photo-viewer .viewer-next {
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  .toolbar-actions select, .admin-order-status select {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
  }
  #adminOrdersPagination {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: .8rem;
  }
  #adminOrdersPagination .btn {
    padding: 8px 10px;
    min-width: 0;
    font-size: .8rem;
  }
  .legal-footer { padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
}

@media (hover: none) {
  .product-card:hover, .products-grid .product-card:nth-child(3n+1):hover,
  .products-grid .product-card:nth-child(3n):hover, .btn:hover, .cart-btn:hover {
    transform: none;
  }
}
