:root {
  --cream: #f4eee4;
  --paper: #fbf7f0;
  --ink: #2c261f;
  --ink-soft: #5d5348;
  --kraft: #8a5534;
  --kraft-dark: #6a3f26;
  --honey: #c4a056;
  --sage: #74856c;
  --lavender: #867794;
  --rose: #c3a49f;
  --line: #e2d5c4;
  --shadow: 0 18px 50px rgba(44, 38, 31, 0.12);
  --radius: 18px;
  --header-h: 88px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Manrope, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 160, 86, 0.16), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(134, 119, 148, 0.12), transparent 50%),
    var(--cream);
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  backdrop-filter: blur(16px);
  background: rgba(251, 247, 240, 0.82);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner,
.footer-inner,
.section-inner,
.hero-copy {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wordmark-mark {
  width: auto;
  height: 64px;
  object-fit: contain;
  display: block;
  flex: none;
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--kraft);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--kraft);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
}

.app {
  min-height: calc(100vh - var(--header-h) - 180px);
}

.loading,
.error-box {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-soft);
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-photo {
  position: absolute;
  inset: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(44, 38, 31, 0.12) 0%, rgba(44, 38, 31, 0.18) 40%, rgba(36, 30, 24, 0.78) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 0 0 72px;
  color: var(--paper);
}

.eyebrow {
  display: inline-block;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.86;
}

.hero h1 {
  margin: 12px 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 600;
  line-height: 0.9;
}

.hero .lead,
.hero .sub {
  max-width: 560px;
  font-size: 18px;
  color: rgba(251, 247, 240, 0.9);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--kraft);
  color: var(--paper);
}

.btn-primary:hover:not(:disabled) {
  background: var(--kraft-dark);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

.section {
  padding: 84px 0;
}

.section h2,
.product-head h1 {
  margin: 8px 0 18px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.05;
}

.section-kicker {
  color: var(--kraft);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.benefit {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.benefit h3 {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
}

.benefit p,
.muted {
  margin: 0;
  color: var(--ink-soft);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.catalog-hint {
  margin: 0 0 28px;
}

.product-card {
  display: grid;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 10px 10px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 24px 54px rgba(44, 38, 31, 0.16);
}

.product-card figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #d9cbb8;
  aspect-ratio: 4 / 5;
}

.product-card .photo-a,
.product-card .photo-b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease, transform 0.6s ease;
}

.product-card .photo-a {
  object-position: var(--focus, center 18%);
}

.product-card .photo-b {
  object-position: var(--hover-focus, center 42%);
  opacity: 0;
}

.product-card:hover .photo-a,
.product-card:focus-visible .photo-a {
  transform: scale(1.04);
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover .photo-b,
  .product-card:focus-visible .photo-b {
    opacity: 1;
  }

  .product-card:hover .card-inset,
  .product-card:focus-visible .card-inset {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card .photo-a,
  .product-card .photo-b {
    transition: none;
  }
}

.card-count,
.card-photos {
  position: absolute;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 247, 240, 0.9);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-count {
  top: 12px;
  left: 12px;
}

.card-photos {
  bottom: 12px;
  left: 12px;
}

.card-inset {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 27%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid rgba(251, 247, 240, 0.94);
  box-shadow: 0 10px 24px rgba(44, 38, 31, 0.22);
  background: #d9cbb8;
  transition: opacity 0.35s ease;
}

.card-inset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hover-focus, center 42%);
}

.card-body {
  padding: 16px 10px 4px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
}

.product-card h3 {
  margin: 6px 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  line-height: 1.1;
}

.card-price {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--kraft);
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 4px;
  position: relative;
  z-index: 1;
}

.product-card .muted {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cta {
  display: inline-block;
  margin-top: 12px;
  color: var(--kraft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}

.split img,
.postcard img,
.production img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.pack-points,
.contents,
.benefits-list {
  padding-left: 18px;
}

.pack-gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.pack-gallery img:first-child {
  grid-row: span 2;
  height: 100%;
  object-fit: cover;
}

.order-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: start;
}

/* Order page: stack instruction + form vertically for usability */
#order .order-layout {
  grid-template-columns: 1fr;
  gap: 18px;
}

.order-card,
.product-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.add-to-cart-row {
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(60, 47, 37, 0.92);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.order-section-title {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
}

.order-section-title strong {
  font-size: 15px;
}

.cart-box {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdfa;
}

.cart-box--empty {
  background: #fbf7f0;
}

.cart-head,
.cart-total,
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-head {
  margin-bottom: 12px;
}

.cart-title,
.cart-item-name {
  margin: 0;
  font-weight: 700;
}

.cart-item-meta {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-item {
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.cart-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.qty-btn,
.cart-clear,
.cart-remove {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--kraft);
  font-size: 20px;
  line-height: 1;
}

.qty-btn:hover,
.cart-clear:hover,
.cart-remove:hover {
  color: var(--kraft);
}

.qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.cart-clear,
.cart-remove {
  color: var(--ink-soft);
  font-size: 13px;
}

.cart-total {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--sage);
}

.form-status.is-error {
  color: #9a3b32;
}

.delivery-fieldset {
  margin: 8px 0 18px;
  padding: 0;
  border: 0;
}

.delivery-fieldset legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.delivery-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.delivery-option:has(input:checked) {
  border-color: var(--kraft);
  background: #faf6ef;
}

.delivery-option--primary:has(input:checked) {
  border-color: var(--kraft);
  box-shadow: 0 0 0 1px rgba(139, 107, 72, 0.15);
}

.delivery-option--secondary {
  margin-top: 4px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.72);
}

.delivery-option--secondary:has(input:checked) {
  border-style: solid;
  background: #faf6ef;
}

