/* ==========================================================================
   Vid Puza — оформлення магазину
   Світла тема, один брендовий акцент, решта — нейтралі.
   Розмітка й позиції елементів ті самі, що були; тут тільки стилі.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- брендовий зелений --- */
  --g-50:   #e9f3ec;
  --g-100:  #d7e9dc;
  --g-200:  #aed3b9;
  --g-500:  #1f6b34;   /* білий текст на ньому — 7.2:1 */
  --g-600:  #175628;
  --g-700:  #114520;

  /* --- ціна: 21px bold на білому — 3.2:1, норма для великого накреслення --- */
  --amber:      #c1610a;   /* на молочному тлі — 4.6:1 */
  --amber-dark: #a1500a;

  /* --- помилки й видалення --- */
  --red:    #dd4438;
  --red-50: #fdeeec;

  /* --- нейтралі: ледь холодні, щоб білий не здавався жовтим --- */
  --n-0:   #ffffff;
  --n-25:  #fdfcfa;
  --n-50:  #faf8f5;   /* тло сторінки — тепле молочне */
  --n-100: #f3f0ea;
  --n-150: #ece9e3;
  --n-200: #e3dfd7;
  --n-300: #cdc8bd;
  --n-400: #a8a49a;
  --n-500: #77736b;   /* дрібний текст — 4.9:1 */
  --n-700: #464339;
  --n-900: #16201a;

  /* сумісність зі старими іменами, якими користується розмітка */
  --green:      var(--g-500);
  --green-dark: var(--g-600);
  --green-soft: var(--g-100);
  --green-line: var(--g-200);
  --orange:     var(--amber);
  --ink:        var(--n-900);
  --ink-soft:   var(--n-700);
  --muted:      var(--n-500);
  --hairline:   var(--n-200);
  --panel:      var(--n-50);
  --page:       var(--n-50);
  --white:      var(--n-0);

  /* --- радіуси --- */
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   26px;
  --r-full: 999px;
  --radius-card: var(--r-lg);
  --radius-pill: var(--r-full);

  /* --- тіні: два шари, дуже слабкі — на світлому фоні цього досить --- */
  --sh-xs: 0 1px 2px rgba(18, 26, 20, .05);
  --sh-sm: 0 1px 2px rgba(18, 26, 20, .04), 0 2px 6px rgba(18, 26, 20, .05);
  --sh-md: 0 1px 2px rgba(18, 26, 20, .04), 0 10px 24px -8px rgba(18, 26, 20, .12);
  --sh-lg: 0 2px 4px rgba(18, 26, 20, .05), 0 20px 40px -14px rgba(18, 26, 20, .18);
  --shadow-card: var(--sh-sm);
  --shadow-bar:  0 -1px 0 var(--n-150), 0 -8px 24px -12px rgba(18, 26, 20, .14);

  --ring: 0 0 0 3px rgba(31, 107, 52, .2);

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 160ms;

  --shell:   480px;
  --nav-h:   66px;
  --gutter:  16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--n-900);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
input, select, textarea, button { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a, button, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--g-100); color: var(--n-900); }

