:root{
  --red:#e21b22;
  --red-d:#b3151b;
  --ink:#15171a;
  --muted:#7b7f87;
  --line:#ececef;
  --bg:#f5f6f8;
  --card:#fff;
  --blue:#1d3c8f;
  --ok:#1aa64b;
  --shadow:0 6px 24px rgba(20,23,26,.10);
  --radius:16px;
  --hdr-h:0px;
}
*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
html{scroll-behavior:smooth;background:var(--ink)}
body{
  font-family:'Montserrat',system-ui,sans-serif;
  background:var(--bg);color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
.material-symbols-outlined{font-size:22px;line-height:1;vertical-align:middle;font-variation-settings:'wght'500}
img{display:block}

/* ===== HEADER ===== */
.hdr{position:sticky;top:0;z-index:40;background:#fff;box-shadow:0 2px 12px rgba(0,0,0,.06)}
.hdr-inner{max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:14px;padding:10px 16px}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-logo{width:42px;height:42px;border-radius:10px;object-fit:cover;flex:none}
.brand-txt h1{font-size:15px;font-weight:800;letter-spacing:.3px;line-height:1.1;white-space:nowrap}
.brand-sub{font-size:11px;color:var(--muted);font-weight:600}

.mode-toggle{display:flex;background:var(--bg);border-radius:999px;padding:4px;gap:2px}
.mode-btn{border:0;background:none;padding:7px 14px;border-radius:999px;font:inherit;font-weight:600;font-size:13px;color:var(--muted);cursor:pointer;display:flex;align-items:center;gap:5px}
.mode-btn .material-symbols-outlined{font-size:18px}
.mode-btn.active{background:#fff;color:var(--red);box-shadow:0 2px 8px rgba(0,0,0,.08)}

.hdr-info{display:flex;align-items:center;gap:4px;font-size:13px;font-weight:600;color:var(--ink);cursor:pointer;background:var(--bg);padding:8px 12px;border-radius:999px}
.hdr-info .material-symbols-outlined{font-size:18px;color:var(--red)}
.hdr-info .chev{color:var(--muted);font-size:18px}

.hdr-right{margin-left:auto;display:flex;gap:6px}
.icon-btn{position:relative;border:0;background:var(--bg);width:42px;height:42px;border-radius:12px;cursor:pointer;color:var(--ink);display:grid;place-items:center}
.icon-btn:hover{background:#ececef}
.cart-btn{background:var(--red);color:#fff}
.cart-btn:hover{background:var(--red-d)}
.cart-badge,.bnav-badge{position:absolute;top:-4px;right:-4px;background:#fff;color:var(--red);font-size:11px;font-weight:800;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 4px;box-shadow:0 1px 4px rgba(0,0,0,.25)}

.searchbar{max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:8px;padding:0 16px 10px}
.searchbar .material-symbols-outlined{color:var(--muted)}
.searchbar input{flex:1;border:1px solid var(--line);background:var(--bg);border-radius:12px;padding:11px 14px;font:inherit;font-size:15px;outline:none}
.searchbar input:focus{border-color:var(--red)}

/* category nav */
.catnav{display:flex;gap:8px;overflow-x:auto;padding:8px 16px;max-width:1180px;margin:0 auto;scrollbar-width:none}
.catnav::-webkit-scrollbar{display:none}
.cat-chip{flex:none;border:0;background:var(--bg);color:var(--ink);font:inherit;font-weight:600;font-size:13px;padding:9px 16px;border-radius:999px;cursor:pointer;white-space:nowrap;transition:.15s}
.cat-chip:hover{background:#e6e7ea}
.cat-chip.active{background:var(--ink);color:#fff}

/* ===== STORIES ===== */
.stories{display:flex;gap:12px;overflow-x:auto;padding:14px 16px 4px;max-width:1180px;margin:0 auto;scrollbar-width:none}
.stories::-webkit-scrollbar{display:none}
.story{flex:none;width:72px;text-align:center;cursor:pointer}
.story-ring{width:72px;height:72px;border-radius:50%;padding:3px;background:linear-gradient(45deg,var(--red),#ff8a3d);display:grid;place-items:center}
.story-ring img{width:100%;height:100%;border-radius:50%;object-fit:cover;border:2px solid #fff}
.story span{display:block;font-size:11px;font-weight:600;margin-top:5px;line-height:1.15}

/* ===== HERO ===== */
.hero{max-width:1180px;margin:8px auto 0;padding:0 16px}
.hero-card{background:linear-gradient(110deg,#15171a,#2a2d34);color:#fff;border-radius:var(--radius);padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.hero-status{display:flex;align-items:center;gap:8px;font-weight:700}
.hero-status .dot{width:10px;height:10px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 4px rgba(26,166,75,.25)}
.hero-status.closed .dot{background:#ff5a5a;box-shadow:0 0 0 4px rgba(255,90,90,.25)}
.hero-meta{display:flex;gap:18px;flex-wrap:wrap;font-size:13px;color:#cfd2d8;font-weight:600}

/* ===== MENU ===== */
.menu{max-width:1180px;margin:0 auto;padding:8px 16px 40px}
.cat-section{padding-top:22px;scroll-margin-top:130px}
.cat-section h2{font-size:22px;font-weight:800;margin-bottom:14px;display:flex;align-items:center;gap:8px}
.cat-section h2 .count{font-size:13px;font-weight:600;color:var(--muted);background:var(--bg);padding:2px 10px;border-radius:999px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}

.card{background:var(--card);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column;cursor:pointer;transition:transform .15s,box-shadow .15s;position:relative}
.card:hover{transform:translateY(-3px);box-shadow:0 12px 30px rgba(20,23,26,.14)}
.card-img{aspect-ratio:1/1;width:100%;object-fit:cover;background:#f0f0f2}
.card-fav{position:absolute;top:10px;right:10px;width:34px;height:34px;border-radius:50%;border:0;background:rgba(255,255,255,.92);display:grid;place-items:center;cursor:pointer;color:#9aa0a8;backdrop-filter:blur(4px)}
.card-fav.active{color:var(--red)}
.card-fav .material-symbols-outlined{font-size:20px}
.card-fav.active .material-symbols-outlined{font-variation-settings:'FILL'1}
.card-badge{position:absolute;top:10px;left:10px;background:var(--red);color:#fff;font-size:11px;font-weight:800;padding:4px 9px;border-radius:999px}
.card-body{padding:12px 14px 14px;display:flex;flex-direction:column;flex:1;gap:6px}
.card-title{font-weight:700;font-size:15px;line-height:1.25}
.card-desc{font-size:12.5px;color:var(--muted);line-height:1.35;flex:1;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-foot{display:flex;align-items:center;justify-content:space-between;margin-top:6px;gap:8px}
.price{font-weight:800;font-size:17px}
.price .old{font-size:12px;color:var(--muted);text-decoration:line-through;font-weight:600;margin-left:6px}

.btn-add{border:0;background:var(--red);color:#fff;font:inherit;font-weight:700;font-size:14px;padding:9px 16px;border-radius:11px;cursor:pointer;display:flex;align-items:center;gap:4px}
.btn-add:hover{background:var(--red-d)}

/* qty stepper */
.stepper{display:flex;align-items:center;background:var(--red);border-radius:11px;color:#fff;font-weight:800}
.stepper button{border:0;background:none;color:#fff;width:34px;height:36px;font-size:20px;cursor:pointer;display:grid;place-items:center}
.stepper span{min-width:24px;text-align:center;font-size:15px}

/* ===== BUTTONS ===== */
.btn-primary{border:0;background:var(--red);color:#fff;font:inherit;font-weight:700;border-radius:12px;cursor:pointer;padding:12px 18px}
.btn-primary:hover{background:var(--red-d)}
.btn-primary.big{width:100%;padding:15px;font-size:16px}
.btn-primary:disabled{background:#c9ccd2;cursor:not-allowed}

/* ===== BOTTOM NAV ===== */
.bnav{position:fixed;bottom:0;left:0;right:0;z-index:45;background:#fff;display:none;justify-content:space-around;border-top:1px solid var(--line);padding:6px 0 calc(6px + env(safe-area-inset-bottom))}
.bnav-btn{position:relative;border:0;background:none;font:inherit;font-size:10.5px;font-weight:600;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;padding:4px 14px}
.bnav-btn.active{color:var(--red)}
.bnav-btn .material-symbols-outlined{font-size:24px}
.bnav-badge{position:absolute;top:0;right:8px;background:var(--red);color:#fff}

/* ===== OVERLAY / DRAWER ===== */
.overlay{position:fixed;inset:0;background:rgba(15,17,20,.5);z-index:50;animation:fade .2s}
@keyframes fade{from{opacity:0}to{opacity:1}}
.drawer{position:fixed;top:0;right:0;height:100%;width:420px;max-width:92vw;background:#fff;z-index:55;display:flex;flex-direction:column;animation:slide .25s ease;box-shadow:-8px 0 40px rgba(0,0,0,.2)}
@keyframes slide{from{transform:translateX(100%)}to{transform:translateX(0)}}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line)}
.drawer-head h2{font-size:20px;font-weight:800}

.cart-items{flex:1;overflow-y:auto;padding:8px 16px}
.cart-empty{text-align:center;color:var(--muted);padding:60px 20px;font-weight:600}
.cart-empty .material-symbols-outlined{font-size:56px;display:block;margin-bottom:10px;color:var(--line)}
.ci{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.ci img{width:62px;height:62px;border-radius:12px;object-fit:cover;flex:none}
.ci-mid{flex:1;min-width:0}
.ci-mid .t{font-weight:700;font-size:14px;line-height:1.25}
.ci-mid .p{color:var(--muted);font-size:13px;font-weight:600;margin-top:2px}
.ci-right{display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:8px}
.ci .stepper{transform:scale(.9);transform-origin:right}

.cart-foot{padding:16px 20px calc(16px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff}
.free-bar{font-size:13px;font-weight:600;color:var(--ok);background:#eafaf0;border-radius:10px;padding:9px 12px;margin-bottom:12px;text-align:center}
.free-bar.warn{color:var(--red);background:#fdeced}
.cart-total{display:flex;justify-content:space-between;font-weight:800;font-size:19px;margin-bottom:12px}

/* ===== MODALS ===== */
.modal{position:fixed;inset:0;z-index:60;background:rgba(15,17,20,.5);display:grid;place-items:center;padding:16px;animation:fade .2s;overflow-y:auto}
.modal-card{background:#fff;border-radius:20px;width:100%;max-width:460px;animation:pop .2s ease;max-height:92vh;overflow-y:auto}
@keyframes pop{from{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}

/* product modal */
.pm-img{width:100%;aspect-ratio:16/11;object-fit:cover;border-radius:20px 20px 0 0;background:#f0f0f2}
.pm-body{padding:20px}
.pm-close{position:absolute;top:14px;right:14px;background:rgba(255,255,255,.92)}
.pm-title{font-size:22px;font-weight:800;margin-bottom:8px}
.pm-desc{color:var(--muted);font-size:14px;line-height:1.5;margin-bottom:18px}
.pm-foot{display:flex;align-items:center;justify-content:space-between;gap:14px}
.pm-foot .price{font-size:24px}

/* checkout */
.checkout-card{max-width:480px}
.checkout-form{padding:18px 20px;display:flex;flex-direction:column;gap:14px}
.checkout-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;color:var(--ink)}
.checkout-form input,.checkout-form select,.checkout-form textarea{border:1px solid var(--line);border-radius:11px;padding:12px;font:inherit;font-size:15px;font-weight:500;outline:none;background:#fff}
.checkout-form input:focus,.checkout-form select:focus,.checkout-form textarea:focus{border-color:var(--red)}
.checkout-form textarea{resize:vertical}
.seg{display:flex;background:var(--bg);border-radius:12px;padding:4px;gap:4px}
.seg-btn{flex:1;border:0;background:none;font:inherit;font-weight:600;font-size:13px;padding:10px;border-radius:9px;cursor:pointer;color:var(--muted)}
.seg-btn.active{background:#fff;color:var(--red);box-shadow:0 2px 6px rgba(0,0,0,.08)}
.pay-label{font-size:13px;font-weight:700;display:block;margin-bottom:6px}
.pay-seg .seg-btn{font-size:12px;padding:9px 4px}
.co-summary{background:var(--bg);border-radius:12px;padding:14px;font-size:14px;font-weight:600;display:flex;flex-direction:column;gap:8px}
.co-items{display:flex;flex-direction:column;gap:5px;padding-bottom:8px;border-bottom:1px solid var(--line);font-size:13px;font-weight:500}
.co-item{display:flex;justify-content:space-between;gap:8px;color:var(--ink)}
.co-item .t{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.co-item .q{color:var(--muted);flex:none}
.co-row{display:flex;justify-content:space-between;color:var(--muted)}
.co-free-hint{font-size:12px;font-weight:500;color:var(--ok);margin:-2px 0}
.co-branch-hint{font-size:12px;font-weight:500;color:var(--muted);margin:-2px 0}
.co-summary .co-total{display:flex;justify-content:space-between;color:var(--ink);font-weight:800;font-size:17px;border-top:1px solid var(--line);padding-top:8px;margin-top:2px}

/* success */
.success-card{text-align:center;padding:34px 26px}
.success-ico{font-size:60px;margin-bottom:10px}
.success-card h2{font-size:24px;font-weight:800;margin-bottom:8px}
.success-card p{color:var(--ink);margin-bottom:8px}
.success-card .muted{color:var(--muted);font-size:14px}
.status-track{display:flex;justify-content:space-between;margin:20px 0;position:relative}
.status-track::before{content:"";position:absolute;top:13px;left:10%;right:10%;height:3px;background:var(--line)}
.st-step{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--muted);flex:1}
.st-step .dot{width:28px;height:28px;border-radius:50%;background:var(--line);display:grid;place-items:center;color:#fff}
.st-step.done .dot{background:var(--ok)}
.st-step.done{color:var(--ink)}

/* footer */
.ftr{background:var(--ink);color:#cfd2d8;margin-top:30px}
.ftr-grid{max-width:1180px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:30px;padding:40px 16px}
.ftr-col h3{color:#fff;font-size:16px;margin-bottom:12px}
.ftr-col p{font-size:14px;line-height:1.7}
.ftr-col a:hover{color:#fff}
.socials{display:flex;gap:10px;margin-top:14px}
.soc{width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.1);display:grid;place-items:center;color:#fff}
.soc:hover{background:var(--red)}
.ftr-bottom{border-top:1px solid rgba(255,255,255,.1);padding:18px 16px;text-align:center;font-size:12.5px;color:#8a8f98}

/* auth */
.auth-card{max-width:420px}
.auth-body{padding:18px 20px 22px}
.auth-lead{font-size:13.5px;color:var(--muted);font-weight:600;margin-bottom:14px;line-height:1.5}
.auth-form{display:flex;flex-direction:column;gap:12px;margin-top:14px}
.auth-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700}
.auth-form input{border:1px solid var(--line);border-radius:11px;padding:12px;font:inherit;font-size:15px;outline:none}
.auth-form input:focus{border-color:var(--red)}
.auth-form .agree{flex-direction:row;align-items:flex-start;gap:8px;font-weight:600;font-size:13px;color:var(--muted)}
.auth-form .agree input{width:18px;height:18px;flex:none;margin-top:1px}
.auth-form .agree a{color:var(--red);text-decoration:underline}
.auth-err{color:var(--red);font-size:13px;font-weight:600;min-height:16px;margin:-2px 0 0}
.btn-guest{width:100%;margin-top:14px;border:1px solid var(--line);background:#fff;color:var(--ink);font:inherit;font-weight:700;padding:13px;border-radius:12px;cursor:pointer}
.btn-guest:hover{background:var(--bg)}
.auth-hello{font-size:16px;font-weight:700;margin-bottom:4px}
#authProfile .muted{margin-bottom:16px}

/* toast */
.toast-wrap{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);z-index:80;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{background:var(--ink);color:#fff;padding:12px 20px;border-radius:12px;font-weight:600;font-size:14px;box-shadow:0 8px 24px rgba(0,0,0,.3);animation:toastin .25s}
@keyframes toastin{from{transform:translateY(14px);opacity:0}to{transform:translateY(0);opacity:1}}

/* ===== RESPONSIVE ===== */
@media(max-width:880px){
  .mode-toggle,.hdr-info{display:none}
  .brand-txt h1{font-size:13px}
}
@media(max-width:680px){
  body{padding-bottom:64px}
  .bnav{display:flex}
  .grid{grid-template-columns:repeat(2,1fr);gap:11px}
  .card-img{aspect-ratio:1/.92}
  .card-title{font-size:13.5px}
  .card-desc{display:none}
  .card-body{padding:10px 11px 12px}
  .price{font-size:15px}
  .btn-add{padding:8px 11px;font-size:13px}
  .btn-add span:not(.material-symbols-outlined){display:none}
  .cat-section h2{font-size:19px}
  .hero-meta{font-size:12px;gap:10px}
  .brand-sub{display:none}
  .toast-wrap{bottom:80px}
}