.delivery-option input {
  margin-top: 4px;
  width: auto;
}

.delivery-option-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
}

.delivery-pickup-hint {
  display: none;
  margin: 8px 0 0;
  font-size: 13px;
}

.delivery-fieldset:has(input[name="deliveryMethod"][value="pickup_contact"]:checked) .delivery-pickup-hint,
.order-card[data-delivery-method="pickup_contact"] .delivery-pickup-hint {
  display: block;
}

.delivery-pvz-block {
  display: block;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-top: 0;
  border-bottom: 1px dashed var(--line);
}

.delivery-fieldset:has(input[name="deliveryMethod"][value="pickup_contact"]:checked) .delivery-pvz-block,
.order-card[data-delivery-method="pickup_contact"] .delivery-pvz-block {
  display: none;
}

.delivery-map-note {
  margin: 0 0 10px;
  font-size: 13px;
}

.yandex-pvz-widget {
  min-height: 660px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8e2d8;
}

/* Hide redundant Yandex widget chrome; keep address search with suggest. */
.yandex-pvz-widget .widget__address-header {
  display: none !important;
}

.yandex-pvz-widget .widget__address-card {
  width: min(100%, 440px);
}

.yandex-pvz-widget .widget__address-body {
  padding-top: 12px;
}

.yandex-pvz-widget.is-loading::before {
  content: "Загружаем карту Яндекс…";
  display: grid;
  place-items: center;
  min-height: 660px;
  color: var(--sage);
  font-size: 14px;
}

/* When PVZ is chosen: collapse the map area for easier access to the form below. */
.yandex-pvz-widget.is-collapsed {
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  cursor: pointer;
  position: relative;
}

.yandex-pvz-widget.is-collapsed::after {
  content: "Нажмите, чтобы изменить пункт";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

@media (min-width: 980px) {
  /* Name + phone in one row on desktop to save vertical space */
  #order-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  #order-form > label {
    margin-bottom: 0;
  }

  #order-form > label:nth-of-type(1),
  #order-form > label:nth-of-type(2) {
    grid-column: span 1;
  }

  #order-form > label:nth-of-type(3),
  #order-form > label:nth-of-type(4),
  #order-form > label:nth-of-type(5),
  #order-form > .order-section-title,
  #order-form > .add-to-cart-row,
  #order-form > [data-cart-summary],
  #order-form > fieldset,
  #order-form > button,
  #order-form > .form-status {
    grid-column: 1 / -1;
  }

  #order-form > label:nth-of-type(1),
  #order-form > label:nth-of-type(2),
  #order-form > label:nth-of-type(3),
  #order-form > label:nth-of-type(4) {
    grid-column: span 1;
  }
}

.pvz-selected {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f3ebe0;
  border: 1px solid var(--line);
}

.pvz-selected-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
}

.pvz-selected-type {
  margin: 0 0 6px;
  font-weight: 700;
}

.pvz-selected-address {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.pvz-selected.is-updated {
  animation: pvzFlash 1.2s ease;
}

@keyframes pvzFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 107, 72, 0);
  }
  35% {
    box-shadow: 0 0 0 3px rgba(139, 107, 72, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(139, 107, 72, 0);
  }
}

/* After selection, hide the big widget “Пункт выдачи” panel. */
.yandex-pvz-widget.is-point-selected .widget__address-card {
  display: none !important;
}

/* The widget “Пункт выдачи” details overlay */
.yandex-pvz-widget.is-point-selected .widget__point-detail,
.yandex-pvz-widget.is-point-selected .widget__point-detail--w,
.yandex-pvz-widget.is-point-selected .widget__point-detail-- {
  display: none !important;
}

.product-page {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  padding: 36px 0 80px;
}

.gallery-main {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #d9cbb8;
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: var(--photo-focus, center 22%);
}

.gallery-meta {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
  z-index: 1;
}

.gallery-kind,
.gallery-counter {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 247, 240, 0.92);
  font-size: 12px;
  font-weight: 700;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.thumbs button {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

.thumbs button.is-active,
.thumbs button:hover {
  border-color: var(--kraft);
}

.thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-panel {
  /* Long product copy + symbolism is taller than the viewport;
     sticky caused the CTA buttons to collide with the last blocks on desktop. */
  position: relative;
  top: auto;
  align-self: start;
  max-height: none;
  overflow: visible;
  padding-bottom: 32px;
}

.sku {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.price {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  margin: 8px 0 18px;
}

.specs {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.specs th,
.specs td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.specs th {
  color: var(--ink-soft);
  font-weight: 500;
  width: 42%;
}

.symbolism {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 8px;
}

.symbol-item {
  padding: 12px 14px;
  background: #f3ebe0;
  border-radius: 12px;
}

.symbol-item p {
  margin: 6px 0 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--kraft);
  text-decoration: none;
  font-weight: 700;
}

.contacts-box p {
  font-size: 18px;
}

.site-footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  margin: 0 0 6px;
}

.footer-brand img {
  width: auto;
  height: 52px;
  object-fit: contain;
}

.footer-note,
.footer-local {
  margin: 0;
  color: var(--ink-soft);
}

.footer-local {
  margin-top: 10px;
  font-size: 13px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.92);
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.lightbox img {
  max-height: 88vh;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  background: transparent;
  color: var(--paper);
  border: 0;
  font-size: 42px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 18px;
}

@media (max-width: 900px) {
  .benefits,
  .catalog-grid,
  .split,
  .order-layout,
  .product-page,
  .pack-gallery {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 16px 20px 20px;
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .product-panel {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 28px;
  }

  .hero {
    min-height: 78vh;
  }
}