:focus-visible {
  outline: 2px solid var(--g-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

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

.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ==========================================================================
   Каркас
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  position: relative;
}

@media (min-width: 520px) and (max-width: 767px) {
  body { background: var(--n-100); }
  .shell { box-shadow: var(--sh-md); }
}

/* ==========================================================================
   Шапка
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  max-width: var(--shell);
  margin-inline: auto;
  background: rgba(253, 252, 250, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: var(--sh-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 12px var(--gutter);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  border-radius: var(--r-md);
}

.header__logo { width: 54px; height: 44px; object-fit: contain; flex: none; }

.header__titles { min-width: 0; }
.header__name, .header__tagline { display: block; }

.header__name {
  font-size: 23px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -.02em;
  line-height: 1.08;
}

.header__tagline {
  font-size: 11px;
  color: var(--n-500);
  letter-spacing: 0;
}

.header__nav { display: none; }

.header__actions { display: flex; align-items: center; gap: 8px; flex: none; }

.header__search {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--n-50);
  color: var(--g-600);
  transition: background-color var(--dur) var(--ease);
}

.header__search:hover { background: var(--g-50); }
.header__search:active { background: var(--g-100); }

.header__cart { display: none; }

.header__field { display: none; }

.header__field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--n-400);
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}

.header__field input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 40px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: var(--n-50);
  font-size: 14px;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.header__field input::placeholder { color: var(--n-400); }
.header__field input:hover { background: var(--n-100); }

.header__field input:focus {
  background: var(--n-0);
  border-color: var(--g-500);
  box-shadow: var(--ring);
  outline: none;
}

.header__field:focus-within .icon { color: var(--g-600); }

/* ==========================================================================
   Пошук під шапкою (телефон і планшет)
   ========================================================================== */

.searchbar { padding: 12px var(--gutter) 0; }
.searchbar[hidden] { display: none; }

.searchbar input {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-full);
  background: var(--n-0);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.searchbar input::placeholder { color: var(--n-400); }

.searchbar input:focus {
  border-color: var(--g-500);
  box-shadow: var(--ring);
  outline: none;
}

/* ==========================================================================
   Категорії — сегментований перемикач
   ========================================================================== */

.tabs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin: 18px 0 0;
  padding: 2px var(--gutter) 4px;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid var(--n-150);
  border-radius: var(--r-full);
  background: var(--n-0);
  font-size: 14px;
  font-weight: 500;
  color: var(--n-700);
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.tab i {
  width: 7px; height: 7px;
  border-radius: var(--r-full);
  background: var(--n-300);
  transition: background-color var(--dur) var(--ease);
}

.tab:hover { border-color: var(--n-300); transform: translateY(-1px); }

.tab.is-active {
  background: var(--g-500);
  border-color: var(--g-500);
  color: var(--n-0);
  font-weight: 600;
}

.tab.is-active i { background: rgba(255, 255, 255, .75); }
.tab.is-active:hover { background: var(--g-600); border-color: var(--g-600); }

/* ==========================================================================
   Заголовок секції
   ========================================================================== */

.section-title {
  margin: 22px var(--gutter) 14px;
  font-size: clamp(19px, 5vw, 22px);
  font-weight: 700;
  letter-spacing: -.02em;
  text-wrap: balance;
}

/* ==========================================================================
   Сітка товарів
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 0 var(--gutter);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-color: var(--n-200);
    box-shadow: 0 16px 34px -16px rgba(20, 40, 26, .28);
  }
}

/* фото займає весь верх картки, без білих полів */
.card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / .82;
  background: linear-gradient(180deg, var(--n-0), var(--n-100));
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  transition: transform 300ms var(--ease);
}

@media (hover: hover) {
  .card:hover .card__media img { transform: scale(1.04); }
}

.card__body { padding: 13px 14px 15px; }

.card__name {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
  min-height: 2.6em;
  text-wrap: balance;
  color: var(--n-900);
}

.card__row { display: flex; align-items: end; gap: 10px; margin-top: 9px; }

.card__price {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.025em;
  color: var(--amber);
}

.card__unit { margin-top: 4px; font-size: 11.5px; color: var(--n-500); }

.card__add {
  margin-left: auto;
  flex: none;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--g-500);
  color: var(--n-0);
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.card__add:hover { background: var(--g-600); }
.card__add:active { transform: scale(.93); }
.card__add .icon { width: 20px; height: 20px; }

/* ==========================================================================
   Банер на головній
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 16px var(--gutter) 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(135deg, var(--g-600), #2c8b46 58%, #3aa055);
  color: var(--n-0);
  isolation: isolate;
}

/* На вузькому екрані фото — смуга під текстом: так воно нікуди не наїжджає
   і текст лишається читабельним. На широкому — виїжджає збоку. */
.hero__photo {
  order: 2;
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center 45%;
}

.hero__photo[hidden] { display: none; }

.hero__in { order: 1; position: relative; padding: 26px 20px 24px; max-width: 560px; }

.hero__eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: .85;
}

