/* Georgian: BPG Tahoma Glaho. Varela and Inter have no Georgian letters, so Georgian text falls through to --ka. */
@font-face { font-family: "BPG Tahoma Glaho"; src: url("/fonts/bpg-tahoma-glaho.woff2") format("woff2"); font-display: swap; }
:root {
  --ka: "BPG Tahoma Glaho";
  --bg: #f4efe6; --paper: #fbf8f2; --ink: #211b17; --muted: #7b7068; --line: #ddd4c6; --accent: #7a2e2a;
  --ok: #3d6b3d; --chip: rgba(251,248,242,.88); color-scheme: light;
  --serif: Varela, var(--ka), "Noto Sans Georgian", Georgia, serif;
  --sans: Inter, var(--ka), "Noto Sans Georgian", system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #16120f; --paper: #1f1a16; --ink: #efe7da; --muted: #9d9287; --line: #352d26; --accent: #e08f86;
  --ok: #7fb37f; --chip: rgba(31,26,22,.88); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; transition: background-color .25s, color .25s; background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.top, main, .foot { width: min(1180px, 100% - 32px); margin-inline: auto; }
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding-block: 22px 0; }
.top .brand { grid-column: 2; grid-row: 1; }
.top .top-r { grid-column: 3; grid-row: 1; justify-content: flex-end; align-self: start; }
.brand { display: flex; align-items: baseline; justify-content: center; gap: 14px; }
.brand-en { font: 400 33px/1 var(--serif); letter-spacing: .04em; }
.brand-ka { font: 400 21px var(--serif); color: var(--muted); }
.top-r { display: flex; align-items: center; gap: 18px; }
.theme { display: inline-flex; align-items: center; justify-content: center; line-height: 0; width: 34px; height: 34px; margin-left: 10px; background: var(--chip); border: 1px solid var(--line); border-radius: 50%; padding: 0; font: 400 17px/1 var(--sans); color: var(--muted); cursor: pointer; }
.theme:hover { color: var(--accent); border-color: var(--accent); }
.ig, .foot a, .back { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.ig { display: inline-flex; line-height: 0; }
.foot .icons { display: flex; gap: 16px; align-items: center; }
.ig:hover, .foot a:hover, .back:hover { color: var(--accent); }

main { padding-block: 4px 72px; }
.intro h1 { font: 400 clamp(22px, 3.4vw, 33px)/1.15 var(--serif); margin: 0 0 32px; letter-spacing: .01em; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 0 0 30px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; margin-bottom: -1px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; transition: color .2s; }
.tabs a:first-child { padding-left: 0; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 20px; }
.card .ph { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--line); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .ph img { transform: scale(1.03); }
.card.sold .ph img { opacity: .55; }
.tag { position: absolute; left: 10px; top: 10px; background: var(--paper); color: var(--ink); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; }
.meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-top: 10px; }
.meta h2 { margin: 0; font: 400 16.5px/1.2 var(--serif); }
.price { color: var(--muted); white-space: nowrap; }
.empty { color: var(--muted); padding: 40px 0; }

