/* styles.css — SAURA design system (lavender background, white rounded cards, purple gradients) */
:root{
  --bg:#ebe9fb; --bg2:#f3f1fd; --card:#fff; --ink:#1d1b3b; --muted:#8a88a8; --line:#ece9fa;
  --p1:#6a4de3; --p2:#9040df; --grad:linear-gradient(135deg,#6a4de3 0%,#9040df 100%);
  --chip:#e4e1f7; --green:#12a672; --star:#f5a524; --danger:#e5484d;
  --shadow:0 8px 24px rgba(88,64,180,.10); --shadow-sm:0 2px 10px rgba(88,64,180,.08);
  --font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
*{box-sizing:border-box;margin:0}
[hidden]{display:none !important}
html{-webkit-text-size-adjust:100%}
body{font-family:var(--font);color:var(--ink);background:linear-gradient(180deg,var(--bg) 0%,var(--bg2) 100%) fixed;min-height:100vh;line-height:1.4;-webkit-tap-highlight-color:transparent}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
img{display:block;max-width:100%}
.ic{width:20px;height:20px;flex:none}
.container{width:100%;max-width:1180px;margin:0 auto;padding:0 18px}
.page{padding-top:18px;padding-bottom:120px}
.muted{color:var(--muted)}
.small{font-size:12px}
.center{text-align:center}
.link{color:var(--p1);font-weight:600;font-size:13px}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:50px;padding:0 24px;border-radius:999px;font-weight:700;font-size:15px;white-space:nowrap}
.btn-grad{background:var(--grad);color:#fff;box-shadow:0 8px 18px rgba(106,77,227,.35)}
.btn-ghost{background:#fff;color:var(--p1);box-shadow:var(--shadow-sm)}
.btn-white{background:#fff;color:var(--p1);height:34px;padding:0 16px;font-size:12px;width:max-content}
.btn-danger{background:#fdecec;color:var(--danger)}
.btn-sm{height:38px;padding:0 16px;font-size:13px}
.btn-block{width:100%}
.btn:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
.icon-btn{width:44px;height:44px;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:var(--shadow-sm);position:relative;flex:none}
.icon-btn.grad{background:var(--grad);color:#fff}
.badge{position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 5px;border-radius:99px;background:var(--grad);color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center}
.badge.inline{position:static;display:inline-grid;margin-left:4px}
.spin{width:18px;height:18px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:rot .7s linear infinite}
@keyframes rot{to{transform:rotate(360deg)}}

/* ---------- top bar (desktop) & bottom nav (mobile) ---------- */
.topbar{display:none;position:sticky;top:0;z-index:40;background:rgba(235,233,251,.88);backdrop-filter:blur(10px)}
.topbar-in{display:flex;align-items:center;justify-content:space-between;height:68px}
.brand{font-weight:800;font-size:22px;letter-spacing:.16em;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.topnav{display:flex;gap:26px;font-weight:600;font-size:14px;color:#4b4880}
.topnav a.active{color:var(--p1)}
.bottomnav{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom));width:min(calc(100% - 28px),440px);display:flex;gap:2px;background:#fff;border-radius:28px;padding:8px;box-shadow:0 12px 32px rgba(70,50,160,.18);z-index:50}
.bottomnav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10px;padding:8px 0;border-radius:20px;color:var(--muted);position:relative;font-weight:500}
.bottomnav a.active{background:#ebe8fb;color:var(--p1);font-weight:700}
.bottomnav .badge{top:2px;right:calc(50% - 22px)}

/* ---------- home ---------- */
.home-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.h-title{font-size:26px;font-weight:800}
.searchrow{display:flex;gap:10px;margin-bottom:14px}
.search{flex:1;display:flex;align-items:center;gap:10px;background:#fff;border-radius:999px;padding:0 16px;height:48px;box-shadow:var(--shadow-sm);color:var(--muted)}
.search input{border:0;outline:0;background:none;flex:1;min-width:0;height:100%;font:inherit;font-size:14px;color:var(--ink)}
.chips{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;height:36px;padding:0 18px;border-radius:999px;background:var(--chip);font-size:13px;font-weight:600;color:#4b4880;white-space:nowrap}
.chip.active{background:var(--grad);color:#fff}
.banner{position:relative;overflow:hidden;border-radius:22px;padding:22px;background:var(--grad);color:#fff;min-height:132px;display:flex;flex-direction:column;justify-content:center;gap:8px;margin:6px 0 4px}
.banner::after{content:"";position:absolute;right:-30px;top:-24px;width:160px;height:160px;border-radius:50%;background:rgba(255,255,255,.14);pointer-events:none}
.banner-sub{font-size:11px;opacity:.85}
.banner h2{font-size:24px;font-weight:800}
.section-head{display:flex;justify-content:space-between;align-items:baseline;margin:20px 2px 12px}
.section-head h2{font-size:16px;font-weight:800}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.card{position:relative;background:#fff;border-radius:20px;padding:10px;box-shadow:var(--shadow-sm)}
.card-link{display:block}
.thumb{position:relative;aspect-ratio:1/1;border-radius:14px;overflow:hidden;background:#e8e5f8}
.thumb img{width:100%;height:100%;object-fit:cover}
.tag-sold{position:absolute;left:8px;bottom:8px;background:rgba(29,27,59,.85);color:#fff;font-size:10px;padding:3px 8px;border-radius:99px}
.card h3{font-size:13px;font-weight:700;margin-top:10px}
.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card .brand-line{font-size:11px;color:var(--muted)}
.row{display:flex;justify-content:space-between;align-items:center;margin-top:6px;gap:6px}
.price{font-weight:800;font-size:15px}
.rating{font-size:11px;color:var(--muted);display:inline-flex;gap:3px;align-items:center}
.heart{position:absolute;top:18px;right:18px;width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.88);display:grid;place-items:center;color:#4b4880}
.heart .ic{width:16px;height:16px}
.heart.wished{color:#e0457b}
.heart.wished .ic{fill:currentColor}
.sk{background:linear-gradient(90deg,#efedfb 25%,#f8f7fe 37%,#efedfb 63%);background-size:400% 100%;animation:sh 1.3s infinite;border-radius:14px}
@keyframes sh{0%{background-position:100% 50%}100%{background-position:0 50%}}
.empty{text-align:center;padding:48px 16px;color:var(--muted)}
.empty .circle{width:72px;height:72px;border-radius:50%;background:#fff;display:grid;place-items:center;margin:0 auto 14px;box-shadow:var(--shadow-sm);color:var(--p1)}
.empty .circle .ic{width:30px;height:30px}
.empty h3{color:var(--ink);font-size:17px;margin-bottom:6px}
.empty p{font-size:13px;margin-bottom:16px}

/* ---------- panels, forms ---------- */
.panel{background:#fff;border-radius:20px;padding:18px;box-shadow:var(--shadow-sm);margin-bottom:16px}
.panel-title{font-size:16px;font-weight:800;margin-bottom:14px}
.pagehead{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.pagehead h1{font-size:19px;font-weight:800}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field label,.lbl{font-size:12px;font-weight:600;color:#4b4880}
.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);background:#fff;border-radius:14px;padding:13px 14px;font:inherit;font-size:14px;color:var(--ink);outline:none}
.field textarea{resize:vertical;min-height:84px}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--p1);box-shadow:0 0 0 3px rgba(106,77,227,.15)}
.field.invalid input,.field.invalid textarea{border-color:var(--danger)}
.err{color:var(--danger);font-size:12px;min-height:0}
.check{display:flex;align-items:center;gap:8px;font-size:14px;margin:6px 0}
.check input{width:18px;height:18px;accent-color:var(--p1)}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.notice{background:#fff7e0;color:#7a5b00;border-radius:14px;padding:12px 14px;font-size:13px;margin-bottom:12px}
.notice.bad{background:#fdecec;color:#a02a2f}
.notice.good{background:#e9f8f1;color:#0c7a54}

/* ---------- product page ---------- */
.pd-page{padding:0 0 0}
.pd{display:block}
.gal-wrap{position:relative;height:340px;background:#dcd8f2}
.gallery{display:flex;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
.gallery::-webkit-scrollbar{display:none}
.gallery img{flex:0 0 100%;width:100%;height:100%;object-fit:cover;scroll-snap-align:start}
.float-l{position:absolute;top:calc(14px + env(safe-area-inset-top));left:14px;background:rgba(255,255,255,.9)}
.float-r{position:absolute;top:calc(14px + env(safe-area-inset-top));right:14px;background:rgba(255,255,255,.9)}
.float-r.wished{color:#e0457b}
.float-r.wished .ic{fill:currentColor}
.dots{position:absolute;bottom:40px;left:0;right:0;display:flex;gap:5px;justify-content:center}
.dots i{width:5px;height:5px;border-radius:50%;background:rgba(255,255,255,.6)}
.dots i.on{width:16px;border-radius:99px;background:#fff}
.sheet{position:relative;margin-top:-26px;background:var(--bg2);border-radius:28px 28px 0 0;padding:20px 18px 130px}
.ttl-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.pd-title{font-size:20px;font-weight:800}
.opt-label{font-size:13px;font-weight:700;margin:18px 0 10px}
.swatches{display:flex;gap:10px;flex-wrap:wrap}
.swatch{width:36px;height:36px;padding:3px;border-radius:50%;border:2px solid transparent}
.swatch::before{content:"";display:block;width:100%;height:100%;border-radius:50%;background:var(--c);box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.swatch.sel{border-color:var(--ink)}
.sizes{display:flex;gap:8px;flex-wrap:wrap}
.size-opt{min-width:48px;height:40px;padding:0 12px;border-radius:12px;background:#fff;border:1px solid var(--line);font-weight:600;font-size:14px}
.size-opt.sel{background:var(--grad);color:#fff;border-color:transparent}
.desc{font-size:13px;line-height:1.65;color:var(--muted);margin-top:18px}
.buybar{position:fixed;left:0;right:0;bottom:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));z-index:30}
.buybar .inner{max-width:480px;margin:0 auto;background:#fff;border-radius:999px;padding:8px 8px 8px 22px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 12px 32px rgba(70,50,160,.18)}
.buybar .inner .btn{height:46px}
.buybar small{display:block;font-size:10px;color:var(--muted)}
.price.big{font-size:20px}
.price s{font-size:12px;color:var(--muted);font-weight:500;margin-left:6px}
.off{background:#e9f8f1;color:var(--green);font-size:11px;font-weight:700;padding:2px 8px;border-radius:99px;margin-left:6px}

/* ---------- cart & checkout ---------- */
.cart-layout{display:block}
.cart-item{display:flex;gap:12px;background:#fff;border-radius:18px;padding:10px;box-shadow:var(--shadow-sm);align-items:center;margin-bottom:12px}
.ci-img{width:68px;height:68px;border-radius:12px;object-fit:cover;background:#e8e5f8;flex:none}
.ci-info{flex:1;min-width:0}
.ci-name{font-size:14px;font-weight:700}
.ci-brand{font-size:11px;color:var(--muted);margin:2px 0 6px}
.ci-price{font-weight:800;font-size:14px}
.ci-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.stepper{display:flex;align-items:center;gap:10px;background:#f3f1fd;border-radius:99px;padding:4px;font-weight:700;font-size:13px}
.stepper button{width:28px;height:28px;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:var(--shadow-sm)}
.stepper .ic{width:14px;height:14px}
.rm{color:var(--muted);width:28px;height:28px;display:grid;place-items:center}
.rm .ic{width:16px;height:16px}
.summary{background:#fff;border-radius:18px;padding:16px;box-shadow:var(--shadow-sm)}
.sum-row{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);padding:5px 0}
.sum-row b{color:var(--ink)}
.sum-row.total{color:var(--ink);font-weight:800;font-size:17px;border-top:1px solid var(--line);margin-top:6px;padding-top:12px}
.free{color:var(--green) !important;font-weight:700}
.hint{background:#f3f1fd;color:#4b4880;font-size:12px;border-radius:12px;padding:9px 12px;margin-bottom:12px}
.mini{display:flex;gap:10px;align-items:center;padding:6px 0}
.mini img{width:44px;height:44px;border-radius:10px;object-fit:cover;background:#e8e5f8}
.mini div{flex:1;min-width:0;font-size:13px}
.mini b{font-size:13px}
.kv{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:5px 0}
.kv span:first-child{color:var(--muted)}
.kv span:last-child{text-align:right}
.done{width:84px;height:84px;border-radius:50%;background:var(--grad);color:#fff;display:grid;place-items:center;margin:20px auto 14px;box-shadow:0 12px 28px rgba(106,77,227,.35)}
.done .ic{width:38px;height:38px}

/* ---------- toasts ---------- */
#toasts{position:fixed;top:calc(14px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px;width:min(92%,420px);pointer-events:none}
.toast{background:#1d1b3b;color:#fff;padding:12px 16px;border-radius:14px;font-size:14px;box-shadow:0 10px 26px rgba(20,15,50,.3);transition:opacity .3s}
.toast.error{background:#c93a40}
.toast.ok{background:#0e8d62}

/* ---------- admin ---------- */
.a-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.a-actions{display:flex;gap:8px}
.login-card{max-width:420px;margin:40px auto 0}
.login-card h1{font-size:20px;margin:8px 0 18px;text-align:center}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:6px 0 14px}
.toolbar h2{font-size:17px;font-weight:800}
.row-card{display:flex;gap:12px;align-items:center;background:#fff;border-radius:16px;padding:10px;margin-bottom:10px;box-shadow:var(--shadow-sm)}
.row-card img{width:56px;height:56px;border-radius:12px;object-fit:cover;background:#e8e5f8;flex:none}
.row-card .info{flex:1;min-width:0}
.row-card .info b{display:block;font-size:14px}
.row-card .info span{font-size:12px;color:var(--muted)}
.row-card .btns{display:flex;gap:6px}
.flag{font-size:10px;font-weight:700;background:#f3f1fd;color:#4b4880;padding:2px 8px;border-radius:99px;margin-left:4px}
.pill{font-size:11px;font-weight:700;padding:3px 10px;border-radius:99px;text-transform:capitalize;white-space:nowrap}
.pill.pending{background:#fff3d6;color:#8a6100}
.pill.confirmed{background:#e3ecff;color:#2750b8}
.pill.shipped{background:#efe3ff;color:#6a2fc0}
.pill.delivered{background:#e1f6ec;color:#0c7a54}
.pill.cancelled{background:#fdecec;color:#a02a2f}
.order{background:#fff;border-radius:16px;margin-bottom:10px;box-shadow:var(--shadow-sm)}
.order summary{list-style:none;padding:14px;display:flex;justify-content:space-between;gap:10px;cursor:pointer;align-items:center}
.order summary::-webkit-details-marker{display:none}
.order .obody{padding:6px 14px 14px;border-top:1px solid var(--line)}
.order .sub{font-size:12px;color:var(--muted)}
.items-tbl{width:100%;font-size:12px;border-collapse:collapse;margin:8px 0}
.items-tbl td{padding:5px 0;border-bottom:1px solid var(--line);vertical-align:top}
.items-tbl td:last-child{text-align:right;white-space:nowrap}
.cat-row .btns{display:flex;gap:8px;margin-top:6px}
.modal{position:fixed;inset:0;background:rgba(20,15,50,.5);display:none;align-items:flex-end;justify-content:center;z-index:80}
.modal.open{display:flex}
.sheetm{background:var(--bg2);width:100%;max-width:640px;max-height:92vh;overflow:auto;border-radius:26px 26px 0 0;padding:20px}
.imgs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.imgbox{position:relative;width:84px;height:84px;border-radius:14px;overflow:hidden;background:#e8e5f8}
.imgbox img{width:100%;height:100%;object-fit:cover}
.imgbox button{position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:rgba(0,0,0,.65);color:#fff;display:grid;place-items:center}
.imgbox button .ic{width:12px;height:12px}
.imgbox.main::after{content:"Main";position:absolute;left:4px;bottom:4px;background:rgba(0,0,0,.65);color:#fff;font-size:9px;padding:1px 6px;border-radius:99px}
code.uid{display:block;word-break:break-all;background:#f3f1fd;padding:10px 12px;border-radius:12px;font-size:13px;margin:10px 0}

/* ---------- responsive ---------- */
.only-desktop{display:none}
@media (min-width:640px){
  .grid{grid-template-columns:repeat(3,1fr)}
}
@media (min-width:700px){
  .modal{align-items:center}
  .sheetm{border-radius:26px}
}
@media (min-width:900px){
  .topbar{display:block}
  .bottomnav,.mobile-only{display:none !important}
  .only-desktop{display:inline-flex}
  .page{padding-bottom:60px;padding-top:26px}
  .home-head .icon-btn{display:none}
  .home-head{margin-bottom:18px}
  .searchrow{max-width:640px}
  .banner{min-height:180px;padding:34px 40px}
  .banner h2{font-size:34px}
  .banner::after{width:300px;height:300px;right:-60px;top:-60px}
  .cart-layout{display:grid;grid-template-columns:1.5fr 1fr;gap:28px;align-items:start}
  .cart-layout aside{position:sticky;top:88px}
  .pd-page{padding:26px 18px 60px}
  .pd{display:grid;grid-template-columns:1fr 1fr;gap:34px;align-items:start}
  .gal-wrap{height:560px;border-radius:28px;overflow:hidden}
  .sheet{margin:0;background:#fff;border-radius:28px;padding:30px;box-shadow:var(--shadow)}
  .pd-title{font-size:26px}
  .buybar{position:static;padding:0;margin-top:26px}
  .buybar .inner{max-width:none;background:var(--bg2);box-shadow:none;padding:10px 10px 10px 22px}
  .float-l,.float-r{top:16px}
}
@media (min-width:1100px){
  .grid{grid-template-columns:repeat(4,1fr);gap:20px}
}