.hero h1 {
  margin-top: 10px;
  font-size: clamp(25px, 7vw, 42px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.hero p { margin-top: 10px; font-size: 14.5px; opacity: .92; max-width: 38ch; }

.hero .btn {
  margin-top: 20px;
  background: var(--n-0);
  color: var(--g-600);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5);
}

.hero .btn:hover { background: var(--n-25); color: var(--g-700); }

/* ==========================================================================
   Кнопки
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.btn .icon { width: 17px; height: 17px; }

.btn--green {
  background: var(--g-500);
  color: var(--n-0);
  box-shadow: var(--sh-xs);
}

.btn--green:hover { background: var(--g-600); box-shadow: var(--sh-sm); }
.btn--green:active { background: var(--g-700); transform: translateY(1px); box-shadow: none; }

.btn--outline {
  background: var(--n-0);
  border-color: var(--n-300);
  color: var(--n-900);
}

.btn--outline:hover { background: var(--n-50); border-color: var(--n-400); }
.btn--outline:active { background: var(--n-100); transform: translateY(1px); }

.btn--big {
  width: 100%;
  min-height: 54px;
  padding: 16px 20px;
  font-size: 16.5px;
}

.btn--big .icon { width: 20px; height: 20px; }

.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ==========================================================================
   Сторінка товару
   ========================================================================== */

.product { padding-bottom: 8px; }

.product__hero {
  position: relative;
  background: var(--n-0);
  padding: 16px var(--gutter) 24px;
  text-align: center;
}

.product__back {
  position: absolute;
  top: 14px;
  left: var(--gutter);
  z-index: 2;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--n-0);
  border: 1px solid var(--n-200);
  box-shadow: var(--sh-sm);
  color: var(--n-900);
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.product__back:hover { background: var(--g-50); color: var(--g-700); }
.product__back:active { transform: translateY(1px); }
.product__back .icon { width: 18px; height: 18px; }

.product__img {
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.product__name {
  margin-top: 14px;
  font-size: clamp(21px, 6vw, 25px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.product__price {
  margin-top: 10px;
  font-size: clamp(32px, 9vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--g-600);
}

.product__unit { margin-top: 6px; font-size: 14px; color: var(--n-500); }

/* --- таби: підкреслення замість заливки --- */

.product__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--n-0);
  border-bottom: 1px solid var(--n-150);
}

.product__tab {
  position: relative;
  padding: 15px 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--n-500);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.product__tab::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--g-500);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.product__tab:hover { color: var(--n-900); background: var(--n-25); }

.product__tab.is-active { color: var(--n-900); font-weight: 600; }
.product__tab.is-active::after { opacity: 1; }

.product__panel {
  background: var(--n-50);
  padding: 20px var(--gutter);
  color: var(--n-700);
}

.product__panel p + p { margin-top: 12px; }
.product__panel b { font-weight: 600; color: var(--n-900); }

.divider-dashed {
  border: 0;
  border-top: 1px solid var(--n-200);
  margin: 20px var(--gutter);
}

.picker { background: var(--n-50); padding: 0 var(--gutter) 20px; }

.picker__label {
  text-align: center;
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.chip {
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-full);
  background: var(--n-0);
  font-weight: 600;
  font-size: 14px;
  color: var(--n-700);
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.chip:hover { border-color: var(--n-400); }

.chip.is-active {
  background: var(--g-50);
  border-color: var(--g-500);
  color: var(--g-700);
  box-shadow: inset 0 0 0 1px var(--g-500);
}

.chip--sm { min-height: 36px; padding: 7px 14px; font-size: 12.5px; }

.product__cta { background: var(--n-50); padding: 4px var(--gutter) 18px; }

.added-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: center;
  background: var(--g-50);
  border-top: 1px solid var(--g-200);
  padding: 15px var(--gutter);
  font-size: 14px;
  font-weight: 500;
  color: var(--g-700);
}

.added-bar[hidden] { display: none; }
.added-bar a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.added-bar a:hover { color: var(--g-600); }

/* ==========================================================================
   Корзина
   ========================================================================== */

.cart-card {
  margin: 14px var(--gutter);
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.cart-card__title {
  padding: 18px var(--gutter);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  border-bottom: 1px solid var(--n-150);
}

.cart-line {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--n-150);
}

.cart-line:last-child { border-bottom: 0; }

.cart-line__media {
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 0;
  background: var(--n-25);
  border-radius: var(--r-md);
}

.cart-line__media img { max-height: 80px; object-fit: contain; }

.cart-line__body { min-width: 0; }
.cart-line__head { display: flex; align-items: start; gap: 10px; }

.cart-line__name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.cart-line__remove {
  width: 32px; height: 32px;
  margin: -6px -6px 0 0;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  color: var(--n-500);
  font-size: 21px;
  line-height: 1;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.cart-line__remove:hover { background: var(--red-50); color: var(--red); }

.cart-line__foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

/* --- лічильник як один згрупований контрол --- */

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-full);
  background: var(--n-0);
}

