/* =========================================================
   Cactus — онлайн магазин
   Дизайн токени: кремаво и маслинено, по одобрената кутия M
   ========================================================= */
:root {
  --ivory: #f4eddd;
  --ivory-2: #ebe1ca;
  --paper: #fbf7ee;
  --olive-ink: #2c3b22;
  --olive: #475d33;
  --olive-2: #5f7745;
  --sage: #8e9c78;
  --sage-soft: #d9dcc6;
  --grape: #5b4b80;
  /* Фокус: зелено в тона на сайта (рамка за клавиатура и мек контур на полетата) */
  --focus: #6f9159;
  --focus-border: #8aa874;
  --focus-ring: rgba(143, 174, 111, 0.38);
  --leaf: #b5561d;
  --line: rgba(44, 59, 34, 0.16);
  --line-strong: rgba(44, 59, 34, 0.32);
  --muted: #5c6651;
  --danger: #9b2c1a;
  --ok: #3f6a2c;

  --f-display: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2vw, 2.875rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.2vw, 4.75rem);

  --radius-s: 6px;
  --radius-m: 14px;
  --shadow-box: 0 30px 60px -28px rgba(44, 59, 34, 0.45), 0 10px 22px -12px rgba(44, 59, 34, 0.25);
  --header-h: 72px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--olive-ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--olive); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--olive-ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); font-style: italic; font-weight: 500; }
h2 { font-size: var(--step-3); font-style: italic; font-weight: 500; }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; max-width: 64ch; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--olive-ink); color: var(--paper);
  padding: 10px 16px; border-radius: var(--radius-s);
}
.skip-link:focus { top: 12px; color: var(--paper); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(244, 237, 221, 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  height: 100%;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: block; flex: none; }
.brand img { height: 46px; width: auto; }

.nav { margin-left: auto; }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px; align-items: center;
}
.nav a {
  display: block;
  padding: 10px 12px;
  color: var(--olive-ink);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: var(--radius-s);
  position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover::after,
.nav a[aria-current="page"]::after,
.nav a.is-current::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 12px;
  color: var(--olive-ink); text-decoration: none;
  border-radius: 999px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.icon-link:hover { background: rgba(71, 93, 51, 0.08); color: var(--olive-ink); }
.icon-link svg { width: 20px; height: 20px; flex: none; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--olive); color: var(--paper);
  font-size: 0.75rem; font-weight: 600;
  line-height: 1;
}
.cart-count[data-zero="true"] { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
.cart-count.bump { animation: bump 0.5s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); background: var(--grape); }
  100% { transform: scale(1); }
}

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--olive-ink);
  align-items: center; justify-content: center;
  cursor: pointer;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block; width: 18px; height: 1.5px; background: currentColor;
  position: relative; transition: transform 0.3s var(--ease), background 0.2s;
}
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav a { padding: 10px 9px; font-size: 0.9rem; }
  .header-actions .label-wide { display: none; }
}
@media (max-width: 920px) {
  .menu-toggle { display: inline-flex; order: 3; }
  .header-actions { margin-left: auto; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    visibility: hidden; opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .menu-open .nav {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
  }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav a { padding: 14px 4px; font-size: 1.05rem; }
  .nav a::after { display: none; }
  .brand img { height: 40px; }
}
@media (max-width: 420px) {
  .header-actions .label { display: none; }
  .site-header .wrap { gap: 8px; }
}
@media (max-width: 360px) {
  .brand img { height: 34px; }
  .header-actions { gap: 0; }
  .icon-link { padding: 8px 7px; gap: 5px; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--olive);
  --btn-fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 26px;
  border: 1px solid var(--btn-bg);
  border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 500 1rem/1.2 var(--f-body);
  text-decoration: none;
  cursor: pointer;
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
.btn:hover { --btn-bg: var(--olive-ink); color: var(--paper); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--olive-ink); border-color: var(--line-strong); }
.btn--ghost:hover { --btn-bg: rgba(71, 93, 51, 0.08); color: var(--olive-ink); border-color: var(--olive); }
.btn--small { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; }
.btn--block { width: 100%; }
.btn .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none; border: 0; padding: 6px 0; min-height: 44px;
  color: var(--olive); font: inherit; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}
.link-btn:hover { color: var(--olive-ink); }

