:root{
  --navy:#0E3356; --teal:#007497; --green:#00964B; --ink:#17212b; --mute:#5b6773;
  --line:#e3e8ec; --bg:#f6f8fa; --card:#ffffff; --danger:#b42318; --warn:#9a6700;
  --cta:var(--green); --header-bg:var(--navy); --header-text:#fff; --btn-text:#fff; --font:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --radius:12px; --shadow:0 6px 24px rgba(0,0,0,.12);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font:16px/1.45 var(--font);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--teal)}
button{font:inherit}
img{max-width:100%;display:block}
.wrap{max-width:1180px;margin:0 auto;padding:0 16px}
.hidden{display:none!important}

/* header */
.top{background:var(--header-bg);color:var(--header-text);position:sticky;top:0;z-index:20;box-shadow:0 2px 10px rgba(0,0,0,.15);border-top:5px solid var(--navy)}
.top-inner{display:flex;align-items:center;justify-content:space-between;height:60px;gap:12px}
.brand{display:flex;align-items:center;gap:12px;color:var(--header-text);text-decoration:none;font-weight:700;font-size:18px;min-width:0}
.brand img{height:38px;width:auto;max-width:160px;object-fit:contain;background:#fff;border-radius:6px;padding:3px}
.brand img.bare{background:none;border-radius:0;padding:0;height:30px;max-width:180px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.brand span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cartBtn{display:flex;align-items:center;gap:8px;background:var(--green);color:var(--btn-text);border:0;border-radius:999px;padding:8px 14px;cursor:pointer;font-weight:600}
.cartBtn:hover{filter:brightness(1.08)}
.badge{background:#fff;color:var(--navy);border-radius:999px;min-width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;padding:0 6px}

/* hero */
.hero{background:linear-gradient(135deg,var(--navy),var(--teal));color:#fff;border-radius:var(--radius);padding:28px 24px;margin:20px 0}
.hero h1{margin:0 0 6px;font-size:28px;line-height:1.15}
.hero p{margin:6px 0 0;max-width:720px;opacity:.95}
.hero .tiers{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.hero .tiers span{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.3);border-radius:999px;padding:4px 12px;font-size:14px;font-weight:600}
.notes{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin:0 0 20px}
.note{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px;color:var(--mute)}
.note strong{color:var(--ink);display:block;margin-bottom:2px}

/* filters */
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.chip{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 14px;cursor:pointer;color:var(--ink)}
.chip.on{background:var(--navy);color:#fff;border-color:var(--navy)}

/* grid */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px;margin-bottom:40px}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;cursor:pointer;transition:transform .12s,box-shadow .12s;display:flex;flex-direction:column}
.card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.card .img{aspect-ratio:1/1;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;border-bottom:1px solid var(--line)}
.card .img img{width:100%;height:100%;object-fit:contain}
.card .body{padding:12px 14px 14px;display:flex;flex-direction:column;gap:4px;flex:1}
.card .title{font-weight:600;line-height:1.25}
.card .sub{font-size:13px;color:var(--mute)}
.card .price{margin-top:auto;padding-top:6px;font-weight:700;color:var(--navy)}
.card .price small{font-weight:500;color:var(--mute)}
.swatches{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.swatches i{width:14px;height:14px;border-radius:50%;border:1px solid rgba(0,0,0,.15);display:inline-block}
.ph{color:var(--mute);font-size:13px;text-align:center;padding:12px}

/* modal / drawer */
.modal,.drawer{position:fixed;inset:0;z-index:40}
.modal-bg{position:absolute;inset:0;background:rgba(14,33,54,.55)}
.modal-card{position:relative;background:#fff;border-radius:var(--radius);max-width:960px;margin:4vh auto;max-height:92vh;overflow:auto;box-shadow:var(--shadow);width:calc(100% - 24px)}
.drawer-panel{position:absolute;right:0;top:0;bottom:0;width:min(520px,100%);background:#fff;box-shadow:-8px 0 30px rgba(0,0,0,.2);display:flex;flex-direction:column}
.x{position:absolute;top:10px;right:10px;border:0;background:#f1f4f7;border-radius:50%;width:36px;height:36px;cursor:pointer;font-size:20px;line-height:1;z-index:2}

/* product detail */
.pd{display:grid;grid-template-columns:1fr 1fr;gap:0}
.pd .gal{background:#fff;display:flex;align-items:center;justify-content:center;min-height:320px}
.pd .gal img{width:100%;height:100%;object-fit:contain;max-height:92vh}
.pd .info{padding:22px 22px 26px}
.pd h2{margin:0 0 2px;font-size:22px;line-height:1.2}
.pd .sub{color:var(--mute);font-size:14px;margin-bottom:12px}
.pd h4{margin:16px 0 8px;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--mute)}
.colors{display:flex;flex-wrap:wrap;gap:8px}
.colors button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 10px;cursor:pointer;display:flex;align-items:center;gap:8px;font-size:14px}
.colors button.on{border-color:var(--navy);box-shadow:0 0 0 2px var(--navy) inset}
.colors i{width:16px;height:16px;border-radius:50%;border:1px solid rgba(0,0,0,.15)}
.tiertable{width:100%;border-collapse:collapse;font-size:14px;margin:4px 0 2px}
.tiertable th,.tiertable td{text-align:left;padding:5px 8px;border-bottom:1px solid var(--line)}
.tiertable th{color:var(--mute);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.tiertable tr.on td{background:var(--bg);font-weight:700;color:var(--navy)}
.tiertable td.r,.tiertable th.r{text-align:right}
.sizes{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px}
.size{border:1px solid var(--line);border-radius:8px;padding:6px 8px;text-align:center}
.size label{display:block;font-size:13px;font-weight:600;margin-bottom:4px}
.size input{width:100%;border:1px solid var(--line);border-radius:6px;padding:6px 4px;text-align:center;font-size:16px}
.size small{display:block;color:var(--mute);font-size:11px;margin-top:3px}
.live{background:#f6f8fa;border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin-top:14px;font-size:14px}
.live b{color:var(--navy)}
.live .nudge{color:var(--green);font-weight:600;margin-top:4px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:10px;padding:12px 18px;font-weight:700;cursor:pointer;background:var(--navy);color:var(--header-text);text-decoration:none}
.btn:hover{filter:brightness(1.1)}
.btn[disabled]{opacity:.5;cursor:not-allowed;filter:none}
.btn.teal{background:var(--green);color:var(--btn-text)}
.btn.green{background:var(--cta);color:var(--btn-text)}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn.wide{width:100%}
.desc{font-size:14px;color:var(--mute);white-space:pre-line;margin-top:12px}
.desc summary{cursor:pointer;color:var(--teal);font-weight:600}

/* cart */
.cart-h{padding:16px 18px;border-bottom:1px solid var(--line);font-weight:700;font-size:18px}
.cart-b{flex:1;overflow:auto;padding:12px 18px}
.cart-f{padding:14px 18px;border-top:1px solid var(--line);background:#fafbfc}
.line{display:grid;grid-template-columns:64px 1fr;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.line img{width:64px;height:64px;object-fit:contain;border-radius:8px;background:#fff;border:1px solid var(--line)}
.line .t{font-weight:600;line-height:1.25}
.line .s{font-size:13px;color:var(--mute)}
.line .sz{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.line .sz span{background:#f1f4f7;border-radius:6px;padding:2px 8px;font-size:13px}
.line .row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:4px}
.line .act button{border:0;background:none;color:var(--teal);cursor:pointer;padding:0;font-size:13px;font-weight:600;margin-right:10px}
.line .act button.del{color:var(--danger)}
.tier-pill{display:inline-block;background:#e6f6ee;color:#0b6b3a;border-radius:999px;padding:2px 8px;font-size:12px;font-weight:700}
.tier-pill.base{background:#f1f4f7;color:var(--mute)}
.nudge-line{font-size:13px;color:var(--green);font-weight:600;margin-top:2px}
.tot{display:flex;justify-content:space-between;font-weight:700;font-size:18px;margin-bottom:10px}
.tot small{display:block;font-size:12px;color:var(--mute);font-weight:500}
.empty{text-align:center;color:var(--mute);padding:40px 10px}

/* checkout */
.co{display:grid;grid-template-columns:1.2fr .8fr;gap:24px;margin:20px 0 40px}
.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:20px}
.panel h2{margin:0 0 4px;font-size:20px}
.panel h3{margin:18px 0 8px;font-size:15px;color:var(--navy)}
.panel p.help{color:var(--mute);font-size:14px;margin:0 0 10px}
.f{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.f .full{grid-column:1/-1}
.fld label{display:block;font-size:13px;font-weight:600;margin-bottom:4px}
.fld label em{color:var(--danger);font-style:normal}
.fld input,.fld select,.fld textarea{width:100%;border:1px solid #c9d2da;border-radius:8px;padding:10px;font-size:16px;background:#fff}
.fld textarea{min-height:80px;resize:vertical}
.fld input:focus,.fld textarea:focus,.fld select:focus{outline:2px solid var(--teal);border-color:var(--teal)}
.fld.err input,.fld.err select{border-color:var(--danger)}
.radios{display:flex;gap:10px;flex-wrap:wrap}
.radios label{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px 14px;cursor:pointer;background:#fff;white-space:nowrap}
.radios label.on{border-color:var(--navy);box-shadow:0 0 0 1px var(--navy) inset}
.check{display:flex;gap:10px;align-items:flex-start;font-size:14px;margin-top:14px}
.check input{margin-top:3px}
.summary .li{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--line);font-size:14px}
.summary .li .n{font-weight:600}
.summary .li .d{color:var(--mute);font-size:13px}
.errbox{background:#fdecea;color:var(--danger);border-radius:8px;padding:10px 12px;font-size:14px;margin-top:12px}
.done{max-width:640px;margin:40px auto;text-align:center}
.done .num{font-size:30px;font-weight:800;color:var(--navy);margin:10px 0}
.done .box{text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-top:20px}

.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--navy);color:#fff;padding:12px 18px;border-radius:10px;z-index:60;box-shadow:var(--shadow);font-weight:600}
.spin{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

@media (max-width:760px){
  .pd{grid-template-columns:1fr}
  .pd .gal{min-height:0;max-height:48vh}
  .pd .gal img{max-height:48vh}
  .co{grid-template-columns:1fr}
  .f{grid-template-columns:1fr}
  .hero{padding:20px 16px}
  .hero h1{font-size:23px}
  .cartBtn span:first-of-type{display:none}
}
