:root{--yellow:#f7c400;--red:#d90a2c;--deep:#c4001f;--grey:#ffffff;--ink:#111;--white:#fff}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Rubik,system-ui,sans-serif;color:var(--ink);background:var(--grey);min-height:100vh}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
input,textarea,select{font:inherit;padding:.7rem .9rem;border:2px solid #222;border-radius:10px;width:100%;background:#fff}
a{color:inherit}

/* Top bar sits over the split layout */
.topbar{position:fixed;inset:0 0 auto 0;display:flex;justify-content:space-between;align-items:flex-start;padding:28px 32px;z-index:20;pointer-events:none}
.topbar>*{pointer-events:auto}
.logo{display:inline-block;line-height:0}
.logo img{width:200px;height:auto;display:block}
.topbar>.logo{position:absolute;left:50%;top:28px;transform:translateX(-50%)}
.logo-mark{position:absolute;top:-14px;left:50%;transform:translateX(-50%);font-size:1rem;color:var(--red)}
.logo-light{background:var(--yellow);border-color:var(--yellow)}
nav{margin-left:auto;display:flex;gap:22px;align-items:center;font-weight:700;letter-spacing:.5px;text-transform:uppercase;font-size:.9rem}
nav a{text-decoration:none}
nav a:hover,.linklike:hover{color:var(--red)}
.cart-btn{background:var(--red);color:#fff;border-radius:999px;padding:.5rem 1rem;font-weight:700;text-transform:uppercase}
.cart-btn span{background:#fff;color:var(--red);border-radius:999px;padding:0 .45rem;margin-left:.3rem}
.auth-only,.admin-only{display:none}
body.authed .auth-only{display:inline}
body.authed .guest-only{display:none}
body.admin .admin-only{display:inline}

/* ---------- Shop split ---------- */
.shop{display:grid;grid-template-columns:1fr 1fr;min-height:100vh}
.hero{background:var(--yellow);position:relative;overflow:hidden;display:grid;place-items:center}
.hero-img{width:min(82%,560px);aspect-ratio:1;border-radius:50%;object-fit:cover;filter:drop-shadow(0 30px 30px rgba(0,0,0,.28))}
.hero-img.in-up{animation:inUp .6s cubic-bezier(.2,.8,.2,1) both}
.hero-img.in-down{animation:inDown .6s cubic-bezier(.2,.8,.2,1) both}
.hero-img.out-up{animation:outUp .35s ease-in both}
.hero-img.out-down{animation:outDown .35s ease-in both}
@keyframes inUp{from{transform:translateY(110%) rotate(25deg);opacity:0}to{transform:none;opacity:1}}
@keyframes inDown{from{transform:translateY(-110%) rotate(-25deg);opacity:0}to{transform:none;opacity:1}}
@keyframes outUp{to{transform:translateY(-110%) rotate(-25deg);opacity:0}}
@keyframes outDown{to{transform:translateY(110%) rotate(25deg);opacity:0}}

.detail{position:relative;min-height:100vh;display:flex;align-items:center;justify-content:center;padding:110px 60px 60px 90px}
.detail-inner{width:100%;max-width:520px}
.thumbs{position:absolute;left:-42px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:38px;z-index:5}
.thumb{width:84px;height:84px;border-radius:50%;border:4px solid var(--white);overflow:hidden;background:#fff;box-shadow:0 6px 14px rgba(0,0,0,.18);transition:border-color .2s}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb.active{border-color:var(--red)}
.thumb:hover{animation:bounce .55s}
@keyframes bounce{0%,100%{transform:translateY(0)}30%{transform:translateY(-12px) scale(1.06)}55%{transform:translateY(0)}75%{transform:translateY(-5px)}}

.p-name{color:var(--red);font-size:clamp(2rem,3.4vw,3rem);font-weight:700;margin-bottom:.6rem}
.p-price{font-size:clamp(2.2rem,4vw,3.4rem);font-weight:700;margin-bottom:1.4rem}
.p-desc{max-width:34rem;margin-bottom:1.4rem;line-height:1.5}
.chips{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:1.2rem}
.chip{border:2px solid #222;border-radius:999px;padding:.5rem 1.3rem;font-weight:600;background:transparent;transition:.15s}
.chip.on{background:var(--red);border-color:var(--red);color:#fff}
.buy{display:flex;gap:16px;align-items:center;margin-top:.6rem;flex-wrap:wrap}
.qty{display:flex;align-items:center;gap:18px;border:2px solid #222;border-radius:12px;padding:.55rem 1rem;font-size:1.25rem;font-weight:600;background:transparent}
.qty button{font-size:1.4rem;line-height:1;width:20px}
.btn{background:var(--red);color:#fff;font-weight:700;text-transform:uppercase;letter-spacing:.5px;border-radius:12px;padding:1rem 2rem;transition:transform .15s,background .15s}
.btn:hover{background:var(--deep);transform:translateY(-2px)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-white{background:#fff;color:var(--red)}
.btn-white:hover{background:var(--yellow);color:var(--red)}
.stock{font-size:.85rem;margin-top:.8rem;opacity:.7}

/* Reviews */
.reviews{margin-top:3rem;max-width:36rem}
.reviews h3{font-size:1.4rem;margin-bottom:.4rem}
.avg{color:var(--red);font-weight:700;margin-bottom:1rem}
.review{background:#fff;border-radius:14px;padding:1rem 1.2rem;margin-bottom:.8rem}
.review .stars{color:var(--red);letter-spacing:2px}
.review small{opacity:.6}
.review-form{display:grid;gap:.6rem;margin-top:1rem}
.star-pick button{font-size:1.6rem;color:#aaa}
.star-pick button.on{color:var(--red)}

/* ---------- Cart slide-out ---------- */
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:.35s;z-index:40}
.scrim.show{opacity:1;pointer-events:auto}
.cart{position:fixed;top:0;right:0;height:100%;width:min(500px,100%);background:var(--red);color:#fff;z-index:50;padding:28px 32px;display:flex;flex-direction:column;transform:translateX(105%);transition:transform .5s cubic-bezier(.2,.9,.2,1);box-shadow:-20px 0 50px rgba(0,0,0,.25)}
.cart.open{transform:none}
.cart-head{display:flex;justify-content:space-between;align-items:flex-start}
.close{color:#fff;font-size:2rem}
.cart h2{font-size:2.6rem;margin:1.4rem 0}
.cart-lines{flex:1;overflow:auto}
.line{display:grid;grid-template-columns:110px 1fr;gap:18px;padding-bottom:1.4rem;margin-bottom:1.4rem;border-bottom:2px solid rgba(255,255,255,.7);animation:slideIn .4s both}
@keyframes slideIn{from{transform:translateX(40px);opacity:0}}
.line img{width:110px;height:110px;border-radius:50%;border:4px solid #fff;object-fit:cover}
.line h4{font-size:1.35rem;margin-bottom:.6rem}
.line .opt{font-size:.85rem;opacity:.85;margin-bottom:.5rem}
.sizes{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:.8rem}
.size{border:2px solid #fff;border-radius:10px;padding:.35rem .8rem;font-weight:600;color:#fff}
.size.on{background:var(--yellow);border-color:var(--yellow);color:#222}
.line-bottom{display:flex;justify-content:space-between;align-items:center}
.line .qty{background:#fff;color:#222;border:0;padding:.35rem .9rem;font-size:1.05rem}
.line-total{font-size:1.5rem;font-weight:700}
.remove{font-size:.8rem;text-decoration:underline;opacity:.8;margin-top:.4rem;color:#fff}
.cart-foot{border-top:2px solid rgba(255,255,255,.7);padding-top:1.2rem}
.subtotal{display:flex;justify-content:space-between;font-size:2rem;font-weight:700;margin-bottom:1rem}
.cart-foot .btn{width:100%}
.empty{opacity:.85}

/* ---------- Pages ---------- */
.page{max-width:960px;margin:0 auto;padding:150px 24px 80px}
.page h1{color:var(--red);font-size:2.4rem;margin-bottom:1.2rem}
.card{background:#fff;border-radius:16px;padding:1.4rem;margin-bottom:1rem}
.form{display:grid;gap:.8rem;max-width:420px}
.tabs{display:flex;gap:10px;margin-bottom:1rem}
.muted{opacity:.65;font-size:.9rem}
.status{display:inline-block;border-radius:999px;padding:.2rem .7rem;font-size:.8rem;font-weight:700;background:var(--yellow)}
.status.Paid,.status.Shipped,.status.Delivered{background:#2f9e44;color:#fff}
.status.Cancelled{background:#555;color:#fff}
table{width:100%;border-collapse:collapse;font-size:.92rem}
td,th{text-align:left;padding:.5rem;border-bottom:1px solid #eee;vertical-align:top}
.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.admin-grid .full{grid-column:1/-1}
.size-row{display:flex;gap:6px;margin-bottom:6px}
.prod-row{display:flex;gap:12px;align-items:center}
.prod-row img{width:56px;height:56px;border-radius:50%;object-fit:cover}
.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,150%);background:#111;color:#fff;padding:.8rem 1.4rem;border-radius:999px;transition:.3s;z-index:60}
.toast.show{transform:translate(-50%,0)}

@media (max-width:820px){
  .shop{grid-template-columns:1fr}
  .hero{min-height:60vh;padding-top:90px}
  .detail{display:block;min-height:0;padding:60px 22px 60px 22px}
  .thumbs{position:static;transform:none;flex-direction:row;gap:16px;margin-bottom:1.5rem}
  .thumb{width:64px;height:64px}
  .topbar{padding:16px;background:transparent}
  nav{gap:12px;font-size:.75rem;flex-wrap:wrap;justify-content:flex-end}
  .logo img{width:130px}
  .topbar>.logo{position:static;transform:none}
  .admin-grid{grid-template-columns:1fr}
}