/* ---------- Leaf shadows (ефект) ---------- */
.leaf-shadows {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.leaf-shadows svg {
  position: absolute;
  width: 62%; min-width: 520px;
  height: auto;
  opacity: 0.17;
  filter: blur(7px);
  mix-blend-mode: multiply;
  transform-origin: 0% 0%;
}
.leaf-shadows .ls-a { top: -10%; left: -8%; animation: sway-a 15s ease-in-out infinite alternate; }
.leaf-shadows .ls-b { top: -16%; right: -12%; left: auto; transform-origin: 100% 0%; animation: sway-b 19s ease-in-out infinite alternate; opacity: 0.12; }
@keyframes sway-a {
  0% { transform: rotate(-1.2deg) translate3d(0, 0, 0); }
  100% { transform: rotate(2deg) translate3d(14px, 8px, 0); }
}
@keyframes sway-b {
  0% { transform: scaleX(-1) rotate(1deg) translate3d(0, 0, 0); }
  100% { transform: scaleX(-1) rotate(-2.4deg) translate3d(-10px, 12px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .leaf-shadows svg { animation: none !important; }
}

/* ---------- Growing border (ефект) ---------- */
/* Бордюрът с опунции стои по долния край на секцията и никога не покрива текст:
   секцията има долно поле, равно на височината му. */
:root { --border-h: calc(max(100vw, 760px) / 5.43); }
.border-grow {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--border-h);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.border-grow picture { position: absolute; inset: 0; }
.border-grow img {
  position: absolute; left: 50%; bottom: 0;
  width: max(100%, 760px);
  max-width: none;
  height: auto;
  transform: translateX(-50%);
}
.js .border-grow img {
  clip-path: inset(100% 0 0 0);
  transform: translateX(-50%) translateY(16px) scaleY(0.9);
  transform-origin: 50% 100%;
  transition: clip-path 1.8s var(--ease), transform 1.8s var(--ease);
}
.js .border-grow.is-in img {
  clip-path: inset(0 0 0 0);
  transform: translateX(-50%) translateY(0) scaleY(1);
}
@media (prefers-reduced-motion: reduce) {
  .js .border-grow img { clip-path: none; transform: translateX(-50%); transition: none; }
}
.has-border { padding-bottom: calc(var(--border-h) + 12px) !important; }

/* ---------- Reveal (плавни появявания) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero / configurator ---------- */
.hero {
  position: relative;
  padding: clamp(28px, 4.5vw, 56px) 0 clamp(36px, 5vw, 64px);
  isolation: isolate;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.hero-copy h1 { margin-bottom: 0.3em; }
.hero-copy .lede { font-size: var(--step-1); color: var(--muted); max-width: 42ch; margin-bottom: 0; }

/* Първият екран на началната страница заема цялата височина на прозореца */
.hero--full {
  min-height: calc(100svh - var(--header-h) - var(--banner-h, 0px));
  display: flex; flex-direction: column; justify-content: center;
}
.hero--full h1 { font-size: clamp(2.5rem, 1.3rem + 3.2vw, 4.1rem); }
@media (min-width: 861px) and (max-height: 900px) {
  .hero--full { padding-top: 24px; }
  .hero--full h1 { font-size: clamp(2.5rem, 1.2rem + 2.4vw, 3.3rem); }
  .hero--full .lede { font-size: 1.05rem; }
  .hero--full .price-row { margin: 16px 0 12px; }
  .hero--full .picker { margin-top: 18px; }
}
@media (min-width: 861px) {
  .hero--full .stage {
    width: min(100%, calc((100svh - var(--header-h) - var(--banner-h, 0px) - var(--border-h) - 124px) * 1.1));
    min-width: 340px;
    margin-inline: auto;
  }
  .hero--full .stage-caption { max-width: min(100%, calc((100svh - var(--header-h) - var(--banner-h, 0px) - var(--border-h) - 124px) * 1.1)); margin-inline: auto; }
}

.picker { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 14px 14px; min-height: 84px; }
.picker fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.picker legend {
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0;
}
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(251, 247, 238, 0.7);
}
.seg label {
  position: relative;
  display: inline-flex; align-items: baseline; gap: 6px;
  min-height: 42px; padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  color: var(--olive-ink);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  user-select: none;
}
.seg label small { font-weight: 400; color: var(--muted); font-size: 0.82rem; transition: color 0.25s; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--olive); color: var(--paper); }
.seg label:has(input:checked) small { color: rgba(251, 247, 238, 0.78); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg label:hover:not(:has(input:checked)):not(.is-disabled) { background: rgba(71, 93, 51, 0.08); }
.seg label.is-disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

.price-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px;
  margin: 22px 0 16px;
  min-height: 2.6rem;
}
.price {
  font-family: var(--f-display);
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem);
  font-weight: 600;
  line-height: 1;
}
.price--pending { font-family: var(--f-body); font-size: 1rem; font-weight: 500; color: var(--muted); }
.badge-test {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(181, 86, 29, 0.45);
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.variant-meta { font-size: var(--step--1); color: var(--muted); margin: 10px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* продуктовата снимка */
.stage {
  position: relative;
  perspective: 1200px;
}
.stage-card {
  position: relative;
  aspect-ratio: 1.1;
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-box);
  background: var(--ivory-2);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.stage-card picture, .stage-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.stage-card img { object-fit: cover; object-position: 50% 50%; }
.stage-card .layer { transition: opacity 0.55s var(--ease); }
.stage-card .layer.is-leaving { opacity: 0; }
.stage-caption {
  margin: 14px 2px 0;
  font-size: var(--step--1);
  color: var(--muted);
  min-height: 3em;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { display: contents; }
  .hero-copy > * { order: 3; }
  .hero-copy > h1, .hero-copy > .lede, .hero-copy > .crumbs { order: 1; }
  .hero-media { order: 2; margin: 22px 0 4px; }
  .hero--full { min-height: 0; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 112px) 0; position: relative; }
.section--paper { background: var(--paper); }
.section--sage { background: var(--sage-soft); }
.section-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head p { color: var(--muted); font-size: var(--step-1); }

.contents {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.contents-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.contents-list li {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.contents-list li:last-child { border-bottom: 1px solid var(--line); }
.contents-list .glyph {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ivory-2); color: var(--olive);
}
.contents-list .glyph svg { width: 28px; height: 28px; }
.contents-list h3 { font-size: 1.45rem; margin: 2px 0 4px; }
.contents-list p { margin: 0; color: var(--muted); }

.photo {
  margin: 0;
}
.photo picture {
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: 0 18px 40px -26px rgba(44, 59, 34, 0.5);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.photo img { width: 100%; }
.photo figcaption { margin-top: 10px; font-size: var(--step--1); color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .photo:hover picture { transform: scale(1.025); box-shadow: 0 26px 50px -26px rgba(44, 59, 34, 0.55); }
}

/* три направления */
.directions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.direction { border-top: 2px solid var(--olive); padding-top: 18px; }
.direction h3 { font-style: italic; font-weight: 500; font-size: 1.9rem; }
.direction p { color: var(--muted); }
@media (max-width: 860px) { .directions { grid-template-columns: 1fr; } }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}
.split--reverse .split-media { order: 2; }
.split-media { max-width: 460px; justify-self: center; width: 100%; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split-media { order: 0; }
}

.note-box {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  padding: 18px 20px;
  background: rgba(251, 247, 238, 0.6);
  color: var(--muted);
}
.note-box p:last-child { margin-bottom: 0; }

/* ---------- Shop: матрица на вариантите ---------- */
.matrix {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.matrix .row-label { font-family: var(--f-display); font-style: italic; font-size: 1.35rem; padding-right: 8px; }
.matrix .col-label { text-align: center; font-size: var(--step--1); color: var(--muted); }
.matrix button {
  position: relative;
  padding: 0; border: 2px solid transparent;
  border-radius: 10px; overflow: hidden;
  background: var(--ivory-2);
  cursor: pointer;
  aspect-ratio: 1.1;
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.matrix button img { width: 100%; height: 100%; object-fit: cover; }
.matrix button[aria-pressed="true"] { border-color: var(--olive); }
.matrix button:hover { transform: translateY(-2px); }
@media (max-width: 520px) {
  .matrix { gap: 6px; }
  .matrix .row-label { font-size: 1.05rem; }
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }

.spec-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.spec-table th, .spec-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--muted); width: 40%; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: clamp(20px, 4vw, 36px);
}
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label, .field .label { font-weight: 500; font-size: 0.95rem; }
.field .hint { font-size: var(--step--1); color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: #fffdf8;
  color: var(--olive-ink);
  font: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
/* Полета за писане: пастелно-зелен контур вместо рамка; радиобутоните и отметките не получават рамка при щракване */
.field input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([readonly]):focus, .field select:focus, .field textarea:focus,
input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([readonly]):focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--focus-border); box-shadow: 0 0 0 3px var(--focus-ring);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: var(--step--1); min-height: 0; }
.field .error:empty { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.choice-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: #fffdf8;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); }
.choice input { width: 18px; height: 18px; accent-color: var(--olive); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--olive); flex: none; }

.alert {
  border-radius: var(--radius-s);
  padding: 14px 16px;
  margin: 0 0 18px;
  border: 1px solid;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 6px; }
.alert--error { border-color: rgba(155, 44, 26, 0.4); background: #f9e9e2; color: #6f1f12; }
.alert--ok { border-color: rgba(63, 106, 44, 0.4); background: #e7efda; color: #2b4a1e; }
.alert--info { border-color: var(--line-strong); background: var(--paper); color: var(--olive-ink); }
.alert[hidden] { display: none; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
  border: 0; background: none; cursor: pointer;
  padding: 12px 16px; min-height: 48px;
  font: 500 1rem var(--f-body); color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--olive-ink); border-bottom-color: var(--olive); }

/* ---------- Page header for inner pages ---------- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); position: relative; isolation: isolate; }
.page-head h1 { font-size: var(--step-3); margin-bottom: 0.2em; }
.page-head p { color: var(--muted); }
.page-body { padding-bottom: clamp(56px, 8vw, 96px); }
/* Сенките в заглавието на вътрешните страници: продължават под заглавието
   и избледняват плавно надолу и към средата, без рязък ръб. */
.page-head .leaf-shadows {
  bottom: -220px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.85) 35%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.85) 35%, transparent 100%);
}
.page-head .leaf-shadows svg { top: -60px; }
.page-head .leaf-shadows .ls-b { top: -90px; }
.page-head + .page-body { position: relative; z-index: 1; }
.narrow { max-width: 560px; }

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 880px) { .layout-2 { grid-template-columns: 1fr; } }
.sticky-aside { position: sticky; top: calc(var(--header-h) + 20px); }
@media (max-width: 880px) { .sticky-aside { position: static; } }

/* ---------- Cart ---------- */
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 16px 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:first-child { border-top: 1px solid var(--line); }
.cart-item .thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 1.1; background: var(--ivory-2); }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item h3 { font-size: 1.35rem; margin: 0 0 2px; }
.cart-item .meta { margin: 0; color: var(--muted); font-size: var(--step--1); }
.cart-item .line-total { font-weight: 600; text-align: right; white-space: nowrap; }
.cart-item .controls { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.qty button {
  width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  font-size: 1.2rem; color: var(--olive-ink); border-radius: 999px;
}
.qty button:hover:not(:disabled) { background: rgba(71, 93, 51, 0.08); }
.qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }
@media (max-width: 560px) {
  .cart-item { grid-template-columns: 84px minmax(0, 1fr); }
  .cart-item .line-total { grid-column: 2; text-align: left; }
}

.summary dl { margin: 0 0 18px; display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 500; }
.summary .total dt, .summary .total dd { padding-top: 12px; border-top: 1px solid var(--line); color: var(--olive-ink); font-weight: 600; font-size: 1.1rem; }
.summary h2 { font-size: 1.9rem; }
.summary .fineprint { font-size: var(--step--1); color: var(--muted); margin: 14px 0 0; }

.empty-state { text-align: center; padding: 48px 0; }
.empty-state p { margin-inline: auto; color: var(--muted); }

