/* Pentlja — Voščilnice in Darila Pentlja, Koper */

:root {
  --ink: #16201a;
  --paper: #f6f1e6;
  --paper-2: #efe7d6;
  --linen: #ece3d1;
  --emerald: #1f5c45;
  --emerald-2: #16432f;
  --gold: #b8903f;
  --gold-light: #d8b876;
  --line: rgba(22, 32, 26, 0.18);
  --radius: 2px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --shadow-1: 0 1px 0 rgba(22,32,26,.06), 0 10px 24px -14px rgba(22,32,26,.35);
  --shadow-2: 0 2px 0 rgba(22,32,26,.08), 0 22px 40px -20px rgba(22,32,26,.45);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background-image:
    repeating-linear-gradient(0deg, rgba(22,32,26,0.025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(22,32,26,0.015) 0 1px, transparent 1px 3px);
}

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; color: var(--emerald-2); }
p { margin: 0 0 1em; }
a { color: var(--emerald-2); text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--emerald-2); color: #fff; padding: .6em 1em; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,241,230,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); }
.brand svg { width: 42px; height: 42px; flex-shrink: 0; }
.brand .wordmark { width: 150px; height: 32px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; color: var(--emerald-2); }
.brand-text span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }

.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  position: relative; font-size: .95rem; color: var(--ink); padding-bottom: 4px;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }

.cart-link {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--ink); padding: 8px 14px; border-radius: var(--radius);
  font-size: .9rem;
}
.cart-link svg { width: 20px; height: 20px; }
.cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-size: .72rem; font-weight: 700;
  font-family: var(--font-mono);
}
.cart-count.bump { animation: bump .4s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

.menu-toggle {
  display: none; background: none; border: 1.5px solid var(--ink); border-radius: var(--radius);
  width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    background: var(--paper); border-left: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; padding: 90px 28px 28px;
    transform: translateX(100%); visibility: hidden; transition: transform .35s ease;
    z-index: 150;
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  .main-nav ul { flex-direction: column; gap: 18px; }
  .main-nav .cart-link { margin-top: 20px; }
  .menu-toggle { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 26px; border-radius: var(--radius); font-size: .95rem; font-weight: 600;
  border: 1.5px solid var(--emerald-2); background: transparent; color: var(--emerald-2);
  cursor: pointer; font-family: var(--font-body); min-height: 44px;
}
.btn span { position: relative; z-index: 2; }
.btn::before {
  content: ""; position: absolute; inset: 0; width: 100%; left: -100%;
  background: var(--emerald-2); transition: left .3s ease; z-index: 1;
}
.btn:hover::before, .btn:focus-visible::before { left: 0; }
.btn:hover, .btn:focus-visible { color: #fff; }
.btn-primary { background: var(--emerald-2); color: #fff; }
.btn-primary::before { background: var(--gold); }
.btn-primary:hover, .btn-primary:focus-visible { color: var(--ink); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost::before { background: rgba(255,255,255,.18); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 9px 16px; font-size: .85rem; min-height: 38px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 70px 0 60px;
  background: linear-gradient(180deg, var(--linen), var(--paper) 85%);
}
.hero-photo { position: absolute; inset: 0; z-index: 0; }
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: sepia(.3) saturate(.65) brightness(1.05);
  mix-blend-mode: multiply; opacity: .16;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem); color: var(--emerald-2); margin-bottom: .4em;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-lede { font-size: 1.1rem; max-width: 46ch; color: #2c3a31; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-art {
  position: relative; aspect-ratio: 1/1; display: grid; place-items: center;
}
.hero-art svg { width: 100%; height: 100%; }
.hero-float { position: absolute; will-change: transform; }

/* ---------- Map canvas (home composition) ---------- */
.map-board {
  position: relative; padding: 90px 0 110px;
  background: var(--paper-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M0 60 Q30 20 60 60 T120 60' stroke='%231f5c45' stroke-opacity='0.05' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  overflow: hidden;
}
.map-board::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(184,144,63,.12), transparent 50%),
              radial-gradient(ellipse at 85% 75%, rgba(31,92,69,.12), transparent 45%);
  pointer-events: none;
}
.map-canvas {
  position: relative; min-height: 640px;
}
.pin-card {
  position: absolute; width: min(300px, 78vw);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 22px;
  transform: rotate(var(--rot, 0deg));
}
.pin-card::before {
  content: ""; position: absolute; top: -9px; left: 26px; width: 18px; height: 18px;
  background: var(--gold); border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.pin-card h3 { font-size: 1.05rem; margin-bottom: .35em; }
.pin-card p { font-size: .9rem; margin-bottom: .6em; color: #3a473d; }
.pin-card a { font-size: .85rem; font-weight: 600; border-bottom: 1px solid var(--gold); }

@media (max-width: 760px) {
  .map-canvas { min-height: auto; display: flex; flex-direction: column; gap: 22px; }
  .pin-card { position: static; width: 100%; transform: none; }
}

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .kicker {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-dark { background: var(--emerald-2); color: #eef3ee; }
.section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark .kicker { color: var(--gold-light); }
.section-dark p, .section-dark .feature-item p { color: #d7e2d9; }

.divider { display: block; width: 100%; height: 40px; }

/* ---------- Product strip / grid ---------- */
.product-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(260px, 76vw);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
  margin: 0 -24px; padding-left: 24px; padding-right: 24px;
}
.product-strip .product-card { scroll-snap-align: start; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px;
}

.product-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-1); transition: transform .3s ease, box-shadow .3s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.product-card .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--linen); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .thumb img { transform: scale(1.08); }
.product-card .body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card h3 { font-size: 1.02rem; margin: 0; }
.product-card .excerpt { font-size: .86rem; color: #3a473d; margin: 0; flex: 1; }
.product-card .price-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.price { font-family: var(--font-mono); font-weight: 700; color: var(--emerald-2); font-size: 1.05rem; }
.price-unit { font-size: .74rem; color: #6a776b; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filters button {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 8px 16px; font-size: .85rem; cursor: pointer; min-height: 40px;
}
.filters button[aria-pressed="true"] { background: var(--emerald-2); color: #fff; border-color: var(--emerald-2); }

/* ---------- Icons / badges ---------- */
.icon { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 10px; }
.feature-item { display: flex; gap: 14px; align-items: flex-start; }
.feature-item .icon { color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.feature-item h4 { font-size: 1rem; margin-bottom: .2em; }
.feature-item p { font-size: .9rem; color: #3a473d; margin: 0; }

/* ---------- Advisor (signature feature) ---------- */
.advisor {
  position: relative; padding: 70px 0;
  background: var(--paper);
}
.advisor-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2);
  background: var(--paper);
}
.advisor-controls { padding: 36px; background: var(--linen); }
.advisor-controls fieldset { border: none; padding: 0; margin: 0 0 22px; }
.advisor-controls legend { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--emerald-2); margin-bottom: 10px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row button {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 9px 15px; font-size: .84rem; cursor: pointer; min-height: 40px;
}
.choice-row button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.advisor-result { margin-top: 10px; padding-top: 18px; border-top: 1px dashed var(--line); }
.advisor-result h4 { font-size: .95rem; margin-bottom: 8px; }
.advisor-result ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.advisor-result li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.advisor-result li a { font-weight: 600; }
.advisor-preview { position: relative; display: grid; place-items: center; background: var(--emerald-2); padding: 36px; }
.advisor-preview svg { width: 100%; max-width: 320px; height: auto; }

@media (max-width: 760px) {
  .advisor-card { grid-template-columns: 1fr; }
}

/* ---------- Reveal ---------- */
.reveal { opacity: 1; transform: none; }
.reveal.js-hidden { opacity: 0; transform: translateY(26px); clip-path: inset(0 0 12% 0); }
.reveal.in-view { opacity: 1; transform: none; clip-path: inset(0 0 0% 0); transition: opacity .7s ease, transform .7s ease, clip-path .7s ease; }
.reveal.stagger-1.in-view { transition-delay: .08s; }
.reveal.stagger-2.in-view { transition-delay: .16s; }
.reveal.stagger-3.in-view { transition-delay: .24s; }
.reveal.stagger-4.in-view { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal.js-hidden { opacity: 1; transform: none; clip-path: none; }
  .reveal.in-view { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none;
  opacity: .035; mix-blend-mode: multiply; z-index: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #dfe6e0; padding: 60px 0 30px; margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 34px; }
.footer-col h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: #c8d3cb; font-size: .9rem; }
.footer-col a:hover { color: var(--gold-light); }
.footer-brand p { font-size: .88rem; color: #aebcb2; max-width: 32ch; }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo svg { width: 34px; height: 34px; }
.footer-logo .wordmark { width: 130px; height: 28px; }
.newsletter-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  flex: 1; min-width: 160px; background: #23302a; border: 1px solid #3a4a41; color: #fff;
  padding: 10px 12px; border-radius: var(--radius); font-size: .88rem;
}
.footer-bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid #2c3a33;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .82rem; color: #93a097;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--emerald-2); }
.field input, .field textarea, .field select {
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 11px 13px;
  font-size: .95rem; font-family: var(--font-body); background: var(--paper);
  accent-color: var(--emerald-2);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--emerald-2); }
.field.checkbox { flex-direction: row; align-items: flex-start; gap: 10px; }
.field.checkbox input { width: 20px; height: 20px; margin-top: 2px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 12px 14px; border-radius: var(--radius); font-size: .9rem; display: none; }
.form-msg.show { display: block; }
.form-msg.ok { background: #e3efe6; color: var(--emerald-2); border: 1px solid var(--emerald); }
.form-msg.err { background: #f8e6e0; color: #8a2e1a; border: 1px solid #c0432a; }
.field-error { color: #a4341c; font-size: .8rem; display: none; }
.field.invalid input, .field.invalid textarea { border-color: #a4341c; }
.field.invalid .field-error { display: block; }

/* ---------- Generic content pages ---------- */
.page-hero { padding: 56px 0 20px; background: var(--linen); }
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; font-size: 1.4rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; color: var(--emerald-2); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.3rem; color: var(--gold); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin-top: 12px; color: #3a473d; }

/* ---------- Product detail ---------- */
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.pd-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.pd-info h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
@media (max-width: 760px) {
  .product-detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Cart / checkout ---------- */
.table-scroll { overflow-x: auto; max-width: 100%; }
.cart-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.cart-table th, .cart-table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.cart-table tr:has(.remove-btn:hover) { background: var(--linen); }
.field:has(input:focus, textarea:focus, select:focus) label { color: var(--gold); }
.cart-table img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); }
.cart-row-main { display: flex; align-items: center; gap: 12px; }
.qty-input { width: 56px; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--radius); text-align: center; }
.remove-btn { background: none; border: none; color: #a4341c; cursor: pointer; font-size: .85rem; text-decoration: underline; min-height: 44px; }
.cart-summary { background: var(--linen); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 20px; max-width: 360px; margin-left: auto; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .95rem; }
.cart-summary .total { font-weight: 700; font-size: 1.1rem; color: var(--emerald-2); border-top: 1px dashed var(--line); padding-top: 10px; }
.empty-cart { text-align: center; padding: 60px 0; color: #5c6b60; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 300;
  max-width: 560px; margin: 0 auto;
  background: var(--ink); color: #eef3ee; border-radius: var(--radius);
  box-shadow: var(--shadow-2); padding: 20px 22px; display: none;
  gap: 14px; flex-direction: column;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { font-size: .88rem; margin: 0; color: #d7e2d9; }
.cookie-banner p a { color: #fff; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }

/* ---------- 404 ---------- */
.not-found { padding: 100px 0; text-align: center; }
.not-found svg { width: 180px; height: 180px; margin: 0 auto 20px; }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.mt-sm { margin-top: 16px; }
.mt-lg { margin-top: 40px; }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