.stepper button {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  color: var(--g-600);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.stepper button:hover { background: var(--g-50); }
.stepper button:active { background: var(--g-100); }
.stepper .icon { width: 17px; height: 17px; }

.stepper span {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  text-align: center;
}

.cart-line__price { text-align: right; margin-left: auto; }
.cart-line__unit { font-size: 12px; color: var(--n-500); }

.cart-line__sum {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--g-600);
}

.cart-line__sum small { font-size: 13px; font-weight: 500; color: var(--n-500); }

.cart-empty { padding: 48px var(--gutter); text-align: center; color: var(--n-500); }

.totals { padding: 16px var(--gutter) 0; }

.totals__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  color: var(--n-500);
  padding: 6px 0;
}

.totals__row span:last-child {
  font-weight: 600;
  color: var(--n-900);
  font-variant-numeric: tabular-nums;
}

.totals__grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 0 0;
  border-top: 1px solid var(--n-150);
}

.totals__grand span:first-child { font-size: 17px; color: var(--n-500); }

.totals__grand span:last-child {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px var(--gutter);
}

.cart-actions .btn { padding: 13px 10px; font-size: 14.5px; }

/* ==========================================================================
   Оформлення замовлення
   ========================================================================== */

.form-card {
  margin: 14px var(--gutter);
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: 20px var(--gutter);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--n-700);
  margin-bottom: 7px;
}

.field select {
  width: 100%;
  padding: 13px 40px 13px 15px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  background-color: var(--n-0);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2377736b'%3E%3Cpath d='M12 15.4 3.6 7l1.6-1.6L12 12.2l6.8-6.8L20.4 7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field select:hover { border-color: var(--n-300); }

.field select:focus {
  border-color: var(--g-500);
  box-shadow: var(--ring);
  outline: none;
}

.field input, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  background: var(--n-0);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field input::placeholder, .field textarea::placeholder { color: var(--n-400); }
.field input:hover, .field textarea:hover { border-color: var(--n-300); }

.field input:focus, .field textarea:focus {
  border-color: var(--g-500);
  box-shadow: var(--ring);
  outline: none;
}

.field textarea { min-height: 104px; resize: vertical; }

.field--error input, .field--error textarea, .field--error select { border-color: var(--red); }
.field--error input:focus, .field--error textarea:focus, .field--error select:focus { box-shadow: 0 0 0 3px rgba(221, 68, 56, .18); }

.field__error { display: none; margin-top: 6px; font-size: 12.5px; color: var(--red); }
.field--error .field__error { display: block; }

/* ---------- власний дропдаун ---------- */

.select { position: relative; }

/* нативний список лишається у формі заради значення, але його не видно */
.select__native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.select__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 13px 15px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  background: var(--n-0);
  text-align: left;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.select__btn:hover { border-color: var(--n-300); }

.select__btn:focus-visible,
.select.is-open .select__btn {
  border-color: var(--g-500);
  box-shadow: var(--ring);
  outline: none;
}

.select__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__value.is-placeholder { color: var(--n-400); }

.select__arrow {
  width: 15px; height: 15px;
  flex: none;
  fill: var(--n-500);
  transition: transform var(--dur) var(--ease);
}

.select.is-open .select__arrow { transform: rotate(180deg); }

.select__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(320px, calc(100vw - 40px));
  max-height: 264px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  background: var(--n-0);
  box-shadow: var(--sh-lg);
}

.select__list--up { top: auto; bottom: calc(100% + 6px); }
.select__list[hidden] { display: none; }

.select__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--n-900);
  cursor: pointer;
}

.select__opt.is-placeholder { color: var(--n-400); }
.select__opt.is-active { background: var(--n-50); }

.select__opt.is-selected {
  background: var(--g-50);
  color: var(--g-700);
  font-weight: 600;
}

.select__opt.is-selected.is-active { background: var(--g-100); }

.select__opt.is-selected::after {
  content: "";
  width: 14px; height: 9px;
  margin-left: auto;
  flex: none;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(2px, -2px);
}

.field--error .select__btn { border-color: var(--red); }

.choice { border: 0; padding: 0; margin: 0 0 18px; }

.choice__legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--n-700);
}

.choice__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.choice__opt { position: relative; display: block; cursor: pointer; }