/* ---------- Orders ---------- */
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th, .orders-table td { padding: 14px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.orders-table th { font-weight: 500; color: var(--muted); font-size: var(--step--1); }
.orders-table td.num { font-weight: 600; }
.orders-table a { font-weight: 500; }
@media (max-width: 640px) {
  .orders-table thead { display: none; }
  .orders-table tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .orders-table td { border: 0; padding: 4px 0; }
}
.status {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500;
  background: var(--sage-soft); color: var(--olive-ink);
  white-space: nowrap;
}
.status--unpaid { background: #efe3cf; color: #7a4a1b; }

.account-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; }
.account-nav a, .account-nav button {
  padding: 10px 16px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  text-decoration: none; color: var(--olive-ink);
  background: none; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center;
}
.account-nav a[aria-current="page"] { background: var(--olive); color: var(--paper); border-color: var(--olive); }

.db-banner {
  background: #efe3cf;
  color: #5b3a14;
  border-bottom: 1px solid rgba(181, 86, 29, 0.3);
  font-size: var(--step--1);
  text-align: center;
  padding: 8px var(--gutter);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--olive-ink);
  color: rgba(251, 247, 238, 0.82);
  padding: 48px 0 32px;
  font-size: 0.95rem;
}
.site-footer a { color: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-size: 1.5rem; color: var(--paper); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-grid ul a { display: inline-block; padding: 6px 0; text-decoration: none; }
.footer-grid ul a:hover { text-decoration: underline; }
.footer-brand img { height: 52px; width: auto; filter: brightness(0) invert(0.94) sepia(0.15); }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(251, 247, 238, 0.15); font-size: var(--step--1); color: rgba(251, 247, 238, 0.6); }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
  /* На телефон логото и мотото са центрирани */
  .footer-brand { text-align: center; }
  .footer-brand picture, .footer-brand img { display: block; margin-inline: auto; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 16px);
  opacity: 0; visibility: hidden;
  background: var(--olive-ink); color: var(--paper);
  padding: 13px 20px; border-radius: 14px;
  box-shadow: 0 18px 40px -14px rgba(20, 28, 14, 0.55);
  display: flex; gap: 14px; align-items: center;
  width: max-content; max-width: min(520px, calc(100vw - 32px));
  font-size: 0.95rem; line-height: 1.4;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
}
.toast.is-shown { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.toast a { color: var(--paper); font-weight: 600; white-space: nowrap; }

/* Добавяне в кошницата: отметка, продукт и бутон */
.toast--cart {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px;
  width: min(480px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px;
}
.toast-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sage-soft); color: var(--olive-ink);
}
.toast-icon svg { width: 18px; height: 18px; }
.toast-body { display: grid; gap: 2px; min-width: 0; }
.toast-body strong { font-weight: 600; font-size: 0.95rem; }
.toast-sub {
  font-size: 0.84rem; color: rgba(251, 247, 238, 0.72);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.toast .toast-action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--paper); color: var(--olive-ink);
  font-size: 0.86rem; text-decoration: none;
  transition: background 0.2s;
}
.toast .toast-action:hover { background: var(--sage-soft); }
@media (max-width: 560px) {
  .toast {
    left: 16px; right: 16px; width: auto; max-width: none;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateY(16px);
  }
  .toast.is-shown { transform: none; }
  .toast--cart { grid-template-columns: 36px minmax(0, 1fr); row-gap: 12px; padding: 14px; }
  .toast--cart .toast-action { grid-column: 1 / -1; }
}

/* ---------- Small utilities ---------- */
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 14px; }
.skeleton { color: transparent; background: linear-gradient(90deg, var(--ivory-2), var(--paper), var(--ivory-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.section > .wrap { position: relative; z-index: 1; }
@media (max-width: 860px) { .contents { grid-template-columns: 1fr; } }
.brand { padding: 6px 0; }

/* =========================================================
   Плавни преходи между страниците (View Transitions)
   ========================================================= */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out 0.28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.42s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Полет към кошницата ---------- */
.fly-ghost {
  position: fixed; z-index: 90;
  background: var(--ivory-2) center / cover no-repeat;
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(44, 59, 34, 0.55);
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---------- Бутон „Нагоре“ ---------- */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(251, 247, 238, 0.94);
  color: var(--olive-ink);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(44, 59, 34, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.9);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s, background 0.2s;
}
.to-top svg { width: 22px; height: 22px; }
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), background 0.2s; }
.to-top:hover { background: var(--olive); color: var(--paper); }

/* ---------- Навигация назад (трохи) ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 20px; font-size: 0.92rem; }
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 18px 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--olive-ink); text-decoration: none; font-weight: 500;
  background: rgba(251, 247, 238, 0.75);
  transition: background 0.2s, border-color 0.2s;
}
.back-btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.back-btn:hover { background: rgba(71, 93, 51, 0.08); border-color: var(--olive); color: var(--olive-ink); }
.back-btn:hover svg { transform: translateX(-3px); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px 0 6px; }
.crumbs ol a { color: var(--muted); display: inline-block; padding: 10px 0; }
.crumbs ol a:hover { color: var(--olive-ink); }

/* =========================================================
   Продукти: филтри и карти
   ========================================================= */
.catalog {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.filters { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 24px; }
.filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.filters legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.filter-list { display: grid; gap: 2px; }
.filter-opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 6px 8px; margin: 0 -8px;
  border-radius: 8px; cursor: pointer;
}
.filter-opt:hover { background: rgba(71, 93, 51, 0.07); }
.filter-opt input { width: 18px; height: 18px; accent-color: var(--olive); flex: none; }
.filter-opt .count { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.filter-opt.is-empty { opacity: 0.45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-block; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-grid; place-items: center;
  min-width: 52px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip input:checked + span { background: var(--olive); border-color: var(--olive); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip input:disabled + span { opacity: 0.4; }
.chip input:disabled { cursor: not-allowed; }

.range { position: relative; height: 36px; margin: 2px 6px 12px; }
.range .track { position: absolute; left: 0; right: 0; top: 16px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.range .fill { position: absolute; top: 16px; height: 4px; border-radius: 4px; background: var(--olive); }
.range input[type="range"] {
  position: absolute; left: -12px; top: 0; width: calc(100% + 24px); height: 36px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range input[type="range"]::-webkit-slider-runnable-track { background: none; height: 36px; }
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 24px; height: 24px; margin-top: 6px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--olive); cursor: grab;
  box-shadow: 0 2px 6px rgba(44, 59, 34, 0.25);
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--olive); cursor: grab;
}
.range input[type="range"]::-moz-range-track { background: none; }
.range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--focus); outline-offset: 2px; }
.range input[type="range"]:disabled::-webkit-slider-thumb { cursor: not-allowed; opacity: 0.5; }
.price-inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.price-inputs label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.price-inputs input {
  width: 100%; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: #fffdf8; font: inherit; color: var(--olive-ink);
}
.price-inputs > span { color: var(--muted); padding-top: 22px; }
.filters .hint { font-size: var(--step--1); color: var(--muted); margin: 8px 0 0; }

.catalog-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-bottom: 22px;
}
.catalog-bar .result-count { margin: 0; color: var(--muted); }
.catalog-bar-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sort-select { display: flex; align-items: center; gap: 10px; }
.sort-select select {
  min-height: 44px; padding: 8px 38px 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fffdf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c3b22' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
  font: inherit; color: var(--olive-ink); cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.filters-toggle { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.active-filters:empty { display: none; }
.active-filters button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 4px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--paper); color: var(--olive-ink); font: inherit; font-size: 0.9rem; cursor: pointer;
}
.active-filters button:hover { border-color: var(--olive); }
.active-filters button span[aria-hidden] { font-size: 1.15em; line-height: 1; }

@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .filters-toggle { display: inline-flex; }
  .filters {
    position: static;
    padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
  }
  .js .filters:not(.is-open) { display: none; }
}

.product-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}
.product-grid > li { display: flex; }
.p-card {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  transform: translateY(var(--lift, 0px));
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s;
}
@media (hover: hover) and (pointer: fine) {
  .p-card:hover { --lift: -3px; box-shadow: 0 16px 30px -24px rgba(44, 59, 34, 0.45); border-color: var(--line-strong); }
}
.p-card:focus-within { border-color: var(--olive); }
.p-card-media { position: relative; display: block; aspect-ratio: 1.1; background: var(--ivory-2); }
.p-card-media picture { position: absolute; inset: 0; }
.p-card-media img { width: 100%; height: 100%; object-fit: cover; }
.p-card .badge-test { position: absolute; left: 12px; top: 12px; z-index: 1; background: rgba(251, 247, 238, 0.94); }
.p-card-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; flex: 1; }
.p-card-cat { margin: 0; font-size: 0.82rem; color: var(--muted); }
.p-card h3 { font-size: 1.45rem; margin: 0; line-height: 1.15; }
.p-card h3 a { color: inherit; text-decoration: none; }
.p-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.p-card h3 a:focus-visible { outline: none; }
.p-card:has(h3 a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.p-card-variant { margin: 0; color: var(--muted); font-size: 0.95rem; }
.p-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.p-card-foot .price { font-size: 1.7rem; }
.p-card-foot .price--pending { font-size: 0.88rem; max-width: 12ch; line-height: 1.3; }
.p-card-actions { display: flex; gap: 6px; position: relative; z-index: 1; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--olive-ink); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: rgba(71, 93, 51, 0.08); border-color: var(--olive); }
.icon-btn--solid { background: var(--olive); border-color: var(--olive); color: var(--paper); }
.icon-btn--solid:hover { background: var(--olive-ink); color: var(--paper); }
.icon-btn:active { transform: scale(0.94); }
.p-card.is-entering { animation: card-in 0.45s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: scale(0.94); } }
@media (prefers-reduced-motion: reduce) { .p-card, .p-card.is-entering { transition: none; animation: none; } }

.catalog-empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-m); }
.catalog-empty p { margin-inline: auto; color: var(--muted); }

