*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html{height:100%;font-size:16px}
body{height:100%;background:#f7f7f7;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;color:#1a1a1a;overscroll-behavior:none}
#app{height:100%;display:flex;flex-direction:column}
button{border:none;background:none;cursor:pointer;font:inherit;color:inherit}
input{font:inherit;border:none;outline:none;background:none}
img{display:block;width:100%;height:100%;object-fit:cover}

/* ── LOADER ── */
.loader-screen{position:fixed;inset:0;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;gap:16px}
.loader-screen svg{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.loader-screen p{font-size:14px;color:#888}

/* ── SHELL ── */
.shell{display:flex;flex-direction:column;height:100%;max-width:480px;margin:0 auto;background:#fff}
.page{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:80px}

/* ── BOTTOM NAV ── */
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;background:#fff;border-top:1px solid #ebebeb;display:flex;z-index:100;padding-bottom:env(safe-area-inset-bottom)}
.nav-item{flex:1;display:flex;flex-direction:column;align-items:center;padding:8px 4px 6px;gap:3px;font-size:10px;color:#999;position:relative}
.nav-item.active{color:#f55b23}
.nav-item svg{width:24px;height:24px}
.nav-badge{position:absolute;top:4px;right:calc(50% - 20px);background:#f55b23;color:#fff;font-size:10px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px;line-height:1}

/* ── ADDRESS SCREEN ── */
.addr-screen{display:flex;flex-direction:column;height:100%;padding:0}
.addr-hero{background:#f55b23;padding:32px 20px 24px;color:#fff}
.addr-hero h1{font-size:22px;font-weight:800;line-height:1.2;margin-bottom:6px}
.addr-hero p{font-size:14px;opacity:.85}
.addr-tabs{display:flex;background:#fff;border-bottom:1px solid #ebebeb}
.addr-tab{flex:1;padding:14px;text-align:center;font-size:15px;font-weight:600;color:#888;border-bottom:2px solid transparent}
.addr-tab.active{color:#f55b23;border-bottom-color:#f55b23}
.addr-body{flex:1;padding:16px;overflow-y:auto}
.addr-input-wrap{position:relative;margin-bottom:12px}
.addr-input-wrap input{width:100%;background:#f5f5f5;border-radius:12px;padding:14px 16px 14px 44px;font-size:15px;color:#1a1a1a}
.addr-input-wrap input::placeholder{color:#bbb}
.addr-input-wrap .search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#bbb}
.suggestion-list{background:#fff;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,.1);overflow:hidden}
.suggestion-item{padding:14px 16px;border-bottom:1px solid #f5f5f5;font-size:14px;cursor:pointer;display:flex;flex-direction:column;gap:2px}
.suggestion-item:last-child{border-bottom:none}
.suggestion-item:active{background:#fef5f1}
.suggestion-main{font-weight:500;color:#1a1a1a}
.suggestion-sub{font-size:12px;color:#888}
.pickup-list{display:flex;flex-direction:column;gap:10px}
.pickup-item{background:#f5f5f5;border-radius:12px;padding:14px 16px;cursor:pointer;border:2px solid transparent}
.pickup-item.selected{border-color:#f55b23;background:#fef5f1}
.pickup-item h3{font-size:14px;font-weight:600;margin-bottom:2px}
.pickup-item p{font-size:12px;color:#888}
.addr-confirm-btn{width:100%;background:#f55b23;color:#fff;font-size:16px;font-weight:700;padding:16px;border-radius:14px;margin-top:16px}
.addr-confirm-btn:disabled{opacity:.5}

/* ── TOPBAR ── */
.topbar{background:#fff;padding:12px 16px 0;border-bottom:1px solid #ebebeb;position:sticky;top:0;z-index:50}
.topbar-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.topbar-addr{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:#1a1a1a;background:none;cursor:pointer;max-width:calc(100% - 60px)}
.topbar-addr svg{color:#f55b23;flex-shrink:0}
.topbar-addr span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-logo{font-size:24px}
.type-tabs{display:flex;gap:2px;margin-bottom:0}
.type-tab{padding:8px 20px;border-radius:8px 8px 0 0;font-size:14px;font-weight:600;color:#888;background:none}
.type-tab.active{color:#f55b23;background:#fef5f1}

/* ── CATEGORY BAR ── */
.cat-bar{display:flex;gap:8px;overflow-x:auto;padding:10px 16px;background:#fff;position:sticky;top:56px;z-index:40;border-bottom:1px solid #ebebeb;scrollbar-width:none}
.cat-bar::-webkit-scrollbar{display:none}
.cat-chip{flex-shrink:0;padding:7px 14px;border-radius:20px;font-size:13px;font-weight:600;color:#666;background:#f5f5f5;white-space:nowrap}
.cat-chip.active{background:#f55b23;color:#fff}

/* ── PRODUCT GRID ── */
.section-title{font-size:20px;font-weight:800;padding:16px 16px 10px;color:#1a1a1a}
.product-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 16px 4px}
.product-card{background:#fff;border-radius:16px;overflow:hidden;border:1px solid #f0f0f0;cursor:pointer;transition:transform .15s;display:flex;flex-direction:column}
.product-card:active{transform:scale(.97)}
.product-img{aspect-ratio:1;background:#f5f5f5;position:relative;overflow:hidden}
.product-img img{width:100%;height:100%;object-fit:cover}
.product-img-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:48px;background:#f5f5f5}
.product-body{padding:10px;flex:1;display:flex;flex-direction:column;gap:6px}
.product-name{font-size:13px;font-weight:700;line-height:1.3;color:#1a1a1a}
.product-desc{font-size:11px;color:#888;line-height:1.4;flex:1}
.product-footer{display:flex;align-items:center;justify-content:space-between;margin-top:4px}
.product-price{font-size:13px;font-weight:700;color:#1a1a1a}
.product-price small{font-size:11px;color:#888;font-weight:400}
.add-btn{width:32px;height:32px;border-radius:50%;background:#f55b23;color:#fff;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:300;line-height:1;flex-shrink:0}
.add-btn:active{transform:scale(.9)}
.add-btn.loading{opacity:.6;pointer-events:none}

/* ── PRODUCT SHEET ── */
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:200;display:flex;flex-direction:column;justify-content:flex-end;animation:fadeIn .2s}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.product-sheet{background:#fff;border-radius:20px 20px 0 0;max-height:90vh;overflow-y:auto;-webkit-overflow-scrolling:touch;animation:slideUp .25s ease-out}
@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.sheet-handle{width:40px;height:4px;background:#e0e0e0;border-radius:2px;margin:10px auto 0}
.sheet-img{aspect-ratio:1;background:#f5f5f5;max-height:240px;overflow:hidden}
.sheet-img img{width:100%;height:100%;object-fit:cover}
.sheet-body{padding:16px}
.sheet-name{font-size:20px;font-weight:800;margin-bottom:6px}
.sheet-desc{font-size:13px;color:#666;line-height:1.5;margin-bottom:16px}
.sheet-section{font-size:13px;font-weight:700;color:#888;margin-bottom:10px;text-transform:uppercase;letter-spacing:.5px}
.size-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px}
.size-btn{border:2px solid #e8e8e8;border-radius:12px;padding:10px 4px;text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.size-btn.selected{border-color:#f55b23;background:#fef5f1}
.size-name{font-size:12px;font-weight:700;display:block;margin-bottom:2px}
.size-cm{font-size:11px;color:#888;display:block;margin-bottom:4px}
.size-price{font-size:14px;font-weight:800;color:#f55b23;display:block}
.sheet-add-btn{width:100%;background:#f55b23;color:#fff;font-size:16px;font-weight:700;padding:16px;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:8px}
.sheet-add-btn:disabled{opacity:.5}
.sheet-close{position:absolute;top:12px;right:16px;width:32px;height:32px;border-radius:50%;background:#f5f5f5;display:flex;align-items:center;justify-content:center;z-index:1;cursor:pointer}

/* ── CART ── */
.screen-header{padding:20px 16px 12px}
.screen-header h1{font-size:24px;font-weight:800}
.screen-header p{font-size:14px;color:#888;margin-top:4px}
.cart-list{padding:0 16px;display:flex;flex-direction:column;gap:12px}
.cart-item{display:flex;align-items:center;gap:12px;background:#fff;border-radius:14px;padding:12px;border:1px solid #f0f0f0}
.cart-thumb{width:64px;height:64px;border-radius:10px;overflow:hidden;background:#f5f5f5;flex-shrink:0}
.cart-info{flex:1;min-width:0}
.cart-item-name{font-size:14px;font-weight:600;line-height:1.3;margin-bottom:2px}
.cart-item-sub{font-size:12px;color:#888}
.cart-item-price{font-size:14px;font-weight:700;margin-top:4px}
.qty-ctrl{display:flex;align-items:center;gap:10px;flex-shrink:0}
.qty-btn{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:300}
.qty-btn.minus{background:#f5f5f5;color:#1a1a1a}
.qty-btn.plus{background:#f55b23;color:#fff}
.qty-num{font-size:15px;font-weight:700;min-width:20px;text-align:center}
.cart-footer{position:sticky;bottom:80px;background:#fff;border-top:1px solid #ebebeb;padding:16px;margin-top:16px}
.cart-total-row{display:flex;justify-content:space-between;margin-bottom:14px;font-size:16px;font-weight:600}
.checkout-btn{width:100%;background:#f55b23;color:#fff;font-size:16px;font-weight:700;padding:16px;border-radius:14px}
.empty-state{display:flex;flex-direction:column;align-items:center;padding:60px 20px;text-align:center;gap:12px}
.empty-icon{font-size:64px}
.empty-state h2{font-size:20px;font-weight:800}
.empty-state p{font-size:14px;color:#888;line-height:1.5}
.empty-state button{margin-top:8px;background:#f55b23;color:#fff;padding:14px 32px;border-radius:14px;font-size:15px;font-weight:700}

/* ── CHECKOUT ── */
.checkout-section{padding:16px;border-bottom:1px solid #f0f0f0}
.checkout-section h2{font-size:16px;font-weight:700;margin-bottom:12px}
.checkout-addr-row{display:flex;align-items:center;gap:10px;background:#f5f5f5;border-radius:12px;padding:12px;cursor:pointer}
.checkout-addr-row svg{color:#f55b23;flex-shrink:0}
.checkout-addr-text{flex:1;font-size:14px;font-weight:500}
.checkout-addr-text small{display:block;font-size:12px;color:#888;font-weight:400;margin-top:2px}
.payment-options{display:flex;flex-direction:column;gap:8px}
.payment-opt{display:flex;align-items:center;gap:12px;padding:12px;border-radius:12px;border:2px solid #ebebeb;cursor:pointer}
.payment-opt.selected{border-color:#f55b23;background:#fef5f1}
.payment-opt svg{color:#888}
.payment-opt.selected svg{color:#f55b23}
.payment-opt-text{flex:1}
.payment-opt-text b{display:block;font-size:14px;font-weight:600}
.payment-opt-text small{font-size:12px;color:#888}
.radio{width:20px;height:20px;border-radius:50%;border:2px solid #ddd;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.radio.checked{border-color:#f55b23}
.radio.checked::after{content:'';width:10px;height:10px;border-radius:50%;background:#f55b23}
.order-summary{padding:16px}
.order-summary-row{display:flex;justify-content:space-between;font-size:14px;padding:4px 0;color:#666}
.order-summary-row.total{font-size:16px;font-weight:700;color:#1a1a1a;border-top:1px solid #f0f0f0;margin-top:8px;padding-top:12px}
.place-order-btn{width:100%;background:#f55b23;color:#fff;font-size:16px;font-weight:700;padding:17px;border-radius:14px;margin:0 16px 16px;width:calc(100% - 32px)}
.place-order-btn:disabled{opacity:.5}

/* ── ORDER SUCCESS ── */
.order-success{display:flex;flex-direction:column;align-items:center;padding:60px 20px;text-align:center;gap:14px}
.order-success .success-icon{width:80px;height:80px;background:#fef5f1;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:40px}
.order-success h1{font-size:24px;font-weight:800}
.order-success p{font-size:14px;color:#666;line-height:1.6}
.order-success button{background:#f55b23;color:#fff;font-size:15px;font-weight:700;padding:14px 40px;border-radius:14px;margin-top:8px}

/* ── PROFILE ── */
.profile-header{background:#f55b23;padding:40px 20px 30px;color:#fff;text-align:center}
.profile-avatar{width:72px;height:72px;border-radius:50%;background:rgba(255,255,255,.3);margin:0 auto 12px;display:flex;align-items:center;justify-content:center;font-size:32px}
.profile-name{font-size:20px;font-weight:800;margin-bottom:4px}
.profile-phone{font-size:14px;opacity:.8}
.profile-menu{padding:16px;display:flex;flex-direction:column;gap:2px}
.profile-row{display:flex;align-items:center;gap:12px;padding:14px 12px;border-radius:12px;cursor:pointer;font-size:15px;font-weight:500}
.profile-row:active{background:#f5f5f5}
.profile-row svg{color:#f55b23;flex-shrink:0}
.profile-row span{flex:1}
.profile-row .chevron{color:#ccc}
.balance-card{margin:0 16px 16px;background:#fef5f1;border-radius:14px;padding:16px;display:flex;align-items:center;gap:12px}
.balance-card svg{color:#f55b23;flex-shrink:0}
.balance-info b{display:block;font-size:18px;font-weight:800;color:#f55b23}
.balance-info small{font-size:12px;color:#888}

/* ── TOAST ── */
.toast{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);background:rgba(26,26,26,.9);color:#fff;font-size:14px;font-weight:500;padding:12px 20px;border-radius:24px;white-space:nowrap;z-index:1000;animation:toastIn .2s;pointer-events:none}
@keyframes toastIn{from{opacity:0;transform:translateX(-50%) translateY(10px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}

/* ── SKELETONS ── */
.skeleton{background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);background-size:200%;animation:shimmer 1.4s infinite}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.skel-card{border-radius:16px;overflow:hidden;border:1px solid #f0f0f0}
.skel-img{aspect-ratio:1;background:#ebebeb}
.skel-body{padding:10px;display:flex;flex-direction:column;gap:6px}
.skel-line{height:12px;border-radius:6px}
.skel-line.w80{width:80%}
.skel-line.w50{width:50%}
.skel-line.w30{width:30%}
