/* Seasonal themes for the shop and item pages. Chosen in the admin (Shop details → Theme).
   Classic = no class on <html>, so the shop looks exactly as before. Each theme only changes colours and adds decorations;
   it never moves or changes the shop's parts. */

/* ---------- Christmas ---------- */
html.th-christmas{--bg:#f5e9e0;--card:#fcf6f1;--ink:#6b1e22;--mute:#8c6a62;--line:#e6cfbf;--gold:#c9a46a;--shadow:0 8px 28px rgba(110,40,30,.09)}
html.th-christmas .top::after,html.th-christmas .bar::after{background:linear-gradient(to bottom,var(--bg) 0%,rgba(245,233,224,.85) 30%,rgba(245,233,224,0) 100%)}
html.th-christmas[data-page="item"] .top:after{background:linear-gradient(var(--bg),rgba(245,233,224,0))}
html.th-christmas[data-page="item"] .bar{background:rgba(245,233,224,.96)}
html.th-christmas .dv i{background:var(--gold)}
html.th-christmas .card{border-color:#ead3c0}

/* Pine branches with berries in the two top corners of the big logo */
html.th-christmas .logo{position:relative}
html.th-christmas .logo::before,html.th-christmas .logo .l1::before{content:"";position:absolute;top:0;width:clamp(104px,27vw,250px);aspect-ratio:22/17;background:url(christmas-branch.svg) no-repeat 0 0/contain;pointer-events:none;z-index:0}
html.th-christmas .logo::before{left:-20px}
html.th-christmas .logo .l1::before{right:-20px;transform:scaleX(-1)}
/* Soft twinkling lights around the logo (two sets that glow in turn) */
html.th-christmas .logo .l2::after,html.th-christmas .logo .l3::after{content:"";position:absolute;inset:0 -20px;pointer-events:none;z-index:0;animation:th-twinkle 3.2s ease-in-out infinite alternate}
html.th-christmas .logo .l2::after{background:
  radial-gradient(circle at 8% 78%,rgba(255,214,140,.9) 0,rgba(255,214,140,0) 7px),
  radial-gradient(circle at 93% 62%,rgba(255,214,140,.85) 0,rgba(255,214,140,0) 6px),
  radial-gradient(circle at 20% 92%,rgba(255,225,165,.8) 0,rgba(255,225,165,0) 5px),
  radial-gradient(circle at 82% 88%,rgba(255,225,165,.8) 0,rgba(255,225,165,0) 6px)}
html.th-christmas .logo .l3::after{animation-delay:-1.6s;background:
  radial-gradient(circle at 4% 52%,rgba(255,220,150,.85) 0,rgba(255,220,150,0) 5px),
  radial-gradient(circle at 97% 40%,rgba(255,220,150,.85) 0,rgba(255,220,150,0) 6px),
  radial-gradient(circle at 13% 64%,rgba(255,232,180,.75) 0,rgba(255,232,180,0) 4px),
  radial-gradient(circle at 88% 74%,rgba(255,232,180,.8) 0,rgba(255,232,180,0) 5px)}
@keyframes th-twinkle{from{opacity:.35}to{opacity:1}}
/* The seasonal greeting under the tagline (typed in the admin; empty = hidden) */
html.th-christmas.th-msg .logo::after{content:var(--thmsg);display:block;position:relative;z-index:1;margin:16px auto 0;max-width:32ch;font-style:italic;font-weight:500;font-size:clamp(22px,5.6vw,32px);line-height:1.15;color:var(--ink)}
html.th-christmas.th-msg .logo{padding-bottom:30px}

/* Gently falling snow (pearly flakes, so they show on the light background). Never catches taps. */
#th-snow{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:9}
#th-snow i{position:absolute;top:-12px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#f4ebe4 70%);box-shadow:0 0 3px rgba(120,60,50,.28);opacity:.85;animation:th-fall linear infinite}
@keyframes th-fall{0%{transform:translate3d(0,-12px,0)}50%{transform:translate3d(var(--dx,18px),50vh,0)}100%{transform:translate3d(0,calc(100vh + 24px),0)}}
@media (prefers-reduced-motion:reduce){#th-snow{display:none}html.th-christmas .logo .l2::after,html.th-christmas .logo .l3::after{animation:none;opacity:.8}}

/* Preview pill: only on the phone or computer that opened a preview from the admin */
#th-pv{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:19;display:flex;align-items:center;gap:10px;background:#3b3331;color:#f6ede8;border-radius:999px;padding:6px 6px 6px 16px;font:500 16px/1.2 "Cormorant Garamond",Georgia,serif;box-shadow:0 6px 20px rgba(0,0,0,.25);white-space:nowrap}
#th-pv a{color:#3b3331;background:#f6ede8;border-radius:999px;padding:4px 12px;text-decoration:none}
html[data-page="item"] #th-pv{bottom:calc(86px + env(safe-area-inset-bottom,0px))}

/* ---------- Christmas: the top of the shop ---------- */
/* Icon buttons in the top row: a parcel (My orders) and a bag with the number of things in it (Cart). My pearls is the chip under the search bar and in the ☰ menu. */
html.th-christmas .top .r>.btn,html.th-christmas .top .r>.pri,html.th-christmas[data-page="item"] #cartb{display:none}
html.th-christmas .top .r{gap:4px}
html.th-christmas .top .ti{display:grid;place-items:center;position:relative;width:46px;height:46px;padding:0;border:0;border-radius:50%;background:none;color:var(--ink);text-decoration:none;-webkit-tap-highlight-color:transparent}
html.th-christmas .top .ti:hover{background:rgba(107,30,34,.06)}
html.th-christmas .top .ti svg{width:28px;height:28px;fill:none;stroke:var(--ink);stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}
html.th-christmas .top .ti b{position:absolute;right:0;bottom:2px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#fff;color:var(--ink);font-weight:600;font-size:13px;line-height:20px;text-align:center;box-shadow:0 1px 4px rgba(90,30,25,.25)}
/* the round ☰ / ‹ buttons: soft frosted circles */
html.th-christmas .top .mb,html.th-christmas[data-page="item"] .top .bk{border:0;background:rgba(255,255,255,.6);box-shadow:0 2px 10px rgba(110,40,30,.12);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}

/* Photo header (V42): the photo fills the top of the shop, from the top of the screen down to the search bar, behind the real logo.
   The headline and button sit on the left (on phones under the logo, next to the gift; on computers to the left of the logo).
   The photo is #th-hero (added by theme.js); picture = admin → Theme → Banner picture, standard = christmas-header.jpg. */
html.th-banner{--hh:410px}   /* phones: see the bottom menu section below (was 470px without the bottom menu, before V111) */
/* phones (V54): the taller phone copy of the photo, so the candle, gift and snow globe sit beside the Explore button, clear of the tagline */
#th-hero{position:absolute;top:0;right:0;height:var(--hh);aspect-ratio:1254/1444;min-width:100%;background:var(--him) right top/cover no-repeat;   /* min-width: on phones wider than the photo it still reaches the left edge */
  z-index:-1;pointer-events:none;
  -webkit-mask-image:linear-gradient(to bottom,#000 84%,transparent 100%);mask-image:linear-gradient(to bottom,#000 84%,transparent 100%)}
/* the frosted glass top once you scroll (V54, Elias chose "light"): a blurred copy of the photo behind the top bar and the locked search bar */
#th-glass{display:none;position:fixed;left:0;right:0;top:0;z-index:10;overflow:hidden;pointer-events:none;background:#f3e2d6;
  -webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 14px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 14px),transparent)}
#th-glass i{position:absolute;top:0;right:0;background-size:cover;background-repeat:no-repeat;filter:blur(4px) saturate(1.1);will-change:transform}
#th-glass::after{content:"";position:absolute;inset:0;background:rgba(245,229,216,.25)}
html.th-banner body.scr .top,html.th-banner body.scr .top::before,html.th-banner body.scr .bar,html.th-banner body.scr .bar::before{background:transparent}
html.th-banner body.scr .top::after,html.th-banner body.scr .bar::after{display:none}
html.th-banner body.scr .mini{text-shadow:0 0 6px rgba(245,233,224,.95),0 0 14px rgba(245,233,224,.9)}
/* the top bar and search bar are see-through while the photo is showing, solid again once you scroll */
html.th-banner body:not(.scr) .top,html.th-banner body:not(.scr) .top::before,html.th-banner body:not(.scr) .bar,html.th-banner body:not(.scr) .bar::before{background:transparent}
html.th-banner body:not(.scr) .top::after,html.th-banner body:not(.scr) .bar::after{display:none}
/* the photo has its own branches, so the drawn ones step aside; a soft glow keeps the logo easy to read */
html.th-banner .logo::before,html.th-banner .logo .l1::before{display:none}
html.th-banner .logo .lh,html.th-banner .logo .l3{text-shadow:0 0 6px rgba(245,233,224,.9),0 0 16px rgba(245,233,224,.8)}
html.th-banner .logo::after{content:none!important}
html.th-christmas.th-banner .logo{padding:14px 0 10px}
/* smaller logo on phones, like Elias's mockup, so the top stays short */
html.th-banner .l1{font-size:clamp(46px,11vw,80px)}
html.th-banner .l2{font-size:clamp(24px,5.6vw,36px)}
html.th-banner .dv{margin:10px 0 2px}
html.th-banner .l3{margin-top:10px;font-size:11px}
/* headline + button */
html.th-christmas.th-banner .tban{display:block;margin:0 0 8px}
.tban .tbi,.tban::before{display:none}
.tban .tbt{position:relative;z-index:1;width:56%;display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:6px 0 18px 2px}
.tban h2{margin:0;font-style:italic;font-weight:500;font-size:clamp(26px,7.4vw,50px);line-height:1.04;color:var(--ink);text-wrap:balance;text-shadow:0 0 10px rgba(245,233,224,.9)}
.tban .tbd{display:flex;align-items:center;gap:8px;color:var(--ink);font-size:18px;line-height:1;width:min(100%,150px)}.tban .tbd i{flex:1;height:1px;background:var(--gold)}
.tban button{font-size:14px;padding:8px 14px;white-space:nowrap;box-shadow:0 6px 16px rgba(107,30,34,.25)}
.tban button span{margin-left:6px}
@media (min-width:760px){
  html.th-banner{--hh:420px}
  /* computers (V55): the wide photo runs across the whole top. It fits the screen's width; on narrower screens it moves a little right so the
     branch stays clear of the cart icon, on very wide screens a little up so the snow globe stays above the search bar. */
  #th-hero{left:0;width:auto;height:calc(var(--hh) + 40px);aspect-ratio:auto;min-width:0;
    --sx:clamp(0px, (1600px - 100vw) * .18, 60px);
    background-image:var(--hiw);background-size:min(calc(100% + var(--sx)), 1700px) auto;   /* at most 1700 px wide, so it isn't blown up on big monitors */
    background-position:right calc(0px - var(--sx)) top min(0px, calc((460px - min(100vw, 1700px) * .3125) * .8));
    -webkit-mask-image:linear-gradient(to bottom,#000 68%,transparent 100%),linear-gradient(to right,transparent calc(100% - 1700px),#000 calc(100% - 1450px));
    mask-image:linear-gradient(to bottom,#000 68%,transparent 100%),linear-gradient(to right,transparent calc(100% - 1700px),#000 calc(100% - 1450px));-webkit-mask-composite:source-in;mask-composite:intersect}
  html.th-christmas.th-banner .logo{padding:30px 0 70px}
  html.th-banner .l1{font-size:clamp(64px,8vw,96px)}
  html.th-banner .l2{font-size:clamp(30px,3.4vw,40px)}
  html.th-banner .l3{font-size:13px;margin-top:14px}
  html.th-banner .wrap{position:relative}
  html.th-christmas.th-banner .tban{position:absolute;left:20px;top:calc(var(--toph) + 40px);width:min(30%,380px);margin:0;z-index:3}
  .tban .tbt{width:100%;padding:0}
  .tban h2{font-size:clamp(30px,3.4vw,46px)}
}

/* Frosted search bar with a magnifying glass */
html.th-christmas .bar input{background:rgba(255,255,255,.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b1e22' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20 20'/%3E%3C/svg%3E") no-repeat 18px 50%/22px 22px;
  padding:11px 20px 11px 52px;border:1px solid rgba(255,255,255,.85);box-shadow:0 6px 20px rgba(110,40,30,.09),inset 0 1px 0 rgba(255,255,255,.9);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
html.th-christmas .bar input:focus{border-color:var(--gold)}
html.th-christmas .bar input::placeholder{color:var(--mute)}

/* ---------- Bottom menu layout (phones only; permanent since V110) ---------- */
#th-pv{max-width:calc(100vw - 20px)}
@media (max-width:859px){
  html.lay-bm #th-pv,html.lay-bm[data-page="item"] #th-pv{bottom:calc(var(--bnh,0px) + 10px)}
  html.lay-bm.th-banner{--hh:410px}   /* the top of the shop is shorter without the top buttons: the photo moves up a little so the gift still sits beside the Explore button */
  html.lay-bm #th-hero{background-position:right -34px;-webkit-mask-image:linear-gradient(to bottom,#000 88%,transparent 100%);mask-image:linear-gradient(to bottom,#000 88%,transparent 100%)}
}
@media (max-width:380px){#th-pv{font-size:14px;padding-left:12px;gap:8px}}

/* ---------- Top of the shop on phones: Standard / Compact / Side by side (V107, admin → Theme) ----------
   Phones and the app only (up to 759 px); computers always keep the standard top. Only with the Christmas photo header (th-banner).
   Compact = same arrangement, everything smaller. Side by side = logo + Explore button on the left, the gift on the right, no headline.
   The square photo sits on the right (--ph = its size, --py = how far it's moved up) over a softly blurred copy filling the rest;
   the frosted top once you scroll copies the sharp photo (theme.js). */
@media (max-width:759px){
  html.th-banner.th-top-compact{--hh:330px;--ph:335px;--py:0px}
  html.th-banner.th-top-side{--hh:250px;--ph:310px;--py:-70px}
  html.th-banner.th-topx #th-hero{background:none!important;left:0;right:0;width:auto;min-width:0;aspect-ratio:auto;height:var(--hh);
    -webkit-mask-image:linear-gradient(to bottom,#000 78%,transparent 100%);mask-image:linear-gradient(to bottom,#000 78%,transparent 100%)}
  /* V109: the shorter tops use their own wide photo (admin → Theme → Picture for the shorter phone tops), filling the whole top */
  html.th-banner.th-topx #th-hero::after{content:"";position:absolute;inset:0;background:var(--his) right bottom/cover no-repeat}
  /* Compact */
  html.th-christmas.th-banner.th-top-compact .logo{padding:4px 0 2px}
  html.th-banner.th-top-compact .l1{font-size:38px}
  html.th-banner.th-top-compact .l2{font-size:21px}
  html.th-banner.th-top-compact .dv{margin:6px 0 0}
  html.th-banner.th-top-compact .l3{font-size:9px;margin-top:6px}
  html.th-banner.th-top-compact .tban .tbt{gap:6px;padding:6px 0 8px 2px;width:52%}
  html.th-banner.th-top-compact .tban h2{font-size:23px}
  html.th-banner.th-top-compact .tban .tbd{width:110px}
  html.th-banner.th-top-compact .tban button{font-size:12px;padding:6px 12px}
  /* Side by side */
  html.th-christmas.th-banner.th-top-side .logo{width:60%;max-width:60%;margin:0;padding:10px 0 4px}
  html.th-banner.th-top-side .l1{font-size:40px}
  html.th-banner.th-top-side .l2{font-size:22px}
  html.th-banner.th-top-side .dv{margin:6px 0 0}
  html.th-banner.th-top-side .l3{font-size:8px;margin-top:6px;letter-spacing:.14em}
  html.th-banner.th-top-side .tban h2,html.th-banner.th-top-side .tban .tbd{display:none}
  html.th-banner.th-top-side .tban .tbt{width:58%;align-items:center;padding:4px 0 12px}
  html.th-banner.th-top-side .tban button{font-size:12px;padding:6px 12px}
  @media (max-width:380px){html.th-banner.th-top-side .l3{font-size:7px;letter-spacing:.08em}}
}