/* ---------- Бърз преглед ---------- */
.quick-view {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: var(--radius-m);
  background: var(--paper); color: var(--olive-ink);
  box-shadow: 0 40px 80px -30px rgba(20, 30, 15, 0.6);
  overflow: auto;
}
.quick-view::backdrop { background: rgba(28, 38, 22, 0.55); backdrop-filter: blur(3px); }
.quick-view[open] { animation: qv-in 0.35s var(--ease); }
@keyframes qv-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.qv-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.qv-media { position: relative; background: var(--ivory-2); aspect-ratio: 1.1; }
.qv-media picture { position: absolute; inset: 0; }
.qv-media img { width: 100%; height: 100%; object-fit: cover; }
.qv-body { padding: clamp(20px, 3vw, 36px); padding-top: 56px; display: flex; flex-direction: column; gap: 6px; }
.qv-body h2 { font-size: 2rem; margin: 0 0 4px; }
.qv-body .price-row { margin: 14px 0 6px; }
.qv-body .actions { margin-top: 14px; }
.qv-close { position: absolute; right: 12px; top: 12px; z-index: 2; }
@media (max-width: 700px) { .qv-grid { grid-template-columns: 1fr; } .qv-body { padding-top: 20px; } }

.matrix button picture { height: 100%; }

.cart-item h3 a { color: inherit; text-decoration: none; }
.cart-item h3 a:hover { text-decoration: underline; }
.cart-item--mini { grid-template-columns: 72px minmax(0, 1fr) auto; padding: 12px 0; }
.cart-item--mini .mini-title { margin: 0; font-weight: 500; }

/* =========================================================
   Админ панел
   ========================================================= */
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 18px; }
.adm-toolbar .adm-h2 { margin: 0 auto 0 0; }
.adm-inline { display: grid; gap: 4px; font-size: 0.88rem; color: var(--muted); }
.adm-inline select, .adm-inline input, .adm-input {
  min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: #fffdf8; font: inherit; font-size: 1rem; color: var(--olive-ink);
}
.adm-grow { flex: 1 1 240px; }
.adm-grow input { width: 100%; }
.adm-input { width: 100%; }
.adm-input--num { width: 96px; }
.adm-h2 { font-size: 1.7rem; margin-bottom: 14px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: flex-end; }
.adm-row > .field { min-width: 160px; }
.adm-row > .btn { margin-bottom: 18px; }
.adm-check { min-height: 48px; align-items: center; margin-bottom: 18px; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-table td { vertical-align: middle; }
.adm-new-cat { margin-bottom: 28px; }

.adm-order { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper); margin-bottom: 10px; }
.adm-order summary {
  display: grid;
  grid-template-columns: 90px 150px minmax(0, 1fr) auto auto auto;
  gap: 8px 16px; align-items: center;
  padding: 14px 18px; cursor: pointer; list-style: none;
  min-height: 56px;
}
.adm-order summary::-webkit-details-marker { display: none; }
.adm-order summary:hover { background: rgba(71, 93, 51, 0.05); }
.adm-order[open] summary { border-bottom: 1px solid var(--line); }
.adm-order-num { font-weight: 600; }
.adm-order-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-order-sum { font-weight: 500; white-space: nowrap; }
.adm-order-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 24px; padding: 18px; }
.adm-order-side p { margin: 0 0 12px; }
.adm-status-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .adm-order summary { grid-template-columns: auto 1fr; }
  .adm-order summary > :nth-child(2) { justify-self: end; color: var(--muted); }
  .adm-order-body { grid-template-columns: 1fr; }
}

.adm-products { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm-product {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
}
.adm-product h3 { font-size: 1.35rem; margin: 0 0 2px; }
.adm-product .meta { margin: 0; color: var(--muted); font-size: 0.92rem; }
.adm-product .thumb, .adm-variant .thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 1.1; background: var(--ivory-2); display: grid; place-items: center; }
.adm-product .thumb picture, .adm-variant .thumb picture { width: 100%; height: 100%; }
.adm-product .thumb img, .adm-variant .thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) {
  .adm-product { grid-template-columns: 72px minmax(0, 1fr); }
  .adm-product .btn { grid-column: 1 / -1; }
}

.adm-product-form { margin: 16px 0 28px; }
.adm-variants { margin-top: 8px; }
.adm-variant {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 18px;
  padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
}
.adm-variant-img { display: grid; gap: 8px; align-content: start; }
.adm-upload { cursor: pointer; }
.adm-upload:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.adm-variant-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; align-items: end; }
.adm-variant-fields .field { margin-bottom: 12px; }
.adm-variant-fields .adm-wide { grid-column: 1 / -1; }
.adm-variant-fields .check { min-height: 44px; align-items: center; }
.adm-variant-actions { display: grid; gap: 8px; align-content: start; }
@media (max-width: 980px) {
  .adm-variant { grid-template-columns: 120px minmax(0, 1fr); }
  .adm-variant-actions { grid-column: 1 / -1; display: flex; }
  .adm-variant-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .adm-variant { grid-template-columns: 1fr; }
  .adm-variant-img { grid-template-columns: 110px auto; align-items: center; }
  .adm-variant-fields { grid-template-columns: 1fr; }
}
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }

.catalog-bar-right { min-width: 0; }
.sort-select { min-width: 0; }
.sort-select select { min-width: 0; max-width: 100%; }
@media (max-width: 520px) {
  .catalog-bar-right { width: 100%; }
  .sort-select { width: 100%; }
  .sort-select > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sort-select select { width: 100%; }
}
.cart-item h3 a { display: inline-block; padding: 9px 0; }
.p-card h3 a { display: inline-block; padding: 6px 0; }

.filters-bar { display: none; }
@media (max-width: 900px) { .filters-bar { display: block; margin-bottom: 14px; } }

/* =========================================================
   Падащо меню „Подреди“ (select-menu.js)
   ========================================================= */
.sel { position: relative; min-width: 0; }
.sel-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-width: 230px; min-height: 46px; padding: 8px 14px 8px 18px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fffdf8; color: var(--olive-ink);
  font: 500 0.95rem/1.2 var(--f-body); text-align: left; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.sel-btn:hover { border-color: var(--olive); }