/* саму радіокнопку ховаємо, але лишаємо для клавіатури й скрінрідерів */
.choice__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 100%;
  padding: 14px 15px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  background: var(--n-0);
  transition: border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.choice__opt:hover .choice__box { border-color: var(--n-300); }

.choice__opt input:focus-visible + .choice__box {
  border-color: var(--g-500);
  box-shadow: var(--ring);
}

.choice__opt input:checked + .choice__box {
  border-color: var(--g-500);
  background: var(--g-50);
  box-shadow: inset 0 0 0 1px var(--g-500);
}

.choice__title { font-size: 15px; font-weight: 600; color: var(--n-900); }
.choice__note { font-size: 12px; color: var(--n-500); line-height: 1.35; }

.choice__opt input:checked + .choice__box .choice__title { color: var(--g-700); }

.choice.field--error .choice__box { border-color: var(--red); }

/* блок адреси показується лише для доставки */
.delivery {
  margin-bottom: 4px;
  padding: 16px 15px 2px;
  border: 1px dashed var(--n-200);
  border-radius: var(--r-md);
  background: var(--n-25);
}

.delivery[hidden] { display: none; }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

@media (max-width: 400px) {
  .choice__row { grid-template-columns: 1fr; }
  .cols2 { grid-template-columns: 1fr; }
}

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-status { margin-top: 12px; font-size: 14px; text-align: center; color: var(--n-500); }
.form-status.is-error { color: var(--red); }

.summary-mini {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--n-50);
  border-radius: var(--r-md);
  font-size: 14px;
}

.summary-mini__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--n-700);
}

.summary-mini__row span:last-child { font-variant-numeric: tabular-nums; }

.summary-mini__row--total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--n-200);
  font-weight: 700;
  font-size: 16px;
  color: var(--n-900);
}

.thanks { padding: 52px var(--gutter); text-align: center; }

.thanks__check {
  width: 68px; height: 68px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--g-50);
  color: var(--g-600);
  box-shadow: 0 0 0 8px var(--g-50);
}

.thanks__check .icon { width: 32px; height: 32px; }

.thanks h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}

.thanks p { color: var(--n-700); }
.thanks__id { margin-top: 12px; font-weight: 600; color: var(--n-900); }

/* ==========================================================================
   Текстові сторінки
   ========================================================================== */

.prose {
  margin: 14px var(--gutter);
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: 20px var(--gutter);
}

.prose h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.prose p { color: var(--n-700); }
.prose p + p { margin-top: 12px; }

/* ==========================================================================
   Нижня навігація (телефон)
   ========================================================================== */

.nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--n-0);
  box-shadow: var(--shadow-bar);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--n-500);
  position: relative;
  transition: color var(--dur) var(--ease);
}

.nav__item .icon {
  box-sizing: content-box;
  width: 21px; height: 21px;
  padding: 4px 15px;
  border-radius: var(--r-full);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav__item:hover { color: var(--n-900); }
.nav__item.is-active { color: var(--g-700); font-weight: 600; }
.nav__item.is-active .icon { background: var(--g-50); color: var(--g-600); }

.nav__badge {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(11px);
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--amber-dark);
  color: var(--n-0);
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--n-0);
}

.nav__badge[hidden] { display: none; }

/* ==========================================================================
   Тост
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px);
  transform: translate(-50%, 10px) scale(.98);
  z-index: 50;
  max-width: min(calc(100vw - 40px), 420px);
  padding: 12px 20px;
  border-radius: var(--r-full);
  background: var(--n-900);
  color: var(--n-0);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ==========================================================================
   Десктоп: меню зверху, корзина іконкою, контент на всю ширину
   ========================================================================== */

