:root {
  --cream: #f4efe4;
  --cream-deep: #ebe3d2;
  --paper: #faf6ee;
  --ink: #243126;
  --ink-soft: #4a554c;
  --green: #2f5a38;
  --green-deep: #1c3a24;
  --green-header: #458a55ce;
  --leaf: #3d7a48;
  --gold: #c4a35a;
  --gold-deep: #9a7a32;
  --hit: #b8862b;
  --new: #3d7a48;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(22, 50, 30, 0.16);
  --radius: 18px;
  --header-h: 72px;
  --font: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--green-header);
  color: var(--cream);
  box-shadow: 0 8px 24px rgba(16, 36, 22, 0.28);
}

.header__inner {
  width: min(1120px, calc(100% - 28px));
  margin-inline: auto;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.logo img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.35);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.nav a {
  color: #f3ead6;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
}

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

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--green-header);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.cart-count[hidden] {
  display: none;
}

.burger {
  display: none;
  gap: 5px;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.is-open span:nth-child(2) {
  opacity: 0;
}

.burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 640px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 80%, rgba(196, 163, 90, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(22, 50, 30, 0.35), rgba(22, 50, 30, 0.72)),
    linear-gradient(160deg, #4f7a55 0%, #2d5136 42%, #1b3523 100%);
  overflow: hidden;
}

.hero__mist {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(244, 239, 228, 0.12) 40%, var(--cream));
  pointer-events: none;
}

.hero__content {
  position: relative;
  width: min(760px, calc(100% - 40px));
  padding: 72px 0 88px;
}

.hero__eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold);
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.15;
  margin: 0 0 16px;
}

.hero__lead {
  margin: 0 0 28px;
  font-size: 1.12rem;
  color: #efe6d4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--gold {
  background: var(--gold);
  color: var(--green-header);
  box-shadow: 0 8px 20px rgba(154, 122, 50, 0.28);
}

.btn--gold:hover {
  background: #d4b56a;
}

.btn--ghost {
  background: transparent;
  color: var(--green-deep);
  border: 1px solid rgba(47, 90, 56, 0.28);
}

.btn--block {
  width: 100%;
}

#catalog,
#about,
#contacts,
#top {
  scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 8px);
}

.catalog,
.about,
.contacts {
  padding: 72px 0;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--gold-deep);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.section-head,
.category__head,
.about,
.contacts {
  text-align: center;
}

.section-head h2,
.about h2,
.contacts h2,
.category__head h3,
.drawer__head h2,
#checkoutTitle {
  font-family: var(--serif);
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--green-deep);
}

.section-sub,
.category__head p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--ink-soft);
}

.category {
  margin-top: 56px;
}

.category__head {
  margin-bottom: 28px;
}

.category__head h3 {
  font-size: 1.7rem;
}

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

.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(36, 49, 38, 0.07);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(47, 90, 56, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(36, 49, 38, 0.12);
  }

  .contact-list a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }

  .btn:hover {
    transform: translateY(-1px);
  }
}

.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

/* фото в каталоге показывается целиком, без обрезки */
.card__media .product-img {
  object-fit: contain;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 253, 248, 0.86);
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--inline {
  position: static;
  display: inline-block;
  margin-bottom: 10px;
}

.badge--new {
  background: var(--new);
  color: #f6f1e4;
}

.badge--hit {
  background: var(--hit);
  color: #fff8e8;
}

.card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 1.12rem;
  font-family: var(--serif);
}