.sel.is-open .sel-btn { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(71, 93, 51, 0.12); }
.sel-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-chevron { width: 18px; height: 18px; flex: none; transition: transform 0.3s var(--ease); }
.sel.is-open .sel-chevron { transform: rotate(180deg); }
.sel-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 32px));
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 48px -20px rgba(44, 59, 34, 0.42), 0 4px 12px -6px rgba(44, 59, 34, 0.18);
  transform-origin: 85% 0;
  animation: sel-in 0.22s var(--ease);
}
@keyframes sel-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.sel-title { display: none; }
.sel-list { list-style: none; margin: 0; padding: 0; outline: none; }
.sel-list [role="option"] {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 14px 10px 12px;
  border-radius: 10px; cursor: pointer;
  color: var(--olive-ink); font-size: 0.95rem;
  transition: background 0.15s;
}
.sel-check { width: 18px; height: 18px; flex: none; color: var(--olive); opacity: 0; transition: opacity 0.15s; }
.sel-list [aria-selected="true"] { font-weight: 600; }
.sel-list [aria-selected="true"] .sel-check { opacity: 1; }
.sel-list .is-active { background: rgba(71, 93, 51, 0.09); }
.sel-list:focus-visible .is-active { box-shadow: inset 0 0 0 2px var(--focus); }
.sel-backdrop { display: none; }
@media (max-width: 600px) {
  .sel-btn { min-width: 0; }
  .sel-backdrop {
    display: block; position: fixed; inset: 0; z-index: 70;
    background: rgba(28, 38, 22, 0.45);
    animation: fade-in 0.25s var(--ease);
  }
  .sel-backdrop[hidden] { display: none; }
  .sel-pop {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 71;
    width: auto; max-width: none;
    padding: 10px 12px max(18px, env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    animation: sheet-in 0.32s var(--ease);
  }
  .sel-pop::before { content: ""; display: block; width: 40px; height: 4px; margin: 2px auto 10px; border-radius: 4px; background: var(--line-strong); }
  .sel-title { display: block; margin: 0 6px 6px; font-family: var(--f-display); font-style: italic; font-size: 1.5rem; }
  .sel-list [role="option"] { min-height: 52px; font-size: 1rem; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sel-pop, .sel-backdrop { animation: none; } }

/* =========================================================
   Страница на вариант (produkt.html)
   ========================================================= */
.pv { padding-bottom: clamp(40px, 6vw, 72px); }
.pv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.pv-info h1 { font-size: var(--step-3); margin-bottom: 0.15em; }
.pv-variant { font-size: var(--step-1); color: var(--muted); margin: 0; }
.pv-facts { margin: 26px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.pv-facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pv-facts dt { color: var(--muted); }
.pv-facts dd { margin: 0; }
.contents-list h4 { font-family: var(--f-display); font-size: 1.4rem; font-weight: 600; margin: 2px 0 4px; line-height: 1.15; }
@media (max-width: 860px) {
  .pv-grid { grid-template-columns: 1fr; }
  .pv-facts > div { grid-template-columns: 1fr; gap: 2px; }
}

/* =========================================================
   Куриер и избор на офис (poruchka.html)
   ========================================================= */
.courier-choice .choice { gap: 12px; padding: 12px 16px; min-height: 60px; }
.courier-choice .choice:has(input[value="econt"]:checked) { border-color: #1f4e9c; box-shadow: inset 0 0 0 1px #1f4e9c; background: #f3f6fc; }
.courier-choice .choice:has(input[value="speedy"]:checked) { border-color: #d71920; box-shadow: inset 0 0 0 1px #d71920; background: #fdf4f3; }
.courier-choice .choice input[value="econt"] { accent-color: #1f4e9c; }
.courier-choice .choice input[value="speedy"] { accent-color: #d71920; }

.office-pick {
  display: grid; gap: 10px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-s);
  background: #fffdf8;
}
.office-pick.has-office { border-style: solid; }
.office-selected { margin: 0; }
.office-selected strong { display: block; }
.field.has-error .office-pick { border-color: var(--danger); }

.office-dialog {
  width: min(960px, calc(100vw - 24px));
  height: min(720px, calc(100dvh - 24px));
  padding: 0; border: 0; border-radius: var(--radius-m);
  background: var(--paper); color: var(--olive-ink);
  box-shadow: 0 40px 80px -30px rgba(20, 30, 15, 0.6);
  overflow: hidden;
}
.office-dialog[open] { display: flex; flex-direction: column; animation: qv-in 0.3s var(--ease); }
.office-dialog::backdrop { background: rgba(28, 38, 22, 0.55); backdrop-filter: blur(3px); }
.office-dialog header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line);
}
.office-dialog h2 { font-size: 1.5rem; margin: 0; }
.office-dialog iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.office-dialog .od-status { padding: 8px 20px; margin: 0; font-size: var(--step--1); color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .office-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
}

@media (max-width: 520px) { .sort-select .sel { flex: 1; } }

.summary a[href="koshnica.html"] { display: inline-block; padding: 10px 0; }

/* ---------- Лога на куриерите ----------
   Височината е в em, за да следва размера на текста около логото;
   vertical-align поставя средата на логото на нивото на средата на главните букви. */
img.courier-logo { display: inline-block; width: auto; max-width: none; }
img.courier-logo--econt { height: 0.78em; vertical-align: -0.05em; }
img.courier-logo--speedy { height: 1.22em; vertical-align: -0.27em; }
.courier-logos { white-space: nowrap; }

/* самостоятелни лога в картите за избор на куриер */
.courier-choice .choice { justify-content: flex-start; }
.courier-choice img.courier-logo--econt { height: 23px; }
.courier-choice img.courier-logo--speedy { height: 33px; }

/* бутон „Избери офис от картата“ */
.office-open { gap: 10px; justify-self: stretch; min-height: 48px; padding-inline: 18px; }
.office-open svg { width: 20px; height: 20px; flex: none; }
.office-open--econt { border-color: rgba(35, 65, 130, 0.45); }
.office-open--speedy { border-color: rgba(220, 0, 50, 0.4); }
.office-open--econt:hover { border-color: #234182; background: #f3f6fc; color: #234182; }
.office-open--speedy:hover { border-color: #dc0032; background: #fdf3f5; color: #b0002a; }
.office-pick[data-courier="econt"].has-office { border-color: #234182; }
.office-pick[data-courier="speedy"].has-office { border-color: #dc0032; }
.office-selected-logo { display: block; margin-bottom: 6px; font-size: 1.15rem; line-height: 1; }
.office-pick .link-btn { justify-self: center; text-align: center; }

/* заглавие на прозореца с картата */
.office-dialog h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 0 0.3em; }
.od-logo { display: inline-flex; align-items: center; font-size: 1.05em; }
.od-logo img.courier-logo { vertical-align: 0; }
@media (max-width: 400px) {
  .office-dialog h2 { font-size: 1.3rem; }
  .courier-choice { grid-template-columns: 1fr; }
}


/* ---------- Телефон с код на държавата ---------- */
.phone-group { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.sel--phone .sel-btn {
  width: 108px; min-width: 0; min-height: 48px;
  padding: 8px 10px 8px 14px;
  border-radius: var(--radius-s);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.field.has-error .sel--phone .sel-btn { border-color: var(--danger); }
.sel--left .sel-pop { left: 0; right: auto; transform-origin: 15% 0; }
.sel--phone .sel-pop { width: 330px; }
.sel-list { max-height: min(340px, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.sel-aux { margin-left: auto; padding-left: 16px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
@media (max-width: 600px) {
  .sel--phone .sel-pop { width: auto; }
  .sel-list { max-height: 62vh; }
}
.sel--up .sel-pop { top: auto; bottom: calc(100% + 8px); transform-origin: 15% 100%; }
@media (max-width: 380px) { .sel--phone .sel-btn { width: 96px; } }

/* ---------- Показване на паролата (vhod.html) ---------- */
.pass-wrap { position: relative; }
.field .pass-wrap input { padding-right: 52px; }
.pass-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 44px; height: 40px;
  border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.pass-toggle:hover { color: var(--olive-ink); background: rgba(71, 93, 51, 0.08); }
.pass-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.pass-toggle svg { width: 21px; height: 21px; }
.pass-toggle .eye-slash { opacity: 0; transition: opacity 0.2s; }
.pass-toggle[aria-pressed="true"] { color: var(--olive-ink); }
.pass-toggle[aria-pressed="true"] .eye-slash { opacity: 1; }
/* скрива вграденото око на Edge, за да няма две */
.pass-wrap input::-ms-reveal { display: none; }

/* =========================================================
   Админ панел — второ издание (06.10.2026)
   ========================================================= */
/* Падащо меню като поле във формуляр */
.sel--field .sel-btn {
  min-width: 0; min-height: 44px;
  padding: 8px 12px 8px 14px;
  border-radius: var(--radius-s);
  font-weight: 400; font-size: 1rem;
}
.field .sel--field .sel-btn { min-height: 48px; }
.sel--field .sel-value { display: inline-flex; align-items: center; gap: 8px; }
.sel--field .sel-pop { min-width: 100%; }
.field.has-error .sel--field .sel-btn { border-color: var(--danger); }

/* Цветни статуси (точка в менюто и етикет) */
.sel-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.sel-dot[data-tone="new"]  { background: #5b4b80; }
.sel-dot[data-tone="ok"]   { background: #475d33; }
.sel-dot[data-tone="move"] { background: #b7791f; }
.sel-dot[data-tone="done"] { background: #2f7d4a; }
.sel-dot[data-tone="off"]  { background: #9a8f80; }
.sel-dot[data-tone="wait"] { background: #c0662b; }
.status--new  { background: #e7e2f1; color: #45386a; }
.status--ok   { background: var(--sage-soft); color: var(--olive-ink); }
.status--move { background: #f5e6c8; color: #7a4f10; }
.status--done { background: #dcebdc; color: #20582f; }
.status--off  { background: #ebe6de; color: #6b6257; }
.status--wait { background: #f6e1d0; color: #7f3c12; }

/* Бутон за опасно действие (изтриване) */
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); color: var(--danger); border-color: rgba(155, 44, 26, 0.35); }
.btn--danger:hover { --btn-bg: #f9e9e2; color: #6f1f12; border-color: var(--danger); }

/* Лента с филтри над поръчките */
.adm-filter .sel-btn { min-width: 200px; }
.adm-toolbar .adm-grow input { min-height: 44px; }

/* Поръчка */
.adm-order { transition: border-color 0.2s, box-shadow 0.2s; }
.adm-order:hover { border-color: var(--line-strong); }
.adm-order[open] { box-shadow: 0 18px 36px -28px rgba(44, 59, 34, 0.45); }
.adm-order summary { grid-template-columns: 80px 150px minmax(0, 1fr) auto auto auto 20px; }
.adm-order-chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.3s var(--ease); }
.adm-order[open] .adm-order-chev { transform: rotate(180deg); }
.adm-order-side { display: grid; align-content: start; gap: 4px; }
.adm-order-side .courier-logo { font-size: 1.05rem; }
.adm-status-form { gap: 12px; }
.adm-status-form .adm-inline { flex: 1 1 170px; }
.adm-status-form .sel-btn { width: 100%; }
@media (max-width: 860px) {
  .adm-order summary { grid-template-columns: auto 1fr auto; }
  .adm-order summary > :nth-child(2) { grid-column: 2 / 4; }
  .adm-order-name { grid-column: 1 / 3; }
  .adm-order-chev { grid-row: 1; grid-column: 3; }
  .adm-order summary > .status { justify-self: start; }
}

/* Формуляр на продукта */
.adm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.adm-span-2 { grid-column: span 2; }
.adm-span-3 { grid-column: 1 / -1; }
.acct-form .field-row { align-items: start; }
.field input[readonly] { background: var(--ivory-2); color: var(--muted); border-style: dashed; cursor: default; }
.field input[readonly]:focus { outline: none; border-color: var(--line-strong); }
.adm-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 22px; }
.adm-switch {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: #fffdf8; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.adm-switch:hover { border-color: var(--line-strong); }
.adm-switch:has(input:checked) { border-color: var(--olive); background: rgba(71, 93, 51, 0.06); }
.adm-switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--olive); flex: none; }
.adm-switch strong { display: block; font-weight: 600; }
.adm-switch small { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 2px; }
.adm-form-actions { justify-content: space-between; margin-top: 0; }
@media (max-width: 760px) {
  .adm-grid { grid-template-columns: 1fr; }
  .adm-span-2, .adm-span-3 { grid-column: auto; }
  .adm-switches { grid-template-columns: 1fr; }
}

/* Числата без стрелки (по-чисто поле) */
.admin-page input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.admin-page input[type="number"]::-webkit-inner-spin-button,
.admin-page input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Вариант: сгъваема карта */
.adm-variant { display: block; padding: 0; overflow: visible; transition: border-color 0.2s, box-shadow 0.2s; }
.adm-variant:hover { border-color: var(--line-strong); }
.adm-variant.is-open { border-color: var(--olive); box-shadow: 0 18px 36px -28px rgba(44, 59, 34, 0.45); }
.adm-variant-head {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px 14px;
}
.adm-variant-head .thumb { width: 64px; }
.adm-variant-head .thumb:empty { display: block; height: 58px; background: var(--ivory-2); }
.adm-variant-sum { display: grid; gap: 2px; min-width: 0; }
.adm-variant-title { font-weight: 600; font-size: 1.05rem; }
.adm-variant-meta { color: var(--muted); font-size: 0.92rem; }
.adm-variant-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.adm-variant-body {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px 22px;
  padding: 18px 16px 16px; border-top: 1px solid var(--line);
}
.adm-variant-body[hidden] { display: none; }
.adm-variant-img .thumb { aspect-ratio: 1.1; }
.adm-upload { display: inline-flex; gap: 6px; justify-content: center; }
.adm-upload svg { width: 16px; height: 16px; flex: none; }
.adm-variant-fields { gap: 0 14px; }
.adm-checks { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 4px 0 6px; }
.adm-variant-actions { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 980px) {
  .adm-variant-body { grid-template-columns: 120px minmax(0, 1fr); }
  .adm-variant-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .adm-variant-head { grid-template-columns: 56px minmax(0, 1fr); }
  .adm-variant-head .thumb { width: 56px; }
  .adm-variant-toggle { grid-column: 1 / -1; }
  .adm-variant-body { grid-template-columns: 1fr; }
  .adm-variant-img { grid-template-columns: 110px auto; align-items: center; }
}
.adm-order summary { grid-template-columns: 80px 150px minmax(0, 1fr) 140px 112px 116px 20px; }
.adm-order-sum { text-align: right; }
.adm-order summary > .status { justify-self: start; }
.adm-toolbar .btn--small { min-height: 44px; }
@media (max-width: 860px) {
  .adm-order summary { grid-template-columns: auto 1fr auto; }
  .adm-order-sum { text-align: left; }
}
.adm-status-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.adm-status-form .btn { grid-column: 1 / -1; justify-self: end; min-width: 140px; }
@media (min-width: 861px) and (max-width: 1100px) {
  .adm-order summary { grid-template-columns: 64px 128px minmax(0, 1fr) 124px 104px 106px 18px; gap: 8px 12px; padding-inline: 14px; }
}
.adm-upload { white-space: nowrap; padding-inline: 12px; }
.adm-note { font-size: var(--step--1); margin: 0; }
.adm-table .adm-actions { justify-content: flex-end; }
.adm-table input.adm-input { min-height: 42px; }

/* Админ панел на телефон */
.admin-page .tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.admin-page .tabs::-webkit-scrollbar { display: none; }
.admin-page .tabs button { flex: none; white-space: nowrap; }
@media (max-width: 860px) {
  .adm-order summary {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "num sum chev" "name name name" "date date date" "pills pills pills";
    gap: 4px 10px;
  }
  .adm-order-num { grid-area: num; }
  .adm-order summary > :nth-child(2) { grid-area: date; justify-self: start; color: var(--muted); font-size: 0.9rem; }
  .adm-order-name { grid-area: name; }
  .adm-order-sum { grid-area: sum; text-align: right; justify-self: end; }
  .adm-order-pills { grid-area: pills; margin-top: 6px; }
  .adm-order-chev { grid-area: chev; }
}
@media (max-width: 560px) {
  .adm-status-form { grid-template-columns: 1fr; }
  .adm-status-form .btn { justify-self: stretch; }
  .adm-filter, .adm-filter .sel-btn { width: 100%; min-width: 0; }
  .adm-toolbar > * { flex: 1 1 100%; }
  .adm-toolbar .btn--small { flex: 0 0 auto; }
  .admin-page .page-head { padding-bottom: 8px; }
}
.adm-order-pills { display: flex; flex-wrap: wrap; gap: 6px 8px; }
@media (min-width: 1101px) { .adm-order summary { grid-template-columns: 80px 150px minmax(0, 1fr) 140px 236px 20px; } }
@media (min-width: 861px) and (max-width: 1100px) { .adm-order summary { grid-template-columns: 64px 128px minmax(0, 1fr) 124px 216px 18px; } }
@media (max-width: 560px) {
  .admin-page .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-bottom: 0; overflow: visible; }
  .admin-page .tabs button {
    min-height: 44px; padding: 8px 10px; margin: 0;
    border: 1px solid var(--line-strong); border-radius: var(--radius-s);
    background: #fffdf8; font-size: 0.95rem;
  }
  .admin-page .tabs button[aria-selected="true"] { background: var(--olive); border-color: var(--olive); color: var(--paper); }
}

/* Списъци от карти: категории и администратори */
.adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm-list-title { font-size: 1.4rem; }
.adm-cat {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 4px 16px; align-items: end;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
}
.adm-cat .field { margin: 0; }
.adm-cat .adm-input { min-height: 44px; }
.adm-cat-id { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; color: var(--muted); font-size: var(--step--1); }
.adm-cat .adm-actions { grid-column: 3; grid-row: 1; }
.adm-person {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
}
.adm-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sage-soft); color: var(--olive-ink); font: 600 1.15rem var(--f-body);
}
.adm-person-main { min-width: 0; }
.adm-person-main strong { font-weight: 600; }
.adm-person-email { display: block; color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.adm-person-date { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
@media (max-width: 560px) {
  .adm-cat { grid-template-columns: minmax(0, 1fr) 96px; }
  .adm-cat-id { grid-row: auto; }
  .adm-cat .adm-actions { grid-column: 1 / -1; grid-row: auto; }
  .adm-cat .adm-actions .btn { flex: 1; }
  .adm-person { grid-template-columns: 40px minmax(0, 1fr); }
  .adm-avatar { width: 40px; height: 40px; }
  .adm-person-date { grid-column: 2; white-space: normal; }
  .adm-new-cat .adm-row > .field { flex: 1 1 100%; }
  .adm-new-cat .adm-row > .btn { width: 100%; }
}

/* Горно меню: без пречупване на думите. Надписите до иконите вдясно се скриват визуално
   (четецът на екрана ги чете) на по-тесни екрани, а при влязъл администратор — до 1360 px. */
.nav a { white-space: nowrap; }
@media (max-width: 1080px) {
  .header-actions .label-wide { display: inline; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 1360px) {
  .header-actions:has([data-admin-link]:not([hidden])) .label-wide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Данни за поръчка: секции с тънки разделители (admin + „Моите поръчки“) ---------- */
.order-details { display: grid; }
.od-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.od-title {
  margin: 0 0 10px;
  font: 600 0.74rem/1.2 var(--f-body); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
}
.od-list, .summary .od-list { margin: 0; display: grid; gap: 7px; grid-template-columns: none; }
.od-row { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.od-row dt { white-space: nowrap; }
.od-row dt, .summary .od-row dt { color: var(--muted); font-weight: 400; }
.od-row dd, .summary .od-row dd { margin: 0; text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.od-row dd a { font-weight: 500; }
.od-note { margin: 0; white-space: pre-line; }
.summary .order-details { margin: 4px 0 6px; }
.summary .order-details + .total dt, .summary .order-details + .total dd { border-top-color: var(--line-strong); }
.order-details { container-type: inline-size; }
@container (max-width: 360px) {
  .od-row { grid-template-columns: 1fr; gap: 1px; }
  .od-list { gap: 10px; }
}
/* Етикетите в секция се подравняват по най-дългия, стойността стои веднага след тях */
@container (min-width: 361px) {
  .od-list, .summary .od-list { grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; align-items: baseline; }
  .od-row { display: contents; }
}

.adm-order-side { gap: 0; }
.adm-order-side .order-details > .od-sec:first-child { border-top: 0; padding-top: 0; }
.od-sec .adm-status-form { border-top: 0; padding-top: 0; }
.adm-order-total { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 14px 0 0; font-weight: 600; }
.adm-order-total dd { margin: 0; }
.adm-order-danger { display: flex; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
/* Обобщение на поръчка: дългите стойности се пренасят вместо да излизат от кутията */
.summary dl { grid-template-columns: auto minmax(0, 1fr); }
.summary dd { overflow-wrap: anywhere; }
.summary dd .status { white-space: normal; text-align: center; }
/* „Моите поръчки“ → детайли: данните за доставка под продуктите, в две колони при достатъчно място */
.order-info { margin-top: 24px; container-type: inline-size; }
.order-info h2 { font-size: 1.6rem; margin-bottom: 6px; }
@container (min-width: 760px) {
  .order-info .order-details { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .order-info .od-sec:nth-child(-n+2) { border-top: 0; }
  .order-info .od-sec:nth-child(3) { grid-column: 1 / -1; }
}
.order-info .od-sec:first-child { border-top: 0; }
.summary .total { column-gap: 0; }
.summary .total dd { padding-left: 16px; }

/* ---------- Моите поръчки: сгъваеми карти ---------- */
.my-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.my-order {
  container: my-order / inline-size;
  border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.my-order:hover { border-color: var(--line-strong); }
.my-order[open] { box-shadow: 0 18px 36px -28px rgba(44, 59, 34, 0.45); }
.my-order summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 112px 20px;
  gap: 10px 20px; align-items: center;
  padding: 16px 20px; min-height: 64px;
  cursor: pointer; list-style: none; border-radius: inherit;
}
.my-order summary::-webkit-details-marker { display: none; }
.my-order summary:hover { background: rgba(71, 93, 51, 0.04); }
.my-order[open] summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-m) var(--radius-m) 0 0; }
.mo-id { display: grid; gap: 2px; min-width: 0; }
.mo-id strong { font-weight: 600; }
.mo-date { font-size: 0.88rem; color: var(--muted); }
.mo-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-sum { font-weight: 600; text-align: right; white-space: nowrap; }
.mo-chev { width: 20px; height: 20px; color: var(--muted); transition: transform 0.3s var(--ease); }
.my-order[open] .mo-chev { transform: rotate(180deg); }

.mo-body { padding: 18px 20px 20px; }
.mo-main, .mo-side { min-width: 0; }
.mo-main .od-title { margin-bottom: 4px; }
.mo-items { list-style: none; margin: 0; padding: 0; }
.mo-item {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mo-thumb { width: 52px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--ivory-2); }
.mo-thumb picture, .mo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mo-item-name { display: grid; gap: 2px; font-weight: 500; }
.mo-item-name .muted { font-weight: 400; font-size: 0.88rem; }
.mo-item-price { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.mo-item-price .muted { font-size: 0.85rem; }
.mo-total { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 14px 0 0; font-weight: 600; }
.mo-total dd { margin: 0; }
.mo-note { margin: 8px 0 0; font-size: var(--step--1); color: var(--muted); }
.mo-side { margin-top: 18px; display: grid; align-content: start; }
.mo-open { justify-self: start; margin-top: 16px; }
@container my-order (min-width: 720px) {
  .mo-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 36px; }
  .mo-side { margin-top: 0; }
  .mo-side .order-details > .od-sec:first-child { border-top: 0; padding-top: 0; }
}
@media (max-width: 640px) {
  .my-order summary {
    grid-template-columns: minmax(0, 1fr) auto 20px;
    grid-template-areas: "id sum chev" "pills pills pills";
    padding: 14px 16px; gap: 10px 12px;
  }
  .mo-id { grid-area: id; }
  .mo-sum { grid-area: sum; }
  .mo-chev { grid-area: chev; }
  .mo-pills { grid-area: pills; }
  .mo-body { padding: 14px 16px 18px; }
  .mo-item { grid-template-columns: 48px minmax(0, 1fr); gap: 4px 12px; }
  .mo-thumb { width: 48px; grid-row: span 2; }
  .mo-item-price { grid-column: 2; display: flex; justify-content: space-between; gap: 12px; }
  .mo-open { justify-self: stretch; }
}

/* ---------- Профил ---------- */
.account-nav [data-logout] { margin-left: auto; }
.acct-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px 18px; align-items: center;
  padding: 20px 24px; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
}
.acct-card[hidden] { display: none; }
.acct-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--olive); color: var(--paper);
  font: 600 1.3rem/1 var(--f-body);
}
.acct-who { display: grid; gap: 2px; min-width: 0; }
.acct-who strong { font-size: 1.12rem; font-weight: 600; overflow-wrap: anywhere; }
.acct-who .muted { font-size: 0.9rem; overflow-wrap: anywhere; }
.acct-stats { grid-column: 1 / -1; display: flex; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.acct-stats > div { flex: 1; display: grid; gap: 4px; }
.acct-stats > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.acct-stats dt { font: 600 0.72rem/1.2 var(--f-body); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.acct-stats dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct-form + .acct-form { margin-top: 20px; }
.acct-form { scroll-margin-top: calc(var(--header-h) + 16px); }
.acct-h2 { margin: 0 0 4px; font-size: 1.5rem; }
.acct-lead { margin: 0 0 18px; }
.acct-form .od-title { margin-top: 6px; }
.acct-sep { padding-top: 16px; border-top: 1px solid var(--line); }
.field input[readonly] { background: var(--ivory-2); color: var(--muted); cursor: default; }
@media (max-width: 640px) {
  .acct-card { grid-template-columns: 48px minmax(0, 1fr); padding: 16px; gap: 14px; }
  .acct-avatar { width: 48px; height: 48px; font-size: 1.15rem; }
  .acct-stats > div + div { padding-left: 14px; }
  .account-nav [data-logout] { margin-left: 0; }
}

/* ---------- Вход: забравена парола ---------- */
.auth-forgot { margin: -10px 0 10px; text-align: right; }
.auth-forgot .link-btn { font-size: 0.92rem; }
.auth-sub { margin: 0 0 6px; font-size: 1.5rem; }
.auth-back { margin: 10px 0 0; text-align: center; }

/* ---------- Галерия: няколко снимки на продукт ---------- */
/* Нагласена снимка (увеличение) не излиза извън рамката си */
.p-card-media, .qv-media, .thumb, .mo-thumb, .gal-slide { overflow: hidden; }
.gal { position: absolute; inset: 0; }
.gal-slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.gal-slide.is-active { opacity: 1; pointer-events: auto; }
.gal-slide picture, .gal-slide img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.gal-slide img { object-fit: cover; }
.gal-btn {
  position: absolute; top: 50%; z-index: 2;
  width: 44px; height: 44px; margin-top: -22px;
  display: grid; place-items: center;
  border: 1px solid rgba(44, 59, 34, 0.12); border-radius: 50%;
  background: rgba(251, 247, 238, 0.92); color: var(--olive-ink);
  box-shadow: 0 8px 20px -10px rgba(44, 59, 34, 0.5);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}
.gal-btn svg { width: 20px; height: 20px; }
.gal-btn:hover { background: var(--paper); transform: scale(1.06); }
.gal-btn--prev { left: 12px; }
.gal-btn--next { right: 12px; }
.gal-dots {
  position: absolute; left: 50%; bottom: 12px; z-index: 2; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px 9px; border-radius: 999px;
  background: rgba(44, 59, 34, 0.35);
}
.gal-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(251, 247, 238, 0.55); transition: background 0.2s, transform 0.2s; }
.gal-dots span.is-active { background: var(--paper); transform: scale(1.2); }
@media (hover: hover) and (pointer: fine) {
  .gal--many .gal-btn { opacity: 0.85; }
  .gal--many:hover .gal-btn, .gal-btn:focus-visible { opacity: 1; }
}
.gal-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gal-thumbs[hidden] { display: none; }
.gal-thumb {
  position: relative; width: 64px; aspect-ratio: 1.1; padding: 0;
  border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  background: var(--ivory-2); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.gal-thumb picture, .gal-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gal-thumb:hover { transform: translateY(-2px); }
.gal-thumb[aria-current="true"] { border-color: var(--olive); }
@media (max-width: 560px) {
  .gal-btn { width: 40px; height: 40px; margin-top: -20px; }
  .gal-btn--prev { left: 8px; }
  .gal-btn--next { right: 8px; }
  .gal-thumb { width: 56px; }
}

/* ---------- Админ: подредба със стрелки ---------- */
.adm-sort-hint { margin: 0 0 12px; font-size: 0.92rem; }
.adm-move { display: inline-flex; gap: 4px; }
.adm-move-btn, .adm-icon-btn {
  width: 40px; height: 40px; padding: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper); color: var(--olive-ink); cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.adm-move-btn svg, .adm-icon-btn svg { width: 18px; height: 18px; }
.adm-move-btn:hover:not(:disabled), .adm-icon-btn:hover:not(:disabled) { background: var(--sage-soft); border-color: var(--olive); }
.adm-move-btn:disabled, .adm-icon-btn:disabled { opacity: 0.35; cursor: default; }
.adm-icon-btn--danger { color: var(--danger); }
.adm-icon-btn--danger:hover:not(:disabled) { background: #f9e9e2; border-color: rgba(155, 44, 26, 0.45); }
.adm-pos {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ivory-2); color: var(--muted); font: 600 0.9rem/1 var(--f-body);
}

.adm-cat { grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: end; }
.adm-cat .adm-pos { align-self: end; margin-bottom: 6px; }
.adm-cat .adm-move { align-self: end; margin-bottom: 2px; }
.adm-cat .adm-actions { grid-column: 4; grid-row: 1; }
.adm-cat-id { grid-column: 2 / -1; }
@media (max-width: 560px) {
  .adm-cat { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .adm-cat .adm-actions { grid-column: 1 / -1; grid-row: auto; }
  .adm-cat-id { grid-column: 2 / -1; }
}

.adm-product-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) {
  .adm-product-actions { grid-column: 1 / -1; justify-content: space-between; }
  .adm-product .adm-product-actions .btn { grid-column: auto; flex: 1; }
}

.adm-variant-tools { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) {
  .adm-variant-tools { grid-column: 1 / -1; justify-content: space-between; }
  .adm-variant-tools .adm-variant-toggle { flex: 1; }
}

/* ---------- Админ: вариант — снимки и полета ---------- */
.adm-variant .adm-variant-body { grid-template-columns: minmax(0, 1fr); }
.adm-variant .adm-variant-actions { grid-column: 1 / -1; justify-content: flex-start; align-items: center; }
.adm-variant-actions [data-del-variant] { margin-left: auto; }
.adm-dirty { font-size: 0.9rem; color: #7f3c12; display: inline-flex; align-items: center; gap: 6px; }
.adm-dirty::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c0662b; }
.adm-dirty[hidden] { display: none; }
.adm-h3 { font: 600 0.78rem/1.2 var(--f-body); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin: 0; }
.adm-optional { font-weight: 400; color: var(--muted); font-size: 0.86rem; }
.adm-optional::before { content: "· "; }
.adm-photos { display: grid; gap: 10px; }
.adm-photos-head { display: grid; gap: 4px; }
.adm-photos-head .hint { margin: 0; font-size: var(--step--1); color: var(--muted); }
.adm-photo-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.adm-photo { display: grid; gap: 8px; align-content: start; }
.adm-photo-frame {
  position: relative; display: block; width: 100%; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--ivory-2); cursor: pointer;
}
.adm-variant .adm-photo-frame .thumb { display: block; aspect-ratio: 1.1; border-radius: 0; }
.adm-variant .adm-photo-frame .thumb picture, .adm-variant .adm-photo-frame .thumb img { display: block; width: 100%; height: 100%; }
.adm-photo-main {
  position: absolute; left: 8px; top: 8px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--olive); color: var(--paper); font-size: 0.75rem; font-weight: 600;
}
.adm-photo-chip {
  position: absolute; right: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(251, 247, 238, 0.94); color: var(--olive-ink);
  font-size: 0.8rem; font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(44, 59, 34, 0.5);
}
.adm-photo-chip svg { width: 14px; height: 14px; }
.adm-photo-frame:hover { border-color: var(--olive); }
.adm-photo-frame:hover .adm-photo-chip { background: var(--paper); }
.adm-photo-tools { display: flex; gap: 6px; }
.adm-photo-tools .adm-icon-btn--danger { margin-left: auto; }
.adm-photo-add {
  display: grid; place-items: center; align-content: center; gap: 4px;
  aspect-ratio: 1.1; padding: 12px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 12px;
  color: var(--olive-ink); cursor: pointer; font-weight: 600; font-size: 0.92rem;
  transition: background 0.2s, border-color 0.2s;
}
.adm-photo-add svg { width: 24px; height: 24px; }
.adm-photo-add small { font-weight: 400; color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.adm-photo-add:hover { background: rgba(71, 93, 51, 0.06); border-color: var(--olive); }
.adm-photo-add:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.adm-photos-status { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.92rem; }
.adm-photos-status[hidden] { display: none; }

.adm-variant .adm-variant-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 16px; border-top: 1px solid var(--line); }
.adm-variant-fields textarea { min-height: 90px; }
.adm-more { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin: 4px 0 12px; }
.adm-more summary { cursor: pointer; padding: 12px 0; font-weight: 500; }
.adm-more[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.adm-more > .hint { margin: 0 0 10px; font-size: var(--step--1); color: var(--muted); }
.adm-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 560px) {
  .adm-variant .adm-variant-fields { grid-template-columns: minmax(0, 1fr); }
  .adm-photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .adm-photo-tools .adm-icon-btn { width: 38px; height: 38px; }
  .adm-more-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-variant-actions .btn { flex: 1 1 auto; }
  .adm-variant-actions [data-del-variant] { margin-left: 0; }
  .adm-dirty { order: -1; flex-basis: 100%; }
}

/* ---------- Админ: прозорец „Нагласи снимката“ ---------- */
.adm-framer {
  width: min(920px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: var(--radius-m);
  background: var(--paper); color: var(--olive-ink);
  box-shadow: 0 30px 70px -30px rgba(20, 28, 14, 0.6);
}
.adm-framer[open] { animation: qv-in 0.3s var(--ease); }
.adm-framer::backdrop { background: rgba(28, 38, 22, 0.55); backdrop-filter: blur(3px); }
.adm-framer-inner { display: grid; gap: 14px; padding: 22px 24px 20px; }
.adm-framer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adm-framer-top .adm-h2 { margin: 0; }
.adm-framer-intro { margin: 0; padding: 10px 14px; border-radius: 10px; background: #e7efda; color: #2b4a1e; font-size: 0.94rem; }
.adm-framer-intro[hidden] { display: none; }
.adm-framer-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.adm-framer-preview { display: grid; gap: 8px; }
.adm-framer-preview .hint { margin: 0; font-size: var(--step--1); color: var(--muted); }
.adm-framer-stage {
  position: relative; aspect-ratio: 1.1; overflow: hidden;
  border-radius: var(--radius-m); background: var(--ivory-2);
  box-shadow: var(--shadow-box);
  cursor: grab; touch-action: none; user-select: none;
}
.adm-framer-stage.is-dragging { cursor: grabbing; }
.adm-framer-stage:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.adm-framer-stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* Помощни линии на третини (само докато се плъзга) */
.adm-framer-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.75) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.75) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: -1px -1px;
}
.adm-framer-stage.is-dragging .adm-framer-lines { opacity: 1; }
.adm-framer-ctrls { display: grid; gap: 16px; align-content: start; }
.adm-framer-ctrls .field { margin: 0; }
.adm-framer-ctrls > .btn { justify-self: start; }
.adm-seg { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.adm-seg legend { font-weight: 500; font-size: 0.95rem; margin-bottom: 8px; padding: 0; }
.adm-seg label {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.adm-seg label:has(input:checked) { border-color: var(--olive); background: rgba(71, 93, 51, 0.07); }
.adm-seg input { accent-color: var(--olive); width: 18px; height: 18px; margin: 0; }
.adm-zoom label { display: flex; justify-content: space-between; }
.adm-zoom output { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.adm-zoom input[type="range"] { width: 100%; accent-color: var(--olive); min-height: 32px; }
.adm-framer-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .adm-framer { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .adm-framer-inner { padding: 16px; min-height: 100%; grid-template-rows: auto auto 1fr auto; }
  .adm-framer-body { grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
  .adm-framer-actions .btn { flex: 1; }
}
.adm-seg[hidden] { display: none; }
.adm-seg--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adm-seg--row legend { grid-column: 1 / -1; }
.adm-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); flex: none; }
.adm-swatch--cream { background: var(--ivory-2); }
.adm-swatch--white { background: #fff; }
@media (max-width: 760px) {
  .adm-framer-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); box-shadow: 0 -10px 20px -16px rgba(44, 59, 34, 0.5); }
}