@media (min-width: 768px) {
  :root {
    --shell: 1200px;
    --gutter: 28px;
  }

  body { background: var(--page); }

  .shell {
    box-shadow: none;
    min-height: auto;
    padding-bottom: 64px;
  }

  .header {
    border-radius: 0;
    max-width: none;
    box-shadow: none;
    border-bottom: 1px solid var(--n-150);
  }

  .header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    padding: 14px var(--gutter);
  }

  .header__brand { flex: 0 0 auto; }

  .header__nav {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: clamp(14px, 2.2vw, 30px);
  }

  .header__nav a {
    position: relative;
    padding: 8px 2px;
    font-size: 15px;
    font-weight: 500;
    color: var(--n-700);
    white-space: nowrap;
    transition: color var(--dur) var(--ease);
  }

  .header__nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--g-500);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 200ms var(--ease);
  }

  .header__nav a:hover { color: var(--n-900); }
  .header__nav a:hover::after { transform: scaleX(.6); }

  .header__nav a.is-active { color: var(--g-700); font-weight: 600; }
  .header__nav a.is-active::after { transform: scaleX(1); }

  .header__actions { justify-self: end; gap: 12px; }

  .header__cart {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: var(--r-full);
    background: var(--n-50);
    color: var(--n-900);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }

  .header__cart:hover { background: var(--g-50); color: var(--g-700); }
  .header__cart .icon { width: 22px; height: 22px; }

  .header__cart .nav__badge {
    top: 0;
    left: auto;
    right: 0;
    transform: none;
  }

  .nav { display: none; }

  .searchbar { max-width: 420px; margin-left: auto; padding-top: 16px; }

  .tabs {
    width: max-content;
    max-width: calc(100% - var(--gutter) * 2);
    margin-top: 26px;
  }

  .section-title { font-size: 26px; margin-top: 26px; }

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

  .card__body { padding: 16px 17px 18px; }
  .card__name { font-size: 15.5px; }
  .card__price { font-size: 22px; }
  .card__add { width: 46px; height: 46px; }

  /* Права половина — окрема фотопанель. Так банер виглядає охайно
     з будь-яким фото: і з вирізаним товаром, і зі знімком цеху. */
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: stretch;
    margin: 22px 0 0;
  }

  .hero__photo {
    order: 1;
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    object-position: center 45%;
  }

  .hero__in { order: 0; align-self: center; padding: 50px 44px 46px; max-width: none; }
  .hero p { font-size: 15.5px; }

  .tabs { margin-top: 24px; padding-inline: 0; }

  /* --- картка товару: фото зліва, опис справа --- */

  .product { max-width: 980px; margin-inline: auto; }

  .product__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr min-content min-content min-content 1fr;
    grid-template-areas:
      "img ."
      "img name"
      "img price"
      "img unit"
      "img .";
    justify-items: start;
    column-gap: 48px;
    row-gap: 6px;
    text-align: left;
    margin-top: 26px;
    padding: 36px;
    border: 1px solid var(--n-150);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
  }

  .product__back { top: 18px; left: 18px; }

  .product__img { grid-area: img; align-self: center; max-width: 100%; margin: 0; }
  .product__name { grid-area: name; align-self: end; margin-top: 0; font-size: 30px; }
  .product__price { grid-area: price; font-size: 40px; margin-top: 14px; }
  .product__unit { grid-area: unit; align-self: start; font-size: 15px; }

  .product__details {
    margin-top: 20px;
    border: 1px solid var(--n-150);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-sm);
  }

  .product__tabs { border-radius: 0; }
  .product__panel { padding: 26px 32px; }
  .divider-dashed { margin-inline: 32px; }
  .picker { padding: 0 32px 24px; }
  .product__cta { display: flex; justify-content: center; padding: 4px 32px 22px; }
  .product__cta .btn { max-width: 420px; }

  /* --- корзина: список зліва, підсумки збоку --- */

  .cart-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "title title" "list totals";
    margin-top: 26px;
  }

  .cart-card__title { grid-area: title; font-size: 22px; padding: 22px 28px; }
  .cart-card > [data-cart-list] { grid-area: list; }

  .cart-card > [data-cart-totals] {
    grid-area: totals;
    border-left: 1px solid var(--n-150);
    align-self: stretch;
    background: var(--n-25);
  }

  .cart-line { grid-template-columns: 96px 1fr; padding: 20px 28px; }
  .cart-line__media img { max-height: 96px; }

  .totals { padding: 22px 24px 0; }
  .cart-actions { grid-template-columns: 1fr; padding: 20px 24px 26px; }

  /* --- решта --- */

  .form-card { max-width: 640px; margin: 26px auto; padding: 28px; }
  .prose { max-width: 800px; margin: 26px auto; padding: 28px; }
  .thanks { padding: 64px var(--gutter); }

  .toast { bottom: 28px; }
}

@media (min-width: 1000px) {
  .header__field {
    display: block;
    position: relative;
    width: clamp(190px, 19vw, 260px);
  }

  .header__search { display: none; }
  .searchbar { display: none !important; }
}

@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
}
