/* Основні кольори та спільні елементи */
:root {
  --paper: #faf9f5;
  --ink: #1c2818;
  --olive: #656f36;
  --muted: #666b72;
  --line: #e6e2d8;
  --gutter: clamp(16px, 4vw, 64px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.5 Arial, Helvetica, sans-serif; }
body.modal-open { overflow: hidden; }
button, a, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid #9caa61; outline-offset: 4px; }
img { display: block; max-width: 100%; }
svg { width: 32px; height: 32px; flex-shrink: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-family: Georgia, 'Times New Roman', serif; line-height: 1.1; letter-spacing: -.025em; overflow-wrap: break-word; }
h2 { font-size: clamp(32px, 3.3vw, 50px); }
h3 { font-size: 29px; }
p { margin: 0; }
.container { width: calc(100% - 2 * var(--gutter)); max-width: 1420px; margin-inline: auto; }
.skip { position: fixed; top: -80px; z-index: 10; padding: 12px; background: var(--paper); }
.skip:focus { top: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 48px; max-width: 100%; padding: 13px 24px; border: 0; border-radius: 9px; background: var(--olive); color: white; font-size: 17px; line-height: 1.4; text-align: center; transition: background .2s, transform .2s; }
.button span { font-size: 25px; line-height: 1; }
.button:active { transform: translateY(0); }
.sku { margin: 0 0 9px; color: var(--muted); font: 13px/1.5 Arial, sans-serif; letter-spacing: .04em; }
.price { margin-block: 6px 16px; color: var(--olive); font-size: 24px; font-weight: 600; }
.small-note { margin-top: 20px; font-size: 14px; color: #72766b; }

/* Шапка */
.header { position: sticky; top: 0; z-index: 5; background: rgba(250, 249, 245, .96); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1536px; min-height: 76px; margin: auto; padding: 12px var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 12px; font: bold 44px/1 Georgia, serif; white-space: nowrap; }
.brand svg { width: 32px; height: 42px; color: var(--olive); }
nav { display: flex; align-items: center; gap: 36px; }
nav a { position: relative; display: grid; align-items: center; min-height: 44px; padding: 7px 0; font-size: 17px; }
nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--olive); transform: scaleX(0); transition: transform .22s; }
nav a[aria-current=page]::after { transform: scaleX(1); }
.cart-button { position: relative; width: 48px; height: 48px; padding: 7px; border: 0; background: none; }
.cart-button svg { width: 34px; height: 34px; }
.cart-button span { position: absolute; right: -3px; top: 0; min-width: 22px; padding: 2px 5px; border-radius: 30px; background: var(--olive); color: white; font-size: 12px; }

/* Головна: колонки не можуть виштовхнути одна одну */
.page { animation: appear .35s ease; }
.page:not(#home) { min-height: 70vh; padding-block: 34px 36px; }
.hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.9fr); align-items: stretch; gap: 28px; max-width: 1536px; margin: auto; padding-inline: var(--gutter); }
.hero-copy { min-width: 0; align-self: center; padding-block: 36px; container-type: inline-size; }
.eyebrow { margin-bottom: 18px; color: var(--olive); font-size: 14px; letter-spacing: .24em; text-transform: uppercase; }
.hero h1 { font-size: clamp(30px, 4vw, 64px); }
.hero h1 span { display: block; }
@supports (font-size: 1cqi) {
  .hero h1 { font-size: clamp(28px, 13cqi, 68px); }
}
.intro { margin-block: 24px 28px; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.4; }
.hero-photo { width: 100%; height: 100%; min-height: 440px; max-height: 580px; object-fit: cover; object-position: center 35%; border-radius: 16px 48px 48px 16px; }
.featured { padding-block: 36px 24px; }
.featured h2 { margin-bottom: 20px; }

