/* EduBasket. Mobile first: wider layouts start at 640px, 760px and 860px. */
:root{
  --bg:#fbfbf7;--surface:#fff;--ink:#14213d;--muted:#5b6478;--line:#d9e2f1;
  --accent:#1f4fd8;--accent-ink:#fff;--hi:#ffe14d;--margin:#e0525a;--ok:#1d7a4a;
  --wa:#15803d;--wa-hover:#166534;--shade:rgba(10,15,30,.55);
  --hh:58px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root{--bg:#0f1526;--surface:#18203a;--ink:#eef1fa;--muted:#a3adc7;--line:#2b365a;--accent:#7fa2ff;--accent-ink:#0f1526;--margin:#ff7a80;--ok:#5fd295;--shade:rgba(0,0,0,.65);color-scheme:dark}
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--hh) + 16px);-webkit-text-size-adjust:100%}
html.lock{overflow:hidden}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 "Instrument Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
h1,h2,h3,h4{font-family:"Bricolage Grotesque","Trebuchet MS",sans-serif;line-height:1.12;margin:0}
p{margin:0}
a{color:inherit}
button{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.wrap{max-width:1120px;margin:0 auto;padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left))}
.i{width:20px;height:20px;flex:none;display:block}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip{position:absolute;left:-999px;top:8px;z-index:100;background:var(--ink);color:var(--bg);padding:10px 14px;border-radius:8px}
.skip:focus{left:8px}
.muted{color:var(--muted)}

