/* מאפה הבלקן — design language taken from the printed Q4 catalog:
   grunge-black paper, striped burgundy bands, cream display titles, white photo tiles. */
:root {
  --ink: #0b0a09;
  --paper: #151311;
  --line: #342c27;
  --text: #ece6dc;
  --muted: #a99d8f;
  --cream: #f3e2b3;
  --gold: #d6b25e;
  --wine: #7a0a0b;
  --wine-dark: #4f0607;
  --wine-light: #9c1512;
  --danger: #ff8a7a;
  --display: "Secular One", "Heebo", Arial, sans-serif;
  --body: "Heebo", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink) url("../img/texture.jpg") repeat center top / 640px;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  direction: rtl;
}
img { max-width: 100%; display: block; }
a { color: var(--cream); }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- the catalog's striped burgundy band ---------- */
.band {
  position: relative;
  background-color: var(--wine);
  background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .28) 0 2px, transparent 2px 5px);
  border-top: 1px solid #2b0303;
  border-bottom: 1px solid #2b0303;
}
.band-title {
  font-family: var(--display);
  font-weight: 400;
  color: var(--cream);
  text-shadow: 2px 2px 0 #2a0404, -1px -1px 0 #2a0404, 1px -1px 0 #2a0404, -1px 1px 0 #2a0404;
  line-height: 1.1;
  margin: 0;
}
.band.thin { height: 14px; }

/* ---------- masthead (like the catalog cover) ---------- */
.masthead { text-align: center; padding: 18px 16px 14px; }
.masthead img { height: 74px; width: auto; margin: 0 auto; }
@media (min-width: 720px) { .masthead img { height: 96px; } }

.cover-photo { height: 210px; background: #2a1d14 center / cover no-repeat; }
@media (min-width: 720px) { .cover-photo { height: 300px; } }
.cover-title { text-align: center; padding: 22px 16px 6px; }
.cover-title h1 { font-family: var(--display); font-weight: 400; color: var(--cream); font-size: clamp(30px, 7vw, 46px); margin: 0 0 4px; letter-spacing: .01em; }
.cover-title p { margin: 0 auto; max-width: 520px; color: var(--muted); }

/* ---------- page-header band with the founder medallion (like every catalog page) ---------- */
.page-head { position: relative; margin: 34px 0 22px; }
.page-head .band { padding: 9px 16px 9px 120px; min-height: 52px; display: flex; align-items: center; }
.page-head .band-title { font-size: clamp(24px, 5.4vw, 34px); }
.page-head .count { margin-inline-start: auto; color: #e9c9a6; font-size: 13px; white-space: nowrap; padding-inline-start: 10px; }
.page-head .medallion { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 104px; pointer-events: none; }
@media (max-width: 520px) { .page-head .band { padding-left: 84px; padding-right: 12px; } .page-head .medallion { width: 76px; } .page-head .band-title { font-size: 23px; } .page-head .count { display: none; } }

/* ---------- toolbar ---------- */
.toolbar { position: sticky; top: 0; z-index: 20; background: var(--ink); border-bottom: 1px solid var(--line); padding: 10px 0 0; }
.search { position: relative; }
.search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-right: 40px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
  color: var(--muted); padding: 8px 12px 9px; font-size: 15px; font-weight: 600; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { color: var(--cream); border-bottom-color: var(--wine-light); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 0 10px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtab {
  flex: 0 0 auto; cursor: pointer; white-space: nowrap; font-size: 13.5px;
  background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px;
}
.subtab[aria-pressed="true"] { background: var(--cream); color: #2a1208; border-color: var(--cream); font-weight: 700; }

/* ---------- product grid (catalog layout: photo tile + centred text) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; padding: 0 4px; }
@media (min-width: 680px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 26px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product { text-align: center; display: flex; flex-direction: column; }
.product .ph {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; cursor: pointer;
  background: #fff; border: 0; border-radius: 16px; overflow: hidden;
  outline: 3px solid transparent; outline-offset: 3px; transition: outline-color .15s;
}
.product .ph img { width: 100%; height: 100%; object-fit: cover; }
.product.picked .ph { outline-color: var(--wine-light); }
.product h3 { font-family: var(--body); font-weight: 700; font-size: 18px; line-height: 1.25; margin: 12px 0 2px; color: #fff; }
.product .sku { color: var(--gold); font-size: 12.5px; }
.product .desc { color: #cfc6ba; font-size: 13.5px; line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product .actions { margin-top: auto; padding-top: 12px; }

.badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; }
.badge.k { background: var(--wine); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid #c9a35a; }
.seal {
  position: absolute; top: 6px; left: 6px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; transform: rotate(-12deg);
  background: var(--wine); color: var(--cream); font-family: var(--display); font-size: 14px;
  box-shadow: 0 0 0 2px var(--wine), 0 0 0 3px var(--cream);
}
.picked-mark {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 4px; font-size: 13px; font-weight: 700;
  background: var(--wine); color: #fff; transform: translateY(100%); transition: transform .15s;
}
.product.picked .picked-mark { transform: none; }

.pick-btn {
  width: 100%; cursor: pointer; padding: 9px 8px; border-radius: 6px; font-weight: 700; font-size: 14.5px;
  background: transparent; color: var(--cream); border: 1px solid #6b5a49;
}
.pick-btn:hover { border-color: var(--cream); }
.pick-btn[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: #fff; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.footnote { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 30px; }

/* ---------- selection bar ---------- */
.sample-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--ink);
  padding: 0 0 env(safe-area-inset-bottom); transform: translateY(110%); transition: transform .2s;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .6);
}
.sample-bar::before { content: ""; display: block; height: 8px; background: var(--wine) repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 2px, transparent 2px 5px); }
.sample-bar.show { transform: none; }
/* two rows: the count sits above the Netlify badge (bottom-right, ~64px tall),
   the button sits bottom-left where the badge doesn't reach */