/* Товари */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf7; transition: transform .25s, box-shadow .25s; }
.card-photo { display: block; width: 100%; padding: 4px; overflow: hidden; border: 0; background: none; }
.card img { width: 100%; height: auto; aspect-ratio: 1.6; object-fit: cover; border-radius: 9px; transition: transform .4s; }
.card-info { display: flex; flex: 1; flex-direction: column; padding: 12px 20px 16px; }
.card h2 { margin-bottom: 14px; font-size: clamp(23px, 2.1vw, 32px); line-height: 1.15; }
.card .button { width: 100%; min-height: 46px; margin-top: auto; padding: 10px 18px; }
.featured .card-info { padding: 9px 18px 13px; }
.featured .card h3 { font: 400 19px/1.4 Arial, sans-serif; letter-spacing: 0; }
.card-title-button { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.page-title { margin-bottom: 8px; font-size: clamp(40px, 4.5vw, 64px); }
.subtitle { margin-bottom: 28px; color: var(--muted); font-size: 23px; }
.breadcrumb { margin-bottom: 22px; color: var(--muted); font-size: 16px; }
.breadcrumb a:hover { text-decoration: underline; }

/* Контакти */
.contact-panel { width: 100%; max-width: 820px; margin: 38px auto 10px; padding: 36px 60px; border: 1px solid var(--line); border-radius: 16px; }
.contact-panel h2 { margin-bottom: 32px; font-size: 40px; }
.contact-row { display: flex; align-items: center; gap: 32px; margin-bottom: 28px; }
.contact-row > div { min-width: 0; }
.contact-icon { display: grid; place-items: center; flex-shrink: 0; width: 78px; height: 78px; border-radius: 50%; background: #eaeada; }
.contact-icon svg { width: 40px; height: 40px; }
.contact-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 19px; }
.contact-value { display: block; max-width: 100%; font-size: clamp(19px, 2.3vw, 29px); overflow-wrap: anywhere; }
a.contact-value { padding-block: 4px; }
.contact-note { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 18px; }
.custom-order h3 { margin-bottom: 12px; color: var(--ink); font-size: 28px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 36px; padding-block: 22px; border-top: 1px solid var(--line); }
.footer .brand { font-size: 36px; }
.footer p { color: var(--muted); font-size: 16px; }

/* Картка товару та кошик */
dialog { max-width: calc(100% - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 32px; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 100px #0003; }
dialog[open] { animation: modal-in .25s ease; }
dialog::backdrop { background: #171a16a3; backdrop-filter: blur(2px); }
.dialog-toolbar { position: sticky; top: 20px; z-index: 2; height: 0; }
.close { position: absolute; right: -20px; top: -20px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--paper); color: var(--muted); font: 34px/1 Arial; }
#product-dialog { width: 1100px; }
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 38px; }
.product-layout > img { width: 100%; height: auto; max-height: 650px; object-fit: contain; border-radius: 12px; }
.product-info { min-width: 0; padding-top: 24px; }
.product-info h2 { margin-bottom: 10px; padding-right: 12px; font-size: clamp(32px, 3.1vw, 46px); }
.product-info p { color: var(--muted); font-size: 18px; }
.product-info .price { color: var(--olive); font-size: 28px; }
.product-info .sku { margin-bottom: 18px; font-size: 13px; }
.specs { margin: 24px 0 28px; }
.specs > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.specs > div:last-child { border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.product-info h3 { margin-bottom: 15px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.buy-row > .button { flex: 1 1 200px; padding-inline: 18px; }
.stepper { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #cecbbf; border-radius: 10px; }
.stepper button { min-width: 44px; min-height: 44px; padding: 10px 12px; border: 0; background: none; color: var(--muted); font-size: 23px; }
.stepper output { min-width: 24px; text-align: center; }
.product-info .small-note { margin-top: 20px; color: #72766b; font-size: 14px; }
#cart-dialog { width: 780px; padding: 36px; }
#cart-title { margin-bottom: 24px; padding-right: 32px; font-size: 40px; }
.cart-item { display: grid; grid-template-columns: 88px minmax(0, 1fr) 44px; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; }
.cart-item h3 { margin-bottom: 5px; font-size: 23px; }
.cart-item .sku { margin-bottom: 10px; }
.remove { min-width: 44px; min-height: 44px; padding: 8px; border: 0; background: none; color: var(--muted); font-size: 23px; }
.cart-total { margin-top: 22px; font-size: 23px; }
.cart-sum { margin-top: 8px; color: var(--olive); font-size: 26px; font-weight: 600; }
.cart-price { margin-bottom: 12px; color: var(--muted); font-size: 15px; }
#cart-bottom .button { width: 100%; margin-top: 20px; }
.empty-cart { padding: 25px 0; color: var(--muted); }
.order-intro { color: var(--muted); font-size: 18px; }
.order-intro strong { color: var(--ink); font-weight: 600; }
.order-label { display: block; margin: 24px 0 10px; font-size: 16px; }
#order-message { display: block; width: 100%; min-height: 170px; max-height: 300px; padding: 16px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; background: #f2f1e9; color: var(--ink); font: 16px/1.6 Arial, sans-serif; }
#copy-order { width: 100%; margin-top: 16px; }
.copy-status { margin-top: 10px; color: var(--olive); font-size: 14px; }
.copy-status:empty { display: none; }
.messenger-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.messenger-links .button { flex: 1 1 160px; }
.messenger-button { gap: 12px; }
.messenger-button span { min-width: 0; font-size: 14px; line-height: 1.5; }
.messenger-button strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.messenger-button svg { width: 24px; height: 24px; }
.order-note { margin-top: 20px; color: var(--muted); font-size: 16px; }
.back-button { min-height: 44px; margin-top: 18px; padding: 8px 0; border: 0; background: none; color: var(--olive); font-size: 16px; }
.back-button:hover { text-decoration: underline; }
.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; z-index: 20; width: max-content; max-width: calc(100% - 32px); padding: 13px 24px; border-radius: 10px; background: var(--ink); color: white; font-size: 16px; text-align: center; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .25s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Ефекти наведення лише для пристроїв із мишею */
@media (hover: hover) {
  nav a:hover::after { transform: scaleX(1); }
  .button:hover { background: #4d5828; transform: translateY(-2px); }
  .card:hover { transform: translateY(-5px); box-shadow: 0 14px 28px #26311a0d; }
  .card-photo:hover img { transform: scale(1.025); }
  .stepper button:hover { background: #eaeada; }
  .close:hover { color: var(--ink); }
}
@keyframes appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Планшети та невеликі ноутбуки */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .featured .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .hero { gap: 22px; }
  .hero-photo { min-height: 400px; }
  .hero .button { gap: 12px; padding-inline: 18px; font-size: 15px; }
  .desktop-break { display: none; }
  .card-info { padding-inline: 16px; }
  .card h2 { font-size: 28px; }
  .product-layout { gap: 26px; }
  .product-info h2 { font-size: 34px; }
  .product-info p { font-size: 16px; }
  .product-info .price { font-size: 26px; }
  .product-info .sku { font-size: 13px; }
}
@media (max-width: 800px) {
  .header-inner { flex-wrap: wrap; gap: 8px 12px; }
  .brand { gap: 8px; font-size: 36px; }
  .cart-button { order: 1; }
  nav { order: 2; justify-content: center; width: 100%; gap: 28px; }
  nav a { font-size: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-copy { padding-block: 28px; }
  .hero h1 { max-width: 640px; font-size: clamp(36px, 6.8vw, 56px); }
  .hero h1 span { display: inline; }
  .intro { max-width: 520px; margin-block: 18px 22px; font-size: 20px; }
  .hero .button { min-height: 48px; font-size: 17px; }
  .hero-photo { height: 360px; min-height: 0; border-radius: 14px 38px 38px 14px; }
  .featured .grid { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 16px; }
  .featured .card { flex: 0 0 44%; scroll-snap-align: start; }
  .contact-panel { padding: 30px 34px; }
  .contact-panel h2 { font-size: 36px; }
  .contact-row { gap: 24px; }
  .contact-value { font-size: 26px; }
  #product-dialog { width: 600px; }
  .product-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .product-layout > img { height: auto; max-height: min(420px, 55dvh); margin-inline: auto; }
  .product-info { padding-top: 0; }
  .product-info h2 { font-size: 36px; }
  .product-info p { font-size: 18px; }
  .product-info .sku { font-size: 13px; }
}

/* Телефони */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .header-inner { flex-wrap: wrap; min-height: 110px; gap: 2px 12px; padding-block: 8px 4px; }
  .brand { font-size: clamp(24px, 6.5vw, 34px); }
  .brand svg { width: 26px; height: 34px; }
  .cart-button { order: 1; }
  nav { order: 2; justify-content: space-around; gap: 12px; width: 100%; }
  nav a { min-height: 44px; font-size: 15px; }
  .hero-copy { padding-block: 24px; }
  .eyebrow { margin-bottom: 14px; font-size: 12px; }
  .hero h1 { font-size: clamp(36px, 8.6vw, 48px); }
  .intro { font-size: 18px; }
  .hero-photo { height: auto; aspect-ratio: 1.25; object-position: center 28%; }
  .featured { padding-top: 28px; }
  .featured h2 { margin-bottom: 17px; font-size: 36px; }
  .featured .card { flex-basis: 85%; }
  .featured .card h3 { font-size: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .card img { aspect-ratio: 1.3; }
  .card-info { padding: 13px 16px 16px; }
  .card h2 { font-size: 28px; }
  .card .button { min-height: 48px; font-size: 16px; }
  .page:not(#home) { padding-top: 24px; }
  .page-title { font-size: clamp(36px, 9vw, 46px); }
  .subtitle { margin-bottom: 24px; font-size: 18px; }
  .breadcrumb { margin-bottom: 18px; font-size: 14px; }
  .contact-panel { margin-top: 26px; padding: 25px 20px; }
  .contact-panel h2 { margin-bottom: 26px; font-size: 31px; }
  .contact-row { gap: 18px; margin-bottom: 26px; }
  .contact-icon { width: 58px; height: 58px; }
  .contact-icon svg { width: 31px; height: 31px; }
  .contact-label { font-size: 16px; }
  .contact-value { font-size: 21px; }
  .contact-note { margin-top: 22px; padding-top: 18px; font-size: 16px; }
  .custom-order h3 { font-size: 25px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 24px; }
  .footer .brand { font-size: 30px; }
  .footer p { font-size: 14px; }
  dialog, #cart-dialog { max-width: calc(100% - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); padding: 24px 18px; border-radius: 16px; }
  .close { top: -18px; right: -12px; }
  .product-layout > img { max-height: min(350px, 48dvh); padding-top: 16px; }
  .product-info h2 { font-size: 32px; }
  .product-info p { font-size: 16px; }
  .specs { margin-block: 20px; }
  .specs > div { padding: 11px 0; }
  .product-info h3 { font-size: 26px; }
  .buy-row { gap: 12px; margin-top: 22px; }
  .buy-row > .button { min-height: 48px; }
  .product-info .small-note { font-size: 13px; }
  #cart-title { margin-bottom: 18px; font-size: 34px; }
  .order-intro { font-size: 16px; }
  #order-message { min-height: 180px; }
  .cart-item { grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 10px; }
  .cart-item img { width: 64px; height: 86px; }
  .cart-item h3 { font-size: 22px; }
  .cart-item-info { min-width: 0; }
  .cart-item .sku { font-size: 12px; }
  .cart-item .stepper button { min-width: 40px; }
}
@media (max-width: 380px) {
  .contact-panel { padding-inline: 15px; }
  .contact-row { gap: 12px; }
  .contact-icon { width: 48px; height: 48px; }
  .contact-value { font-size: 18px; }
  .cart-item { grid-template-columns: 52px minmax(0, 1fr) 36px; gap: 8px; }
  .cart-item img { width: 52px; height: 74px; }
  .cart-item h3 { font-size: 20px; }
  .cart-item .stepper button { min-width: 34px; padding-inline: 7px; }
  .cart-item .stepper output { min-width: 22px; }
  .remove { min-width: 36px; }
}
/* Телефон у горизонтальному положенні та низькі вікна */
@media (max-height: 500px) and (max-width: 950px) {
  .header { position: relative; }
  .product-layout { grid-template-columns: minmax(0, 1fr); }
  .product-layout > img { max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