.back { display: inline-block; margin-bottom: 22px; }
.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.main { position: relative; background: var(--line); aspect-ratio: 3 / 4; overflow: hidden; }
.main img { width: 100%; height: 100%; object-fit: cover; }
.nav { position: absolute; top: 0; bottom: 0; width: 22%; border: 0; padding: 0 14px; background: none; cursor: pointer; display: flex; align-items: center; color: #fff; -webkit-tap-highlight-color: transparent; }
.nav.prev { left: 0; justify-content: flex-start; background: linear-gradient(90deg, rgba(33,27,23,.28), transparent); }
.nav.next { right: 0; justify-content: flex-end; background: linear-gradient(270deg, rgba(33,27,23,.28), transparent); }
.nav span { font: 300 44px/1 var(--serif); text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.nav { opacity: 0; transition: opacity .25s ease; }
.main:hover .nav, .nav:focus-visible { opacity: 1; }
@media (hover: none) { .nav { opacity: .75; background: none !important; } .nav span { font-size: 36px; } }
.count { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: var(--chip); font-size: 11px; letter-spacing: .08em; padding: 2px 10px; border-radius: 99px; pointer-events: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; margin-top: 10px; }
.thumb { padding: 0; border: 2px solid transparent; background: none; cursor: pointer; aspect-ratio: 1; opacity: .7; }
.thumb.on, .thumb:hover { opacity: 1; border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.info { position: sticky; top: 24px; }
.info h1 { font: 400 clamp(25px, 3.4vw, 37px)/1.1 var(--serif); margin: 0 0 8px; }
.price.big { font-size: 22px; color: var(--ink); margin: 0 0 6px; }
.stock { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 22px; }
.stock.in { color: var(--ok); } .stock.out { color: var(--accent); }
.desc p { margin: 0 0 12px; max-width: 46ch; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chat-hint { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); max-width: 46ch; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 10; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.cta { display: inline-block; padding: 11px 22px; border: 1px solid var(--ink); font-size: 13px; letter-spacing: .05em; transition: .2s; }
.cta:hover { background: var(--ink); color: var(--bg); }

.foot { display: flex; justify-content: space-between; padding-block: 24px 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  .top { grid-template-columns: 1fr; justify-items: center; gap: 8px; padding-block: 16px 0; }
  .top .brand, .top .top-r { grid-column: 1; }
  .top .top-r { grid-row: 2; justify-content: center; }
  .top .brand { grid-row: 1; }
  .brand-en { font-size: 31px; } .brand-ka { font-size: 19px; }
}
@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; gap: 24px; }
  .info { position: static; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .meta { flex-direction: column; gap: 0; }
  .meta h2 { font-size: 15.5px; }
  main { padding-block: 28px 56px; }
}

:root { --logo-h: 168px; }
.logo { display: block; height: var(--logo-h); width: auto; color: var(--ink); }
@media (max-width: 720px) { :root { --logo-h: 136px; } }
.logo-mini { height: 80px; }
@media (max-width: 720px) { .logo-mini { height: 68px; } }

/* ---- home page: photo hero + category bar ----
   A strip with the language switch, links and theme button stays fixed at the top. The category bar starts
   over the photo, stays put while the photo scrolls away beneath it, then rides up with the photo's bottom
   edge and sticks under the strip (the script in homePage drives that). */
.hero-page { --strip-h: 52px; --bar-y: calc(22px + var(--logo-h) + 26px); }
@media (max-width: 720px) { .hero-page { --strip-h: 48px; --bar-y: calc(var(--strip-h) + var(--logo-h) + 20px); } }
.hero { position: relative; height: 100vh; height: 100svh; min-height: 540px; background: #e9ebe6;
  /* the photo is light in both themes, so the text on it keeps its own colours */
  --ink: #34302d; --muted: #5e5650; --line: #8a7d75; --accent: #7a2e2a; --chip: rgba(255,255,255,.6); color: var(--ink); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; }
@media (max-width: 720px) { .hero-img { object-position: 18% 50%; } }   /* phones: keep the open sky, not just the flock */
.hero .top { position: relative; z-index: 1; }
@media (max-width: 720px) { .hero .top { padding-block-start: var(--strip-h); } }
.hero .logo { color: var(--ink); }
.bar-mark { position: absolute; left: 0; top: var(--bar-y); width: 1px; height: 1px; }
.hero-h { position: absolute; z-index: 1; margin: 0; left: max(16px, calc((100% - 1180px) / 2)); top: calc(var(--bar-y) + 92px);
  max-width: 13em; font: 400 clamp(24px, 3vw, 50px)/1.25 var(--serif); letter-spacing: .01em; color: #6f5f58; }
/* Georgian letters are wider and the line is longer: smaller, and wrapped to stay in the sky */
html[lang="ka"] .hero-h { font-size: clamp(21px, 2.3vw, 38px); max-width: 13em; line-height: 1.3; }
@media (max-width: 720px) { .hero-h { top: calc(var(--bar-y) + 72px); max-width: 11em; font-size: 26px; } html[lang="ka"] .hero-h { font-size: 21px; max-width: 12em; } }

/* fixed top strip: language switch (left), links + theme (right) */
.strip { position: fixed; z-index: 6; top: 0; left: 0; right: 0; height: var(--strip-h); display: flex; align-items: center; justify-content: space-between;
  padding-inline: max(16px, calc((100% - 1180px) / 2)); background: var(--bg); border-bottom: 1px solid var(--line); transition: background-color .2s, border-color .2s; }
.strip .lang { position: static; margin: 0; align-self: center; justify-self: auto; }
.strip .top-r { gap: 16px; }
.strip .theme { margin-left: 4px; }
/* at the very top it is see-through, over the photo's own colours */

.bar-fb .strip { background: color-mix(in srgb, var(--bg) calc(var(--p, 0) * 100%), transparent); border-bottom-color: color-mix(in srgb, var(--line) calc(var(--p, 0) * 100%), transparent); transition: none; }
.bar-fb .strip:not(.solid) { --ink: #34302d; --muted: #5e5650; --line: #7b6d65; --accent: #7a2e2a; --chip: rgba(255,255,255,.6); color: var(--ink); }

/* Scroll-driven version. Positioning is all native scrolling (nothing a late animation frame can pull out of place):
   - the photo is made one bar-height taller than the screen, and the real bar (sticky, under the strip) has its natural spot
     hidden behind the photo's last bar-height, so it only shows once the photo has gone;
   - a copy of the bar, sticky inside the photo, stays pinned over it and then rides along under the photo's bottom edge;
   - the two meet at the same place (just under the strip), and the copy fades out as the real bar takes over.
   Animations only change colour/opacity (strip + bar fade to solid as the photo's edge crosses them). H = photo height. */
.hero-page { --bar-h: 54px; --hero-h: calc(max(100svh, 540px) + var(--bar-h)); }
@media (max-width: 720px) { .hero-page { --bar-h: 48px; } }
@keyframes strip-solid { from { background-color: transparent; border-bottom-color: transparent; --ink: #34302d; --muted: #5e5650; --line: #7b6d65; --accent: #7a2e2a; --chip: rgba(255,255,255,.6); color: #34302d; } }
@keyframes bar-solid { from { background-color: transparent; --ink: #34302d; --muted: #5e5650; --line: #7b6d65; --accent: #7a2e2a; --chip: rgba(255,255,255,.6); color: #34302d; } }
@keyframes bar-out { to { opacity: 0; } }
@supports (animation-timeline: scroll()) {
  .bar-js .hero { height: var(--hero-h); min-height: 0; z-index: 2; }
  .bar-js .strip { animation: strip-solid linear both; animation-timeline: scroll(root); animation-range: calc(var(--hero-h) - var(--strip-h)) var(--hero-h); transition: none; }
  .bar-js .hero-page main { padding-top: calc(var(--bar-h) + 30px); }
  .bar-js .bar:not(.bar-pin) { margin-top: calc(var(--bar-h) * -1); z-index: 1; }
  .bar-js .bar-pin { position: sticky; top: var(--bar-y); margin-bottom: calc(var(--bar-h) * -1);
    animation: bar-solid linear both, bar-out linear both; animation-timeline: scroll(root), scroll(root);
    animation-range: calc(var(--hero-h) - var(--bar-y) - var(--bar-h)) calc(var(--hero-h) - var(--bar-y)), calc(var(--hero-h) - var(--strip-h)) calc(var(--hero-h) - var(--strip-h) + 12px); }
}

.bar { position: sticky; top: var(--strip-h); z-index: 5; background: var(--bg); border-block: 1px solid var(--line); }
.bar-in { width: min(1180px, 100% - 32px); margin-inline: auto; display: flex; align-items: stretch; }
.bar .tabs { margin: 0; border: 0; min-width: 0; }
/* nothing is highlighted until the visitor clicks a tab or scrolls down to the products */
.tab-idle .bar .tabs a.on { color: var(--muted); border-bottom-color: transparent; }
.bar .tabs a { display: flex; align-items: center; padding: 16px 16px; font-size: 16px; }
.bar-in > span { flex: 1; min-height: 48px; }
.hero-page main { padding-top: 30px; min-height: 100vh; min-height: 100svh; }  /* long enough that a tab click can always jump to the top of the products */
/* (unused) */ .bar.over-x { --ink: #34302d; --muted: #5e5650; --line: #7b6d65; --accent: #7a2e2a; --chip: rgba(255,255,255,.6); color: var(--ink); }
@media (max-width: 720px) { .bar .tabs a { padding: 14px 12px; font-size: 15px; } .strip .top-r { gap: 12px; } }

/* language switch: small text toggle, top-left of the header */
.lang { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; display: inline-flex; align-items: center; margin-top: 6px; font-size: 13px; letter-spacing: .08em; }
.lang a { display: block; height: 22px; line-height: 20px; padding: 0 1px; color: var(--muted); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.lang a + a { position: relative; margin-left: 20px; }
.lang a + a::before { content: "·"; position: absolute; left: -12px; top: 0; width: 4px; text-align: center; color: var(--muted); opacity: .5; pointer-events: none; }
.lang a:hover { color: var(--ink); }
.lang a.on { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 720px) {
  .top { position: relative; }
  .lang { position: absolute; left: 0; top: 16px; margin-top: 0; }
}
/* Georgian has no capitals: don't force uppercase on labels */
:lang(ka) .tag, :lang(ka) .stock { text-transform: none; letter-spacing: .02em; }
/* Glaho has a single weight, so no bold or medium for Georgian headings */