.card__meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.price {
  font-weight: 700;
  color: var(--green);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price small {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.about {
  background:
    linear-gradient(180deg, transparent, rgba(47, 90, 56, 0.05)),
    var(--cream-deep);
}

.about__inner {
  max-width: 760px;
}

.about__text p {
  text-align: left;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 920px;
}

.contact-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px;
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid rgba(47, 90, 56, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-deep);
  color: var(--gold);
}

.footer {
  background: var(--green-header);
  color: #e8dfcc;
  padding: 28px 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__social {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer__social a:hover {
  color: var(--gold);
}

.drawer-backdrop,
.nav-backdrop,
.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 32, 22, 0.46);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.drawer-backdrop.is-open,
.nav-backdrop.is-open,
.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(420px, 100%);
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s ease;
  box-shadow: var(--shadow);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer:not(.is-open) {
  pointer-events: none;
}

.drawer__head,
.drawer__foot {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(47, 90, 56, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer__foot {
  border-bottom: 0;
  border-top: 1px solid rgba(47, 90, 56, 0.12);
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

.drawer__body {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.close-btn {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink-soft);
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px 6px;
  border-bottom: 1px solid rgba(47, 90, 56, 0.1);
}

.cart-line h4 {
  margin: 0;
  font-size: 0.98rem;
}

.cart-line p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.cart-line__price {
  font-weight: 700;
  color: var(--green);
}

.cart-line__controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.remove-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #8a4a3a;
  cursor: pointer;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(47, 90, 56, 0.22);
  border-radius: 999px;
  overflow: hidden;
}

.stepper button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--green-deep);
}

.stepper span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
}

.empty-cart {
  color: var(--ink-soft);
  text-align: center;
  padding: 48px 12px;
}

.modal {
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal__panel {
  width: min(860px, 100%);
  max-height: min(90dvh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border-radius: 22px;
  position: relative;
  padding: 28px;
  transform: translateY(16px);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow);
}

.modal.is-open .modal__panel {
  transform: translateY(0);
}

.modal__panel--narrow {
  width: min(480px, 100%);
}

.modal .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.product-modal {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 28px;
}

.product-gallery {
  position: sticky;
  top: 12px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.product-modal__media {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  min-height: 260px;
  aspect-ratio: 4 / 5;
  max-height: min(62dvh, 520px);
  background: #fff;
}

/* фото показывается целиком, без обрезки */
.product-modal__media .product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  color: var(--green-deep);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.gallery-nav--prev {
  left: 10px;
}

.gallery-nav--next {
  right: 10px;
}

.gallery-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(28, 58, 36, 0.72);
  color: #fff;
  font-size: 0.78rem;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
}

.gallery-thumb {
  flex: 0 0 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb.is-active {
  border-color: var(--gold);
  opacity: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 20, 13, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(94vw, 1000px);
  max-height: 88vh;
  max-height: 88dvh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  color: var(--green-deep);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.product-modal h3,
.product-modal #productTitle {
  font-family: var(--serif);
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.product-modal p {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.facts {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(47, 90, 56, 0.06);
  border-radius: 12px;
}

.facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  font-size: 0.92rem;
}

.facts dt {
  color: var(--green);
  font-weight: 700;
}

.pack-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(22, 50, 30, 0.14);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.pack-switch {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.pack-switch label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(47, 90, 56, 0.2);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pack-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pack-switch label:has(input:checked) {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--cream);
}

.pack-switch label:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-actions .btn {
  flex: 1;
}

.live-price {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green);
}

#checkoutForm {
  display: grid;
  gap: 14px;
}

#checkoutForm label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  text-align: left;
}

#checkoutForm input,
#checkoutForm textarea {
  width: 100%;
  border: 1px solid rgba(47, 90, 56, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--white);
}

.form-error {
  color: #8a4a3a;
  margin: 0;
}

.checkout-note {
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px);
  transform: translateX(-50%) translateY(12px);
  background: var(--green-deep);
  color: var(--cream);
  padding: 12px 18px;
  border-radius: 999px;
  z-index: 90;
  opacity: 0;
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

body.modal-open {
  overflow: hidden;
}

@media (min-width: 1200px) {
  .grid {
    gap: 26px;
  }

  .card h3 {
    font-size: 1.18rem;
  }
}

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .contact-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-modal {
    grid-template-columns: 1fr;
  }

  .product-gallery {
    position: static;
  }

  .product-modal__media {
    max-height: min(55dvh, 440px);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .header__inner {
    width: min(1120px, calc(100% - 20px));
    grid-template-columns: auto 1fr auto;
  }

  .logo img {
    width: 46px;
    height: 46px;
  }

  .burger {
    display: grid;
  }

  .nav {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    background: var(--green-header);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease;
    z-index: 45;
    box-shadow: 0 12px 24px rgba(16, 36, 22, 0.24);
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 14px 24px;
    font-size: 1.05rem;
  }

  .nav a::after {
    display: none;
  }

  .hero {
    min-height: min(78dvh, 560px);
    text-align: left;
    align-items: end;
  }

  .hero__content {
    padding: 40px 0 64px;
    text-align: left;
    width: min(100%, calc(100% - 32px));
    margin-right: auto;
    margin-left: 16px;
  }

  .hero__eyebrow {
    letter-spacing: 0.16em;
    font-size: 0.72rem;
  }

  .hero__lead {
    font-size: 1rem;
  }

  .catalog,
  .about,
  .contacts {
    padding: 44px 0;
  }

  .category {
    margin-top: 40px;
  }

  .wrap {
    width: min(1120px, calc(100% - 24px));
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .card__body {
    padding: 14px;
  }

  .card h3 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .card__meta {
    font-size: 0.82rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card__row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .card__row .btn {
    width: 100%;
  }

  .btn {
    min-height: 44px;
  }

  .drawer {
    width: 100%;
  }

  .modal {
    padding: 0;
    align-items: stretch;
  }

  .modal__panel {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 20px 16px 24px;
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .modal__panel--narrow {
    width: 100%;
    min-height: auto;
    max-height: min(92dvh, 640px);
    margin-top: auto;
    align-self: end;
    border-radius: 20px 20px 0 0;
    padding: 24px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(48px + env(safe-area-inset-top, 0px));
  }

  .modal .close-btn {
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 8px;
    width: 44px;
    height: 44px;
  }

  .product-modal h3,
  .product-modal #productTitle {
    font-size: clamp(1.35rem, 5vw, 1.8rem);
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .facts dt {
    margin-top: 6px;
  }

  .product-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer__social {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .card__media {
    aspect-ratio: 1 / 1;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.4rem);
  }

  .section-head h2,
  .about h2,
  .contacts h2,
  .category__head h3 {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .category__head h3 {
    font-size: 1.35rem;
  }
}

@media (max-width: 380px) {
  .hero__eyebrow {
    letter-spacing: 0.1em;
  }

  .pack-switch {
    flex-direction: column;
  }
}