.sample-bar .wrap { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; padding-bottom: 12px; }
.sample-bar .count { font-weight: 700; }
.sample-bar .btn { align-self: flex-end; min-width: 150px; }
body.has-bar { padding-bottom: 130px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  border: 0; border-radius: 8px; padding: 12px 22px; font-weight: 700; font-size: 16.5px;
  background: var(--cream); color: #2a1208;
}
.btn:hover { background: #fbefcf; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.wine { background: var(--wine); color: #fff; }
.btn.wine:hover { background: var(--wine-light); }
.btn.line { background: transparent; color: var(--cream); border: 1px solid #6b5a49; }
.btn.line:hover { border-color: var(--cream); }
.btn.small { padding: 7px 14px; font-size: 14.5px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cream); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }

/* ---------- forms ---------- */
.panel { background: rgba(14, 12, 11, .92); border: 1px solid var(--line); border-top: 3px solid var(--wine); border-radius: 4px; padding: 22px 18px; }
@media (min-width: 600px) { .panel { padding: 28px 30px; } }
.panel h2 { font-family: var(--display); font-weight: 400; color: var(--cream); font-size: 22px; margin: 0 0 14px; }
.field { margin-bottom: 16px; }
.field label, fieldset.field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.opt { color: var(--muted); font-weight: 400; font-size: 14px; }
.input {
  width: 100%; padding: 11px 13px; border-radius: 6px; font-size: 16px;
  background: #0d0c0b; border: 1px solid #3d3430; color: var(--text);
}
.input::placeholder { color: #6f655c; }
.input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.input[dir="ltr"] { text-align: right; }
textarea.input { min-height: 92px; resize: vertical; }
.fineprint { color: #8a7f73; font-size: 12.5px; line-height: 1.5; text-align: center; margin: 12px 0 0; }
.err { color: var(--danger); font-size: 14px; margin-top: 4px; }
.err:empty { display: none; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 15px; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--wine-light); cursor: pointer; }
.consent label { cursor: pointer; }
.consent.invalid label { color: var(--danger); }

fieldset.field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.agent-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #3d3430; border-radius: 6px; overflow: hidden; }
.agent { position: relative; cursor: pointer; }
.agent + .agent { border-right: 1px solid #3d3430; }
.agent input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.agent span { display: block; text-align: center; padding: 11px 4px; font-weight: 600; background: #0d0c0b; transition: background .12s; }
.agent input:checked + span { background: var(--wine); color: #fff; }
.agent input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }

.sample-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.sample-list li { display: flex; align-items: center; gap: 12px; padding: 6px; background: rgba(14, 12, 11, .92); border: 1px solid var(--line); border-radius: 6px; }
.sample-list img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; background: #fff; }
.sample-list .grow { flex: 1; min-width: 0; line-height: 1.3; }
.sample-list .grow small { color: var(--gold); }
.sample-list .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 22px; padding: 0 10px; }

/* ---------- product modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .78); }
.modal .box { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-radius: 10px; }
.modal .close { position: absolute; top: 10px; left: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.modal .pimg { background: #fff; aspect-ratio: 1 / 1; max-height: 52vh; width: 100%; }
.modal .pimg img { width: 100%; height: 100%; object-fit: contain; }
.modal .body { padding: 18px 20px 22px; }
.modal h2 { font-family: var(--display); font-weight: 400; color: var(--cream); font-size: 28px; margin: 0 0 6px; }
.modal .cat { color: var(--gold); font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0 16px; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- reviews ---------- */
.rate-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid #2a2320; }
.rate-row:last-child { border-bottom: 0; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 30px; line-height: 1; color: #3f3530; cursor: pointer; margin: 0; padding: 0 1px; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--gold); }
.stars input:focus-visible + label { outline: 2px solid var(--gold); }

/* ---------- confirmation ---------- */
.done { text-align: center; padding: 10px 0 6px; }
.done img { width: 150px; margin: 0 auto 8px; }
.done h1 { font-family: var(--display); font-weight: 400; color: var(--cream); font-size: 34px; margin: 0 0 6px; }

/* ---------- terms ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 8px 0 60px; }
.legal h2 { font-family: var(--display); font-weight: 400; color: var(--cream); font-size: 22px; margin: 1.6em 0 .4em; }
.legal p, .legal li { color: #ddd4c7; }
.legal ol { padding-right: 22px; padding-left: 0; }
.legal li { margin-bottom: 6px; }
.legal .box-note { border-right: 3px solid var(--wine-light); background: rgba(14, 12, 11, .92); padding: 12px 16px; }
.legal .ver { color: var(--gold); font-size: 14px; }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }  /* no negative offsets: in RTL they create a horizontal scrollbar */
.site-foot { border-top: 1px solid var(--line); padding: 20px 0 84px; color: var(--muted); font-size: 13.5px; text-align: center; background: rgba(11, 10, 9, .85); }
.site-foot a { color: var(--muted); }

.toast { position: fixed; bottom: 104px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--cream); color: #2a1208; padding: 8px 16px; border-radius: 6px; font-weight: 700; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