/* Header */
.top{position:sticky;top:0;z-index:30;background:var(--bg);border-bottom:2px solid var(--line);padding-top:env(safe-area-inset-top)}
.bar{display:flex;align-items:center;gap:6px;height:var(--hh)}
.logo{font:800 24px "Bricolage Grotesque",sans-serif;text-decoration:none;margin-right:auto;letter-spacing:-.01em}
.logo span{background:var(--hi);color:#14213d;padding:0 5px;border-radius:4px;margin-right:1px}
.nav{position:absolute;left:0;right:0;top:100%;display:none;flex-direction:column;background:var(--bg);border-bottom:2px solid var(--line);padding:4px 16px 10px;box-shadow:0 16px 24px -16px rgba(0,0,0,.3)}
.nav.open{display:flex}
.nav a{padding:13px 2px;font-weight:600;font-size:17px;text-decoration:none;border-bottom:1px solid var(--line)}
.nav a:last-child{border-bottom:0}
.icon-btn{width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:10px;background:none;color:var(--ink);cursor:pointer}
.icon-btn:hover{background:var(--line)}
.basket-btn{position:relative;display:flex;align-items:center;gap:7px;height:42px;padding:0 13px;border:2px solid var(--ink);border-radius:10px;background:var(--surface);font-weight:700;cursor:pointer}
.badge{position:absolute;top:-9px;right:-9px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--margin);color:#fff;font-size:12px;display:grid;place-items:center}
.bump{animation:bump .35s}
@keyframes bump{40%{transform:scale(1.3)}}
@media (min-width:860px){
  .nav{position:static;display:flex;flex-direction:row;gap:22px;padding:0;margin-right:14px;border:0;box-shadow:none;background:none}
  .nav a{padding:6px 0;border:0;font-size:15px;font-weight:500}
  .nav a:hover{color:var(--accent)}
  .menu-btn{display:none}
}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:10px 18px;border:2px solid transparent;border-radius:10px;background:var(--accent);color:var(--accent-ink);font:600 16px/1.2 "Instrument Sans",sans-serif;text-align:center;text-decoration:none;cursor:pointer;transition:transform .08s}
.btn:active{transform:scale(.97)}
.btn:not(.alt):hover{filter:brightness(1.08)}
.btn.alt{background:transparent;color:var(--ink);border-color:var(--ink)}
.btn.alt:hover{background:var(--surface)}
.btn.wa{background:var(--wa);color:#fff}
.btn.wa:hover{background:var(--wa-hover);filter:none}
.btn.block{width:100%}
.btns{display:flex;flex-wrap:wrap;gap:10px}
.btns .btn{flex:1 1 auto}
@media (min-width:640px){.btns .btn{flex:0 0 auto}}

/* Hero */
.hero{padding:22px 0 8px}
.hero-grid{display:grid;gap:20px}
.paper{background:repeating-linear-gradient(transparent 0 35px,var(--line) 35px 36px);border-left:3px solid var(--margin);margin-left:4px;padding:10px 0 18px 16px}
.paper h1{font-size:clamp(34px,9.4vw,62px);font-weight:800;letter-spacing:-.02em;max-width:11em;margin-bottom:14px}
.paper h1 mark{background:var(--hi);color:#14213d;padding:0 6px;border-radius:3px;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.lead{font-size:18px;color:var(--muted);max-width:30em;width:fit-content;background:var(--bg);margin-bottom:20px}
@media (min-width:860px){
  .hero{padding:44px 0 12px}
  .hero-grid{grid-template-columns:1.3fr 1fr;align-items:center;gap:40px}
  .lead{font-size:19px}
}

/* Kit */
.kit{position:relative;overflow:hidden;background:#14544f;color:#f6e7b8;border-radius:18px;padding:20px;box-shadow:0 18px 40px -24px rgba(20,84,79,.8)}
.kit:empty{display:none}
.kit-art{position:absolute;right:-16px;top:-12px;width:132px;height:146px;opacity:.16;pointer-events:none}
.kit-label{font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#ffd166}
.kit h2{font-size:clamp(25px,6.5vw,30px);color:#f6e7b8;margin-top:4px;max-width:75%}
.kit .ks{font-size:15px;margin-top:6px;max-width:80%}
.kp{margin:14px 0 16px;font:800 clamp(36px,10vw,44px)/1 "Bricolage Grotesque",sans-serif;color:#ffd166}
.kp span{display:block;font:500 14px "Instrument Sans",sans-serif;color:#f6e7b8;margin-bottom:4px}
.kp small{font-size:.55em;opacity:.8}
.kit-actions{display:flex;flex-wrap:wrap;gap:10px}
.kit-actions .buy{flex:1 1 170px;margin:0}
.kit-actions .btn.ghost{flex:1 1 150px;background:transparent;color:#f6e7b8;border-color:#f6e7b8;filter:none}
.kit .buy .btn.add,.kit .buy .step{background:#ffd166;color:#14544f}
.kit .buy .btn,.kit .step{min-height:48px;height:48px}
.kit :focus-visible{outline-color:#ffd166}
.kit-list{margin-top:16px}
.kit-list ol{margin:6px 0 0;padding-left:22px;line-height:1.75;font-size:15px}

/* How it works */
.how{list-style:none;margin:20px 0 0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.how li{display:flex;flex-direction:column;gap:8px;background:var(--surface);border:2px solid var(--line);border-radius:14px;padding:12px}
.how b{width:30px;height:30px;border-radius:50%;background:var(--hi);color:#14213d;display:grid;place-items:center;font:800 16px "Bricolage Grotesque",sans-serif}
.how strong{display:block;font-size:14px;line-height:1.25}
.how em{display:none;font-style:normal;color:var(--muted);font-size:15px}
@media (min-width:640px){
  .how{gap:12px}
  .how li{flex-direction:row;align-items:flex-start;gap:12px;padding:14px 16px}
  .how b{flex:none}
  .how strong{font-size:16px}
  .how em{display:block}
}

/* Sections */
.sec{padding:40px 0}
.title{font-size:clamp(28px,6.5vw,38px);letter-spacing:-.01em}
.sub{color:var(--muted);margin:6px 0 16px}
.h3{font-size:19px;margin:18px 0 6px}

/* Shop */
.shop{padding-bottom:16px}
.tools{display:grid;grid-template-columns:1fr auto;gap:8px}
input,select,textarea{font:inherit;font-size:16px;color:var(--ink);background:var(--surface);border:2px solid var(--line);border-radius:10px;padding:11px 12px;width:100%;min-height:48px}
textarea{resize:vertical;line-height:1.45}
select{width:auto;max-width:44vw;cursor:pointer}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 25%,transparent)}
.search{position:relative;display:block}
.search .i{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.search input{padding-left:42px}
.chips-bar{position:sticky;top:calc(var(--hh) + 2px + env(safe-area-inset-top));z-index:20;background:var(--bg);padding:10px 0}
.chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:2px 16px;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 14px;border:2px solid var(--line);border-radius:20px;background:var(--surface);font-size:15px;font-weight:600;white-space:nowrap;cursor:pointer}
.chip:hover{border-color:var(--accent)}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
@media (min-width:860px){
  .chips-bar{position:static}
  .chips{flex-wrap:wrap;overflow:visible;margin:0;padding:0;-webkit-mask-image:none;mask-image:none}
}
#results{scroll-margin-top:calc(var(--hh) + 72px)}
.count{color:var(--muted);font-size:14px;margin:2px 0 10px;min-height:1.5em}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
@media (min-width:640px){.grid{grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:14px}}

/* Product card */
.card{display:flex;flex-direction:column;background:var(--surface);border:2px solid var(--line);border-radius:14px;overflow:hidden}
.tile{display:grid;place-items:center;height:96px;font-size:46px;line-height:1;background:var(--k,#eef2ff);cursor:pointer;user-select:none}
@media (prefers-color-scheme:dark){.tile{background:color-mix(in srgb,var(--k,#eef2ff) 30%,var(--surface))}}
@media (min-width:640px){.tile{height:118px;font-size:54px}}
.card .in{display:flex;flex-direction:column;gap:3px;flex:1;padding:10px 10px 12px}
@media (min-width:640px){.card .in{padding:12px 14px 14px}}
.pn{font:600 15px/1.3 "Instrument Sans",sans-serif}
.pn button{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;padding:0;border:0;background:none;text-align:left;cursor:pointer}
.pn button:hover{color:var(--accent)}
.meta{color:var(--muted);font-size:13px;line-height:1.35}
.price{font-weight:700;font-size:17px;margin-top:auto;padding-top:4px}
.out-tag{display:block;color:var(--margin);font-size:12px;font-weight:700}
.card.out .tile{filter:grayscale(.8);opacity:.6}
.buy{margin-top:8px}
.buy .btn{width:100%;min-height:42px;padding:8px 10px;font-size:15px}
.card .buy [data-ask]{font-size:14px;gap:6px;white-space:nowrap}
@media (max-width:639px){.card .buy [data-ask] .i{display:none}}
.step{display:flex;align-items:center;justify-content:space-between;height:42px;border-radius:10px;background:var(--accent);color:var(--accent-ink);overflow:hidden}
.step button{width:46px;height:100%;display:grid;place-items:center;border:0;background:none;color:inherit;cursor:pointer}
.step button:hover{background:rgba(255,255,255,.14)}
.step button:disabled{opacity:.4;cursor:default}
.step button:focus-visible{outline-offset:-3px}
.step span{font-weight:700;font-size:17px;min-width:2ch;text-align:center}
.empty{padding:28px 16px;text-align:center;color:var(--muted);border:2px dashed var(--line);border-radius:14px;margin-top:14px}
.empty .btns{justify-content:center;margin-top:14px}

/* Boxes and forms */
.two{display:grid;gap:16px}
@media (min-width:760px){.two{grid-template-columns:1fr 1fr;gap:22px;align-items:start}}
.box{background:var(--surface);border:2px solid var(--line);border-radius:16px;padding:20px}
.box h2{font-size:clamp(25px,6vw,30px);margin-bottom:8px}
.box.hi{background:var(--hi);color:#14213d;border-color:#14213d}
.form{display:grid;gap:12px}
.form .btn{margin-top:4px}
label{display:grid;gap:5px;font-weight:600;font-size:14px}
.opt{font-weight:400;color:var(--muted)}
.err{color:var(--margin);font-size:13px;font-weight:600}
[aria-invalid="true"]{border-color:var(--margin)}
.contact .btns{margin:14px 0 16px}

/* FAQ */
.faq details{border-bottom:2px solid var(--line)}
.faq summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 0;font-weight:600;font-size:17px;list-style:none;cursor:pointer}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";flex:none;font-size:26px;line-height:1;color:var(--accent)}
.faq details[open] summary::after{content:"−"}
.faq details p{color:var(--muted);margin:-4px 0 16px}

footer{border-top:2px solid var(--line);padding:24px 0 32px;color:var(--muted);font-size:14px}
footer nav{display:flex;flex-wrap:wrap;gap:8px 20px;margin-bottom:12px}
footer a{text-decoration:none;font-weight:600}
footer a:hover{color:var(--accent)}

/* Bottom basket bar (phones) */
.bbar{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:25;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;padding:8px 18px;border:0;border-radius:14px;background:var(--accent);color:var(--accent-ink);box-shadow:0 12px 30px -8px rgba(20,33,61,.55);cursor:pointer;text-align:left}
.bbar-l{display:grid;line-height:1.25}
.bbar-l b{font-size:16px}
.bbar-l small{font-size:14px;opacity:.9}
.bbar-r{display:flex;align-items:center;gap:4px;font-weight:700;font-size:16px}
@media (max-width:759px){body.has-bar{padding-bottom:calc(84px + env(safe-area-inset-bottom))}}
@media (min-width:760px){.bbar{display:none}}

/* Sheets: a bottom sheet on phones, a centred modal or a side panel on wider screens */
dialog{padding:0;border:0;color:var(--ink);background:var(--bg);max-width:100%;max-height:100%}
dialog::backdrop{background:var(--shade)}
.sheet[open]{display:flex;flex-direction:column}
.sheet{width:100%;margin:auto 0 0;max-height:92vh;max-height:92dvh;border-radius:20px 20px 0 0;overflow:hidden}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 10px 12px 20px;border-bottom:2px solid var(--line)}
.sheet-head h2{font-size:21px;line-height:1.2}
.sheet-body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:16px 20px 20px}
.sheet-body:last-child{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
.sheet-foot{padding:12px 20px calc(12px + env(safe-area-inset-bottom));border-top:2px solid var(--line)}
.sheet[open]{animation:sheet-up .25s cubic-bezier(.2,.8,.3,1)}
.sheet[open]::backdrop{animation:fade .25s}
@keyframes sheet-up{from{transform:translateY(48px);opacity:.3}}
@keyframes sheet-side{from{transform:translateX(48px);opacity:.3}}
@keyframes fade{from{opacity:0}}
@media (min-width:760px){
  .sheet{margin:auto;width:min(560px,calc(100% - 48px));max-height:86vh;border-radius:18px}
  .sheet.side{margin:0 0 0 auto;width:min(440px,100%);height:100%;max-height:100%;border-radius:0}
  .sheet.side[open]{animation-name:sheet-side}
}

/* Product details */
.tile.big{height:150px;font-size:78px;border-radius:14px;cursor:default}
.detail-meta{margin-top:14px}
.detail-price{font-size:26px;font-weight:700;margin:4px 0 12px}
.facts{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;margin:0 0 18px;font-size:15px}
.facts dt{font-weight:600}
.facts dd{margin:0;color:var(--muted)}
.detail-actions{display:flex;flex-wrap:wrap;gap:10px}
.detail-actions>*{flex:1 1 180px}
.detail-actions .buy{margin:0}
.detail-actions .buy .btn,.detail-actions .step,.detail-actions>.btn{min-height:48px;height:48px}
.related-h{font-size:17px;margin:22px 0 10px}
.related{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}
.related button{flex:none;display:flex;align-items:center;gap:6px;max-width:230px;padding:8px 12px;border:2px solid var(--line);border-radius:10px;background:var(--surface);font-size:14px;text-align:left;cursor:pointer}
.related button:hover{border-color:var(--accent)}

/* Basket */
.line{display:grid;grid-template-columns:50px 1fr;gap:6px 12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.tile.mini{grid-row:1/span 2;width:50px;height:50px;font-size:27px;border-radius:10px;cursor:default}
.line-name{font-weight:600;font-size:15px;line-height:1.3}
.line-sub{display:flex;align-items:center;justify-content:space-between;gap:10px}
.line .buy{width:132px;margin:0}
.line .step{height:38px}
.line .step button{width:42px}
.line-total{font-weight:700}
.free{margin:14px 0 4px;font-size:14px;font-weight:600}
.free i{position:relative;display:block;height:6px;margin-top:6px;border-radius:3px;background:var(--line);overflow:hidden}
.free i::after{content:"";position:absolute;left:0;top:0;bottom:0;width:var(--p);border-radius:3px;background:var(--ok)}
.free.done{color:var(--ok)}
.sum{display:grid;gap:6px;margin:12px 0 22px}
.sum div{display:flex;justify-content:space-between}
.sum dt,.sum dd{margin:0}
.sum .total{margin-top:4px;padding-top:8px;border-top:2px solid var(--line);font-size:20px;font-weight:700}
.order h3{font-size:18px}
.clear{display:block;margin:8px auto 0;padding:8px;border:0;background:none;color:var(--margin);font-weight:600;text-decoration:underline;cursor:pointer}
.fine{margin-top:8px;font-size:13px;color:var(--muted);text-align:center}
.bempty{padding:36px 8px;text-align:center;color:var(--muted)}
.bempty-art{font-size:56px;line-height:1;margin-bottom:12px}
.bempty .btn{margin-top:16px}

/* Toast */
.toast{display:none;position:fixed;inset:auto auto calc(20px + env(safe-area-inset-bottom)) 50%;transform:translateX(-50%);z-index:60;margin:0;width:max-content;max-width:calc(100% - 32px);padding:11px 18px;border:0;border-radius:10px;background:var(--ink);color:var(--bg);font-weight:600;text-align:center;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);overflow:visible}
.toast.show{display:block}
@media (max-width:759px){body.has-bar .toast{bottom:calc(84px + env(safe-area-inset-bottom))}}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after,::backdrop{animation:none!important;transition:none!important}
}
