/* Магазинчик: витрина товаров. Базовые стили и палитра — из site.css. */

.page--shop { display: block; }

.shop {
  position: relative;
  overflow: hidden;
  overflow: clip; /* как hidden, но не ломает «прилипающие» блоки (кнопка заказа, колонка корзины) */
  min-height: 100vh;
  padding: 18px 16px 28px;
  background:
    radial-gradient(circle at 92% 6%, #ffe0d51f 0 60px, #0000 61px),
    radial-gradient(circle at -4% 60%, #3b583230 0 120px, #0000 121px),
    #91a66a;
}
.shop .flower--top { top: 74px; right: 14px; }

/* ---------- Шапка ---------- */
.shop-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  color: #34492e;
  background: #fff0d4;
  border: 2px solid #4f663f;
  border-radius: 999px;
  box-shadow: 0 3px #3c4e3099;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.pill-btn:active { transform: translateY(2px); box-shadow: 0 1px #3c4e3099; }
.pill-btn:focus-visible { outline: 3px solid #fff0d4; outline-offset: 3px; }
.pill-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- Заголовок ---------- */
.shop-intro {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 4px 20px;
}
.shop-intro__avatar { flex: none; width: 72px; height: 72px; border-width: 4px; box-shadow: 0 5px #36462b2e; }
.shop-intro .intro__eyebrow { margin: 0 0 4px; }
.shop-intro__title {
  margin: 0;
  color: #fff0d4;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  text-shadow: 0 3px #38492c3b, 1px 0 #4a5e3d, -1px 0 #4a5e3d, 0 1px #4a5e3d, 0 -1px #4a5e3d;
}
.shop-intro__text { margin-top: 7px; color: #f4e4c8; font-size: 12px; font-weight: 700; line-height: 1.45; }

/* ---------- Сетка товаров ---------- */
.products {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fffaf0;
  border: 2px solid #4f663f;
  border-radius: 20px;
  box-shadow: 0 5px #3c4e3099;
  transition: transform .18s, box-shadow .18s;
}

/* Галерея: свайп пальцем, на компьютере — стрелки и прокрутка тачпадом. */
.product__gallery { position: relative; border-bottom: 2px solid #4f663f; }
.product__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  aspect-ratio: 1;
  background: #eef0e2;
}
.product__track::-webkit-scrollbar { display: none; }
.product__track:focus-visible { outline: 3px solid #d7544c; outline-offset: -3px; }
.product__track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  user-select: none;
}

.product__dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: #1b211933;
  border-radius: 999px;
  transform: translateX(-50%);
  pointer-events: none;
}
.product__dots span { width: 6px; height: 6px; background: #fff9; border-radius: 999px; transition: width .2s, background .2s; }
.product__dots span.is-active { width: 14px; background: #fff; }

.product__nav {
  position: absolute;
  top: 50%;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 3px;
  font: inherit;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  color: #34492e;
  background: #fff0d4e6;
  border: 2px solid #4f663f;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .15s;
}
.product__nav--prev { left: 8px; }
.product__nav--next { right: 8px; }
.product__nav[hidden] { display: none !important; }

.product__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 10px 10px 10px 12px; }
.product__title {
  display: -webkit-box;
  min-height: 2.5em;
  overflow: hidden;
  color: #34492e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.product__price { color: #34492e; font-size: 17px; font-weight: 900; white-space: nowrap; }

.product__cart {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff0d4;
  background: #47613b;
  border: 2px solid #34492e;
  border-radius: 14px;
  box-shadow: 0 3px #34492e66;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s, color .2s;
}
.product__cart:active { transform: translateY(2px); box-shadow: 0 1px #34492e66; }
.product__cart:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }
.product__cart svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.product__cart-icon, .product__cart-done { grid-area: 1 / 1; display: grid; transition: opacity .2s, transform .2s; }
.product__cart-done { opacity: 0; transform: scale(.4); }
.product__cart.is-added { color: #47613b; background: #dcebd0; }
.product__cart.is-added .product__cart-icon { opacity: 0; transform: scale(.4); }
.product__cart.is-added .product__cart-done { opacity: 1; transform: none; }

.shop footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding-top: 28px;
  color: #f6e7cc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* Карточка открывается кликом по фото, названию или цене. */
.product { cursor: pointer; }
.product__title a { color: inherit; }
.product__title a:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; border-radius: 4px; }

/* ---------- Плавающая корзина ---------- */
.cart-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 64px;
  height: 64px;
  padding: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  color: #fff0d4;
  background: #47613b;
  border: 3px solid #fff0d4;
  border-radius: 999px;
  box-shadow: 0 6px #34492e, 0 14px 34px #0000006b;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}
.cart-fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.cart-fab__label { display: none; }
.cart-fab__count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  color: #fff;
  font-size: 13px;
  background: #d7544c;
  border: 2px solid #fff0d4;
  border-radius: 999px;
}
.cart-fab__count[hidden] { display: none; }
.cart-fab:active { transform: translateY(3px); box-shadow: 0 3px #34492e, 0 8px 20px #0000006b; }
.cart-fab:focus-visible { outline: 3px solid #d7544c; outline-offset: 4px; }
.cart-fab.is-bump { animation: bump .4s; }
@keyframes bump { 35% { transform: scale(1.14); } }

/* ---------- Поп-ап товара ---------- */
.pdialog {
  width: min(1040px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: #34492e;
  font-family: Nunito, sans-serif;
  background: #fffaf0;
  border: 3px solid #394b31;
  border-radius: 32px;
  box-shadow: 0 30px 90px #000a;
  overscroll-behavior: contain;
}
.pdialog::backdrop { background: #1b2119cc; backdrop-filter: blur(4px); }
.pdialog[open] { animation: pd-in .22s ease-out; }
@keyframes pd-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.pdialog__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fffaf0f0;
  backdrop-filter: blur(6px);
}
.pdialog__x {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  color: #34492e;
  background: transparent;
  border: 2px solid #4f663f55;
  border-radius: 50%;
  cursor: pointer;
}
.pdialog__x:hover { background: #34492e0f; }
.pdialog__x:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }

.pdialog__grid { display: grid; gap: 18px; padding: 0 16px 20px; }

.pdialog__info { display: flex; flex-direction: column; gap: 10px; }
.pdialog__title { font-size: 24px; font-weight: 900; line-height: 1.15; }
.pdialog__price { font-size: 26px; font-weight: 900; }
.pdialog__desc { color: #34492ed9; font-size: 15px; font-weight: 600; line-height: 1.55; white-space: pre-line; }
.pdialog__desc.is-empty { color: #34492e80; font-style: italic; }
.pdialog__actions {
  position: sticky;
  bottom: 0;
  margin: 6px -16px -20px;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(#fffaf000, #fffaf0 30%);
}
.pdialog__cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  color: #fff0d4;
  background: #47613b;
  border: 2px solid #34492e;
  border-radius: 18px;
  box-shadow: 0 4px #34492e66;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s, color .2s;
}
.pdialog__cart svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pdialog__cart:active { transform: translateY(2px); box-shadow: 0 2px #34492e66; }
.pdialog__cart:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }
.pdialog__cart.is-added { color: #34492e; background: #dcebd0; }

/* Галерея в поп-апе: свайп, стрелки, миниатюры, зум. */
.pgal { min-width: 0; }
.pgal__stage {
  position: relative;
  overflow: hidden;
  background: #1b2119;
  border: 2px solid #4f663f;
  border-radius: 22px;
}
.pgal__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  aspect-ratio: 4 / 5;
  max-height: 52dvh;
  width: 100%;
}
.pgal__track::-webkit-scrollbar { display: none; }
.pgal__track.is-zoomed { overflow: hidden; }
.pgal__slide {
  position: relative;
  flex: 0 0 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: zoom-in;
}
.pgal__slide.is-zoomed { touch-action: none; cursor: grab; }
.pgal__slide.is-panning { cursor: grabbing; }
.pgal__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.pgal__slide.is-animating img { transition: transform .25s ease; }

.pgal__nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  font: inherit;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: #34492e;
  background: #fff0d4e6;
  border: 2px solid #4f663f;
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
}
.pgal__nav--prev { left: 12px; }
.pgal__nav--next { right: 12px; }
.pgal__nav[hidden] { display: none; }
.pgal__nav:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }

.pgal__counter, .pgal__hint {
  position: absolute;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: #1b2119a6;
  border-radius: 999px;
  pointer-events: none;
}
.pgal__counter { top: 12px; left: 12px; }
.pgal__hint { bottom: 12px; left: 50%; white-space: nowrap; transform: translateX(-50%); transition: opacity .3s; }
.pgal__hint.is-hidden { opacity: 0; }

.pgal__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.pgal__thumbs button {
  flex: none;
  width: 58px;
  height: 76px;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  opacity: .6;
  cursor: pointer;
  transition: opacity .15s, border-color .15s;
}
.pgal__thumbs button.is-active { border-color: #34492e; opacity: 1; }
.pgal__thumbs button:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }
.pgal__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Телефон: поп-ап на весь экран. */
@media (max-width: 699px) {
  .pdialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .pdialog[open] { animation: pd-up .25s ease-out; }
  @keyframes pd-up { from { transform: translateY(24px); opacity: 0; } }
  .pgal__track { max-height: none; }
  .pgal__nav { display: none; }
  .pgal__thumbs { display: none; }
}

/* Планшет и компьютер: галерея слева, описание справа. */
@media (min-width: 700px) {
  .pdialog__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 0 24px 24px; }
  .pdialog__bar { padding: 16px 24px; }
  .pdialog__info { position: sticky; top: 76px; padding-top: 4px; }
  .pdialog__title { font-size: 30px; }
  .pdialog__price { font-size: 30px; }
  .pdialog__actions { position: static; margin: 8px 0 0; padding: 0; background: none; }
  .pgal__track { aspect-ratio: auto; height: min(56dvh, 500px); max-height: none; }
  .cart-fab { right: 28px; bottom: 28px; width: auto; height: 64px; padding: 0 24px 0 20px; }
  .cart-fab__label { display: inline; }
}

@media (hover: hover) and (pointer: fine) {
  .cart-fab:hover { transform: translateY(-2px); box-shadow: 0 8px #34492e, 0 18px 40px #0000006b; }
  .pdialog__cart:hover { transform: translateY(-1px); }
}

.shop-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  padding: 10px 16px;
  color: #fff0d4;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 800;
  background: #1b2119f2;
  border: 2px solid #fff0d444;
  border-radius: 14px;
  box-shadow: 0 12px 40px #0008;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s, transform .2s;
}
.shop-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* На устройствах с мышью: стрелки при наведении, карточка приподнимается. */
@media (hover: hover) and (pointer: fine) {
  .product__nav { display: grid; }
  .product__gallery:hover .product__nav, .product__nav:focus-visible { opacity: 1; }
  .product:hover { transform: translateY(-3px); box-shadow: 0 8px #3c4e3099; }
  .pill-btn:hover { transform: translateY(-1px); box-shadow: 0 4px #3c4e3099; }
}

/* Узкие телефоны: одна колонка не нужна до 330px. */
@media (max-width: 340px) {
  .products { grid-template-columns: 1fr; }
}

/* ---------- Планшет и десктоп: карточка-рамка, как на главной ---------- */
@media (min-width: 640px) {
  .page--shop { padding: 32px 24px; }
  .shop {
    width: min(1200px, 100%);
    min-height: 0;
    margin: 0 auto;
    padding: 28px 28px 32px;
    border: 3px solid #394b31;
    border-radius: 36px;
    box-shadow: 0 24px 80px #00000061;
  }
  .shop .flower--top { top: 96px; right: 30px; width: 40px; height: 40px; }
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .shop-intro { margin: 28px 4px 26px; gap: 20px; }
  .shop-intro__avatar { width: 88px; height: 88px; }
  .shop-intro__title { font-size: 44px; }
  .shop-intro__text { font-size: 14px; }
  .product__body { padding: 12px 12px 12px 14px; }
  .product__title { font-size: 15px; }
  .product__price { font-size: 19px; }
}

@media (min-width: 1000px) {
  .page--shop { padding: 48px 32px; }
  .shop { padding: 36px 44px 40px; border-radius: 44px; }
  .shop .flower--top { top: 110px; right: 52px; width: 46px; height: 46px; }
  .products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .shop-intro { margin: 32px 4px 32px; }
  .shop-intro__avatar { width: 100px; height: 100px; border-width: 5px; }
  .shop-intro__title { font-size: 54px; }
  .shop-intro__text { max-width: 460px; font-size: 15px; }
}

@media (max-width: 699px) {
  .shop-toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Чтобы плавающая корзина не закрывала последние карточки. */
.shop { padding-bottom: 104px; }
@media (min-width: 640px) { .page--shop { padding-bottom: 110px; } .shop { padding-bottom: 32px; } }

/* ---------- Корзина (страница /order/) ---------- */
.cart__empty { flex: 1; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 30px; text-align: center; font-weight: 700; color: #34492ebf; }
.cart__empty strong { color: #34492e; font-size: 18px; font-weight: 900; }
.cart__empty-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
  color: #47613b;
  background: #dcebd0;
  border-radius: 50%;
}
.cart__empty-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cart__empty .pill-btn { margin-top: 10px; }

.cart__list { display: grid; gap: 10px; margin: 8px 0 18px; list-style: none; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 2px solid #4f663f40;
  border-radius: 16px;
}
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 11px; }
.cart-item__title { font-size: 14px; font-weight: 800; line-height: 1.25; }
.cart-item__price { margin-top: 3px; font-size: 16px; font-weight: 900; }
.cart-item__remove {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #b94a48;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.cart-item__remove:hover { background: #b94a4814; }
.cart-item__remove:focus-visible { outline: 3px solid #d7544c; outline-offset: 1px; }
.cart-item__remove svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cart__label { margin: 0 0 6px 4px; font-size: 12px; font-weight: 800; color: #34492ebf; }
.cart__method { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 16px; padding: 4px; background: #34492e0f; border-radius: 16px; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: background .15s, border-color .15s;
}
.seg input:checked + span { color: #fff0d4; background: #47613b; border-color: #34492e; box-shadow: 0 2px #34492e55; }
.seg input:focus-visible + span { outline: 3px solid #d7544c; outline-offset: 2px; }

.cart__sum { display: grid; gap: 8px; margin: 0; padding: 14px 16px; background: #fff; border: 2px solid #4f663f40; border-radius: 16px; }
.cart__sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cart__sum dt { font-size: 14px; font-weight: 700; }
.cart__sum dd { margin: 0; font-size: 15px; font-weight: 800; text-align: right; }
.cart__muted { color: #34492e99; font-weight: 700 !important; }
.cart__sum div[hidden] { display: none; }
.cart__total { padding-top: 10px; border-top: 2px dashed #4f663f33; }
.cart__total dt { font-size: 17px !important; font-weight: 900 !important; }
.cart__total dd { font-size: 22px !important; font-weight: 900 !important; }

.cart__order { text-decoration: none; }
.cart__order svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.cart__hint { margin-top: 10px; color: #34492ebf; font-size: 12px; font-weight: 700; text-align: center; }
.cart__warn {
  margin-top: 10px;
  padding: 10px 12px;
  color: #6b4a1f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  background: #f4e8b8;
  border: 1px solid #d9c27a;
  border-radius: 12px;
}
.cart__warn a { color: #34492e; font-weight: 900; text-decoration: underline; }


/* ---------- Поп-ап: «В корзину» сжимается до галочки, рядом выезжает «Перейти в корзину» ---------- */
.pdialog__buttons { display: flex; align-items: stretch; }
.pdialog__buttons .pdialog__cart {
  position: relative;
  flex: 1 1 100%;
  min-width: 56px;
  overflow: hidden;
  transition: flex-basis .35s cubic-bezier(.3, .7, .2, 1), background .25s, color .25s, transform .15s, box-shadow .15s;
}
.pdialog__cart-icon, .pdialog__cart-done { display: grid; transition: opacity .2s, transform .25s; }
.pdialog__cart-done { position: absolute; left: 50%; top: 50%; opacity: 0; transform: translate(-50%, -50%) scale(.4); }
.pdialog__cart-label { white-space: nowrap; transition: opacity .15s; }

.pdialog__go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 1 0;
  max-width: 0;
  min-height: 54px;
  margin-left: 0;
  padding: 0;
  overflow: hidden;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  color: #34492e;
  background: #fff0d4;
  border: 0 solid #34492e;
  border-radius: 18px;
  box-shadow: 0 4px #34492e66;
  opacity: 0;
  cursor: pointer;
  transition: flex .35s cubic-bezier(.3, .7, .2, 1), max-width .35s cubic-bezier(.3, .7, .2, 1), margin .35s, padding .35s, opacity .25s .1s, transform .15s;
}
.pdialog__go:active { transform: translateY(2px); }
.pdialog__go:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }

.pdialog__buttons.is-added .pdialog__cart { flex: 0 0 64px; padding: 0; }
.pdialog__buttons.is-added .pdialog__cart-label,
.pdialog__buttons.is-added .pdialog__cart-icon { opacity: 0; position: absolute; }
.pdialog__buttons.is-added .pdialog__cart-done { opacity: 1; transform: translate(-50%, -50%); }
.pdialog__buttons.is-added .pdialog__go { flex: 1 1 auto; max-width: 100%; margin-left: 10px; padding: 0 18px; border-width: 2px; opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .pdialog__go:hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  .pdialog__buttons .pdialog__cart, .pdialog__go { transition: none; }
}

/* ---------- Корзина: город и служба доставки ---------- */
.cart__delivery { margin: -4px 0 16px; padding: 14px 14px 4px; background: #fff; border: 2px solid #4f663f40; border-radius: 16px; }
.cart__delivery[hidden] { display: none; }
.cart__delivery .cart__method { margin-bottom: 10px; }
.cart__field { display: grid; gap: 6px; margin-bottom: 12px; }
.cart__field .cart__label { margin: 0 0 0 4px; }
.cart__field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: inherit;
  font-size: 16px; /* 16px — чтобы iPhone не увеличивал страницу при вводе */
  font-weight: 700;
  color: #34492e;
  background: #fffaf0;
  border: 2px solid #4f663f55;
  border-radius: 12px;
}
.cart__field input:focus { border-color: #34492e; outline: none; box-shadow: 0 0 0 3px #91a66a55; }
.cart__field input.is-invalid { border-color: #b94a48; box-shadow: 0 0 0 3px #b94a4826; }
.cart__error { margin-left: 4px; color: #b94a48; font-size: 12px; font-weight: 800; }
.cart__error[hidden] { display: none; }
.cart__delivery .cart__method { background: #34492e17; }

/* ---------- Страница корзины ---------- */
.order { color: #34492e; }
.order__intro { margin-bottom: 18px; }
.order__qty { color: #fff0d4a6; }
.order__empty {
  position: relative;
  z-index: 1;
  padding: 40px 20px;
  background: #fffaf0;
  border: 2px solid #4f663f;
  border-radius: 24px;
  box-shadow: 0 5px #3c4e3099;
}
.order__empty[hidden], .order__grid[hidden] { display: none; }

.order__grid { position: relative; z-index: 1; display: grid; gap: 14px; }
.order__main, .order__side {
  padding: 14px;
  background: #fffaf0;
  border: 2px solid #4f663f;
  border-radius: 24px;
  box-shadow: 0 5px #3c4e3099;
}
.order__main .cart__list { margin: 0; }
.order__side .cart__sum { margin-bottom: 14px; }
.order__submit .cart__hint { margin-bottom: 0; }

.cart-item__link { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; min-width: 0; color: inherit; border-radius: 12px; }
.cart-item__link img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.cart-item__link:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .cart-item__link:hover .cart-item__title { text-decoration: underline; }
}

.order__noscript { margin: 20px; color: #fff0d4; font-family: Nunito, sans-serif; font-weight: 800; text-align: center; }

/* Телефон: кнопка «Оформить заказ» всегда под рукой внизу экрана. */
@media (max-width: 699px) {
  .order { padding-bottom: 28px; }
  .order__submit {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -14px;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(#fffaf000, #fffaf0 22%);
  }
}

/* Компьютер: список слева, оформление справа и не уезжает при прокрутке. */
@media (min-width: 900px) {
  .order__grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); align-items: start; gap: 20px; }
  .order__main, .order__side { padding: 18px; }
  .order__side { position: sticky; top: 24px; }
  .order .cart__empty { max-width: 560px; margin: 0 auto; }
}

/* ---------- Скидки, остатки, «нет в наличии» ---------- */
.product__price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.product__old, .pdialog__old { color: #34492e80; font-size: .72em; font-weight: 800; }
.pdialog__old:empty { display: none; }
.product__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: #d7544c;
  border: 2px solid #fff0d4;
  border-radius: 999px;
  pointer-events: none;
}
.product__badge--out { color: #34492e; background: #fff0d4; border-color: #4f663f; }
.product.is-soldout .product__track img { filter: grayscale(.85) opacity(.65); }
.product.is-soldout .product__title, .product.is-soldout .product__price { opacity: .55; }
.product__cart:disabled { cursor: not-allowed; opacity: .35; box-shadow: none; }
.pdialog__cart:disabled { cursor: not-allowed; color: #34492e99; background: #e9e4d6; border-color: #34492e40; box-shadow: none; }
.pdialog__stock { margin-top: -4px; color: #47613b; font-size: 14px; font-weight: 800; }
.pdialog__stock.is-out { color: #b94a48; }

.shop-closed {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 36px 20px;
  color: #34492ebf;
  font-weight: 700;
  text-align: center;
  background: #fffaf0;
  border: 2px solid #4f663f;
  border-radius: 24px;
  box-shadow: 0 5px #3c4e3099;
}
.shop-closed strong { color: #34492e; font-size: 20px; font-weight: 900; }
.shop-closed .pill-btn { margin-top: 10px; }

/* ---------- Корзина: количество и варианты способов ---------- */
.cart-item__side { display: flex; align-items: center; gap: 4px; }
.cart-item__each { color: #34492e99; font-size: 12px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; background: #34492e0f; border-radius: 12px; }
.qty__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  color: #34492e;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.qty__btn:hover:not(:disabled) { background: #34492e14; }
.qty__btn:disabled { opacity: .3; cursor: default; }
.qty__btn:focus-visible { outline: 3px solid #d7544c; outline-offset: 1px; }
.qty__val { min-width: 22px; font-size: 15px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.cart__method--single { grid-template-columns: 1fr; }
.cart__method--wrap { grid-template-columns: 1fr 1fr; }
/* Нечётное число служб: последняя — на всю ширину, без пустого места. */
.cart__method--wrap > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.pdialog__desc[hidden] { display: none; }

/* ---------- Полноэкранный просмотр фото ---------- */
.lb {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
  font-family: Nunito, sans-serif;
  background: #0d110cf2;
  border: 0;
}
.lb::backdrop { background: #000c; }
.lb[open] { animation: lb-in .18s ease-out; }
@keyframes lb-in { from { opacity: 0; } }
.lb__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.lb__track::-webkit-scrollbar { display: none; }
.lb__track.is-zoomed { overflow: hidden; }
.lb__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  touch-action: pan-x;
  cursor: zoom-in;
}
.lb__slide.is-zoomed { touch-action: none; cursor: grab; }
.lb__slide.is-panning { cursor: grabbing; }
.lb__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
}
.lb__slide.is-animating img { transition: transform .22s ease; }

.lb__bar {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px 18px;
  background: linear-gradient(#000a, #0000);
  pointer-events: none;
}
.lb__counter { font-size: 14px; font-weight: 800; }
.lb__close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0 0 4px;
  font: inherit;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  background: #ffffff1f;
  border: 2px solid #ffffff4d;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
}
.lb__close:hover { background: #ffffff33; }
.lb__nav {
  position: absolute;
  top: 50%;
  display: none;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0 0 5px;
  font: inherit;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: #ffffff1f;
  border: 2px solid #ffffff4d;
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
}
.lb__nav--prev { left: 18px; }
.lb__nav--next { right: 18px; }
.lb__nav[hidden] { display: none !important; }
.lb__close:focus-visible, .lb__nav:focus-visible { outline: 3px solid #fff0d4; outline-offset: 2px; }
.lb__hint {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  background: #0009;
  border-radius: 999px;
  transform: translateX(-50%);
  transition: opacity .3s;
  pointer-events: none;
}
.lb__hint.is-hidden { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .lb__nav { display: grid; }
  .lb__nav:hover { background: #ffffff33; }
}

/* ---------- Корзина: строка товара (фото, под ним количество; справа название и цена) ---------- */
.order .cart__list { gap: 12px; }
.order .cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 12px;
  background: #fff;
  border: 2px solid #4f663f33;
  border-radius: 20px;
}
.cart-item__media { display: grid; gap: 8px; }
.cart-item__img { display: block; overflow: hidden; aspect-ratio: 1; border-radius: 14px; background: #eef0e2; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__info { display: grid; gap: 6px; min-width: 0; padding-top: 2px; }
.cart-item__info .cart-item__title {
  color: #34492e;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.cart-item__info .cart-item__title:focus-visible { outline: 3px solid #d7544c; outline-offset: 2px; border-radius: 4px; }
.cart-item__info .cart-item__price { margin: 0; font-size: 19px; font-weight: 900; }
.cart-item__old { color: #34492e80; font-size: 13px; font-weight: 800; }
.cart-item__info .cart-item__each { color: #34492e99; font-size: 13px; font-weight: 700; }
.order .cart-item__remove { margin: -4px -4px 0 0; }

/* Счётчик под фото во всю ширину фото */
.cart-item__media .qty {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  height: 36px;
  background: #f3efe3;
  border: 2px solid #4f663f40;
  border-radius: 12px;
}
.cart-item__media .qty__btn { width: 100%; height: 32px; border-radius: 9px; font-size: 20px; }
.cart-item__media .qty__btn.is-limit { opacity: .3; }
.cart-item__media .qty__val { min-width: 0; font-size: 13px; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .cart-item__info .cart-item__title:hover { text-decoration: underline; }
}

@media (max-width: 420px) {
  .order .cart-item { grid-template-columns: 100px minmax(0, 1fr) auto; gap: 12px; padding: 10px; }
  .cart-item__info .cart-item__title { font-size: 15px; }
  .cart-item__info .cart-item__price { font-size: 18px; }
}

/* Выключенная доставка: пояснение вместо города и служб, кнопка заказа неактивна. */
.cart__delivery-off {
  margin: -4px 0 16px;
  padding: 14px 16px;
  color: #6b4a1f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  background: #f4e8b8;
  border: 1px solid #d9c27a;
  border-radius: 16px;
}
.cart__delivery-off[hidden] { display: none; }
.cart__order.is-disabled {
  color: #34492e8c;
  background: #e4e0d3;
  border-color: #34492e33;
  box-shadow: none;
  cursor: not-allowed;
}
.cart__order.is-disabled svg { opacity: .5; }

/* Подсказка не сжимается в узкий столбик у края экрана */
.shop-toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
