/* ===========================
   KIRANA DELIVERY — MAIN CSS
   =========================== */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --secondary: #f59e0b;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07),0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Segoe UI',system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text);line-height:1.55;font-size:15px}
img{max-width:100%;height:auto;display:block}
a{text-decoration:none;color:var(--primary)}
button{font-family:inherit}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--primary-light);border-radius:3px}

/* Layout */
.container{max-width:1180px;margin:0 auto;padding:0 1rem}
.container-sm{max-width:820px;margin:0 auto;padding:0 1rem}
.container-xs{max-width:500px;margin:0 auto;padding:0 1rem}

/* ===== HEADER ===== */
.site-header{background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);color:#fff;padding:.9rem 0;position:sticky;top:0;z-index:200;box-shadow:0 2px 12px rgba(79,70,229,.35)}
.site-header .container{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.site-logo{font-size:1.35rem;font-weight:700;color:#fff;display:flex;align-items:center;gap:.5rem}
.header-nav{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.header-nav a{color:rgba(255,255,255,.85);font-weight:500;padding:.4rem .8rem;border-radius:8px;transition:.2s;font-size:.9rem}
.header-nav a:hover,.header-nav a.active{background:rgba(255,255,255,.18);color:#fff}
.cart-link{position:relative;font-size:1.3rem;line-height:1}
.cart-badge{position:absolute;top:-7px;right:-9px;background:var(--secondary);color:#fff;font-size:.68rem;font-weight:700;border-radius:50%;width:18px;height:18px;display:flex;align-items:center;justify-content:center}
.notif-dot{display:inline-block;width:8px;height:8px;background:var(--danger);border-radius:50%;margin-left:4px;vertical-align:middle}

/* ===== SIDEBAR (Shop Admin) ===== */
.admin-layout{display:flex;min-height:calc(100vh - 64px)}
.sidebar{width:235px;background:#1e1b4b;color:#fff;padding:1.25rem 0;position:sticky;top:64px;height:calc(100vh - 64px);overflow-y:auto;flex-shrink:0;transition:.3s}
.sidebar-shop{padding:.75rem 1.25rem 1.25rem;border-bottom:1px solid rgba(255,255,255,.1);margin-bottom:.75rem}
.sidebar-shop h3{font-size:.95rem;color:rgba(255,255,255,.9);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-shop p{font-size:.78rem;color:rgba(255,255,255,.5);margin-top:.2rem}
.sidebar-nav a{display:flex;align-items:center;gap:.75rem;padding:.7rem 1.25rem;color:rgba(255,255,255,.7);font-weight:500;transition:.2s;font-size:.92rem}
.sidebar-nav a:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar-nav a.active{background:rgba(99,102,241,.35);color:#fff;border-right:3px solid #818cf8}
.sidebar-nav .ni{font-size:1.1rem;width:22px;text-align:center}
.admin-main{flex:1;padding:2rem 1.5rem;overflow-x:hidden;min-width:0}

/* ===== CARDS ===== */
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.card-header{padding:1.1rem 1.4rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.card-header h2,.card-header h3{font-size:1.05rem;font-weight:600}
.card-body{padding:1.4rem}
.card-footer{padding:.9rem 1.4rem;border-top:1px solid var(--border);background:#fafafa}

/* Stats */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:1rem;margin-bottom:1.75rem}
.stat-card{background:var(--card);border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow);border-left:4px solid var(--primary);min-width:0;overflow:hidden}
.stat-card.green{border-left-color:var(--success)}
.stat-card.amber{border-left-color:var(--secondary)}
.stat-card.red{border-left-color:var(--danger)}
.stat-card.blue{border-left-color:var(--info)}
.stat-icon{font-size:1.8rem;margin-bottom:.5rem}
.stat-value{font-size:clamp(1.1rem,3.5vw,1.6rem);font-weight:700;word-break:break-word;overflow-wrap:anywhere;line-height:1.25}
.stat-label{font-size:.78rem;color:var(--text-muted);margin-top:.2rem;word-break:break-word}

/* Shop Cards */
.shop-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(275px,1fr));gap:1.2rem}
.shop-card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;display:block;color:inherit;transition:.25s}
.shop-card:hover{transform:translateY(-5px);box-shadow:var(--shadow-lg)}
.shop-card-img{height:135px;background:linear-gradient(135deg,#e0e7ff,#c7d2fe);display:flex;align-items:center;justify-content:center;font-size:3.5rem;overflow:hidden;position:relative}
.shop-card-img img{width:100%;height:100%;object-fit:cover}
.closed-tag{position:absolute;top:8px;right:8px;background:rgba(220,38,38,.85);color:#fff;font-size:.75rem;font-weight:700;padding:.2rem .5rem;border-radius:6px}
.shop-card-body{padding:.95rem 1rem}
.shop-card-name{font-size:1.05rem;font-weight:600;margin-bottom:.3rem}
.shop-card-meta{font-size:.83rem;color:var(--text-muted);display:flex;gap:.75rem;flex-wrap:wrap}
.shop-card-footer{padding:.7rem 1rem;border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}

/* Product Cards */
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(195px,1fr));gap:1rem}
.product-card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;transition:.2s;display:flex;flex-direction:column}
.product-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
.product-card-img{aspect-ratio:1;background:#f8fafc;display:flex;align-items:center;justify-content:center;font-size:3rem;overflow:hidden;position:relative}
.product-card-img img{width:100%;height:100%;object-fit:cover}
.disc-tag{position:absolute;top:8px;left:8px;background:var(--danger);color:#fff;font-size:.75rem;font-weight:700;padding:.2rem .5rem;border-radius:6px}
.product-card-body{padding:.85rem;flex:1;display:flex;flex-direction:column;gap:.25rem}
.product-card-name{font-weight:600;font-size:.92rem;line-height:1.3}
.product-card-unit{font-size:.78rem;color:var(--text-muted)}
.product-price-row{display:flex;align-items:center;gap:.4rem;margin-top:.3rem}
.product-price{color:var(--primary);font-weight:700;font-size:1.05rem}
.product-orig{text-decoration:line-through;color:var(--text-muted);font-size:.82rem}
.product-card-footer{padding:0 .85rem .85rem}

/* ===== BUTTONS ===== */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.6rem 1.2rem;border-radius:var(--radius-sm);font-size:.92rem;font-weight:600;cursor:pointer;border:none;font-family:inherit;transition:.2s;line-height:1.2}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-dark)}
.btn-success{background:var(--success);color:#fff}.btn-success:hover{background:#047857}
.btn-danger{background:var(--danger);color:#fff}.btn-danger:hover{background:#b91c1c}
.btn-warning{background:var(--warning);color:#fff}.btn-warning:hover{background:#b45309}
.btn-info{background:var(--info);color:#fff}.btn-info:hover{background:#0369a1}
.btn-secondary{background:#e2e8f0;color:var(--text)}.btn-secondary:hover{background:#cbd5e1}
.btn-outline{background:transparent;color:var(--primary);border:2px solid var(--primary)}.btn-outline:hover{background:var(--primary);color:#fff}
.btn-sm{padding:.38rem .8rem;font-size:.82rem}
.btn-lg{padding:.82rem 1.75rem;font-size:1rem}
.btn-block{width:100%}
.btn:disabled{opacity:.5;cursor:not-allowed}

/* ===== FORMS ===== */
.form-group{margin-bottom:1.15rem}
.form-label{display:block;font-size:.88rem;font-weight:500;margin-bottom:.38rem;color:var(--text)}
.form-control{width:100%;padding:.62rem .88rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.94rem;font-family:inherit;color:var(--text);background:#fff;transition:.2s}
.form-control:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.form-control::placeholder{color:#94a3b8}
textarea.form-control{resize:vertical;min-height:88px}
select.form-control{cursor:pointer}
.form-hint{font-size:.8rem;color:var(--text-muted);margin-top:.28rem}
.form-error{font-size:.8rem;color:var(--danger);margin-top:.28rem}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.form-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem}

/* ===== BADGES ===== */
.badge{display:inline-flex;align-items:center;padding:.22rem .55rem;border-radius:20px;font-size:.78rem;font-weight:600;gap:.2rem}
.badge-primary{background:#e0e7ff;color:#4338ca}
.badge-success{background:#dcfce7;color:#15803d}
.badge-danger{background:#fee2e2;color:#dc2626}
.badge-warning{background:#fef3c7;color:#d97706}
.badge-info{background:#e0f2fe;color:#0369a1}
.badge-gray{background:#f1f5f9;color:#64748b}
.badge-purple{background:#f3e8ff;color:#7c3aed}
/* order status */
.s-pending{background:#fef3c7;color:#92400e}
.s-accepted{background:#dbeafe;color:#1d4ed8}
.s-preparing{background:#fce7f3;color:#9d174d}
.s-out_for_delivery{background:#dcfce7;color:#15803d}
.s-delivered{background:#f0fdf4;color:#166534}
.s-rejected{background:#fee2e2;color:#991b1b}
.s-cancelled{background:#f1f5f9;color:#475569}

/* ===== TABLES ===== */
.table-wrap{overflow-x:auto;border-radius:var(--radius);box-shadow:var(--shadow)}
table{width:100%;border-collapse:collapse;background:var(--card)}
th{padding:.8rem 1rem;text-align:left;font-size:.78rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;background:#f8fafc;border-bottom:1px solid var(--border)}
td{padding:.92rem 1rem;border-bottom:1px solid var(--border);font-size:.9rem;vertical-align:middle}
tr:last-child td{border-bottom:none}
tbody tr:hover td{background:#fafafa}

/* ===== ALERTS ===== */
.alert{padding:.8rem 1.1rem;border-radius:var(--radius-sm);margin-bottom:1rem;font-size:.9rem;border-left:4px solid;display:flex;align-items:flex-start;gap:.5rem}
.alert-success{background:#f0fdf4;border-color:var(--success);color:#166534}
.alert-danger{background:#fff1f2;border-color:var(--danger);color:#991b1b}
.alert-warning{background:#fffbeb;border-color:var(--warning);color:#92400e}
.alert-info{background:#eff6ff;border-color:var(--info);color:#1e40af}

/* ===== MODAL ===== */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:1000;display:flex;align-items:center;justify-content:center;padding:1rem;opacity:0;pointer-events:none;transition:.3s}
.modal-overlay.show{opacity:1;pointer-events:all}
.modal{background:#fff;border-radius:var(--radius-lg);max-width:580px;width:100%;max-height:90vh;overflow-y:auto;transform:translateY(24px);transition:.3s;box-shadow:0 25px 60px rgba(0,0,0,.25)}
.modal-overlay.show .modal{transform:translateY(0)}
.modal-header{padding:1.2rem 1.5rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.modal-title{font-size:1.1rem;font-weight:600}
.modal-close{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--text-muted);line-height:1}
.modal-body{padding:1.5rem}
.modal-footer{padding:1rem 1.5rem;border-top:1px solid var(--border);display:flex;gap:.75rem;justify-content:flex-end}

/* ===== TOAST ===== */
.toast-container{position:fixed;bottom:1.5rem;right:1.5rem;z-index:2000;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}
.toast{background:#1e293b;color:#fff;padding:.82rem 1.2rem;border-radius:var(--radius-sm);font-size:.88rem;box-shadow:var(--shadow-lg);animation:slideInR .3s ease;max-width:320px;display:flex;align-items:center;gap:.5rem}
.toast.success{background:var(--success)}.toast.error{background:var(--danger)}.toast.warning{background:var(--warning)}.toast.info{background:var(--info)}
@keyframes slideInR{from{transform:translateX(110%);opacity:0}to{transform:translateX(0);opacity:1}}
@keyframes fadeOut{to{opacity:0;transform:translateX(20px)}}

/* Stars */
.stars{display:inline-flex;gap:1px}
.star{color:#d1d5db;font-size:1rem}
.star.filled{color:#f59e0b}

/* Timeline */
.timeline{padding:.5rem 0}
.tl-item{display:flex;gap:1rem;padding-bottom:1.4rem;position:relative}
.tl-item:not(:last-child)::after{content:'';position:absolute;left:15px;top:32px;bottom:0;width:2px;background:var(--border)}
.tl-dot{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.95rem;flex-shrink:0}
.tl-dot.done{background:var(--success);color:#fff}
.tl-dot.active{background:var(--primary);color:#fff;box-shadow:0 0 0 4px rgba(79,70,229,.18)}
.tl-dot.pending{background:#e2e8f0;color:var(--text-muted)}
.tl-content{flex:1;padding-top:.35rem}
.tl-title{font-weight:600;font-size:.92rem}
.tl-time{font-size:.8rem;color:var(--text-muted)}

/* Qty control */
.qty-ctrl{display:flex;align-items:center;gap:.35rem}
.qty-btn{width:30px;height:30px;border-radius:50%;border:1.5px solid var(--border);background:#fff;cursor:pointer;font-size:1.1rem;display:flex;align-items:center;justify-content:center;transition:.2s;line-height:1}
.qty-btn:hover{border-color:var(--primary);color:var(--primary)}
.qty-val{font-weight:600;min-width:28px;text-align:center}

/* Empty state */
.empty-state{text-align:center;padding:3rem 1.5rem}
.empty-icon{font-size:3.5rem;margin-bottom:1rem;opacity:.55}
.empty-state h3{color:var(--text-muted);font-size:1.1rem;margin-bottom:.4rem}
.empty-state p{font-size:.88rem;color:var(--text-muted)}

/* Hero */
.hero{background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 60%,#6d28d9 100%);color:#fff;padding:3rem 0;text-align:center}
.hero h1{font-size:2.1rem;font-weight:800;margin-bottom:.7rem;letter-spacing:-.02em}
.hero p{font-size:1.05rem;opacity:.9;margin-bottom:1.75rem}

/* Location card */
.loc-card{background:#fff;border-radius:var(--radius-lg);padding:2rem;box-shadow:var(--shadow-lg);max-width:520px;margin:0 auto}
.loc-card h2{font-size:1.35rem;font-weight:700;margin-bottom:.4rem}
.loc-card p{color:var(--text-muted);margin-bottom:1.4rem;font-size:.92rem}

/* Auth pages */
.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);padding:2rem 1rem}
.auth-card{background:#fff;border-radius:var(--radius-lg);padding:2.4rem;width:100%;max-width:440px;box-shadow:0 20px 50px rgba(0,0,0,.18)}
.auth-logo{text-align:center;margin-bottom:1.75rem}
.auth-logo h2{font-size:1.55rem;font-weight:700;color:var(--primary)}
.auth-logo p{color:var(--text-muted);font-size:.88rem;margin-top:.3rem}
.auth-switch{text-align:center;margin-top:1.25rem;font-size:.88rem;color:var(--text-muted)}

/* Page header */
.page-hdr{margin-bottom:1.75rem;display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.page-hdr h1{font-size:1.45rem;font-weight:700}
.page-hdr p{font-size:.88rem;color:var(--text-muted);margin-top:.2rem}

/* Shop hero */
.shop-hero{background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;padding:1.5rem;border-radius:var(--radius-lg);margin-bottom:1.4rem;display:flex;align-items:center;gap:1.2rem}
.shop-hero-ic{font-size:2.8rem;background:rgba(255,255,255,.15);border-radius:var(--radius);padding:.7rem}
.shop-hero h1{font-size:1.45rem;font-weight:700;margin-bottom:.3rem}
.shop-hero-meta{opacity:.9;font-size:.88rem;display:flex;gap:1rem;flex-wrap:wrap}

/* Offer banner */
.offer-banner{background:linear-gradient(135deg,#fef3c7,#fde68a);border:1.5px solid #f59e0b;border-radius:var(--radius-sm);padding:.7rem 1rem;display:flex;align-items:center;gap:.5rem;font-size:.88rem;color:#92400e;font-weight:500;margin-bottom:.6rem}

/* Cart */
.cart-item{display:flex;align-items:center;gap:.75rem;padding:.7rem 0;border-bottom:1px solid var(--border)}
.cart-item-img{width:48px;height:48px;border-radius:8px;object-fit:cover;background:#f1f5f9;display:flex;align-items:center;justify-content:center;font-size:1.4rem;flex-shrink:0;overflow:hidden}
.cart-item-name{font-weight:500;font-size:.9rem}
.cart-item-price{color:var(--primary);font-weight:600;font-size:.88rem}
.cart-total{padding:.85rem 0;border-top:2px solid var(--border)}
.total-row{display:flex;justify-content:space-between;padding:.32rem 0;font-size:.9rem}
.total-row.final{font-weight:700;font-size:1rem;color:var(--primary);padding-top:.7rem;border-top:1px solid var(--border);margin-top:.3rem}

/* Orders */
.order-card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;margin-bottom:1rem}
.order-card-header{padding:.95rem 1.2rem;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);flex-wrap:wrap;gap:.5rem}
.order-num{font-weight:700;font-size:.95rem}
.order-card-body{padding:1.1rem 1.2rem}
.order-items li{display:flex;justify-content:space-between;padding:.35rem 0;font-size:.88rem;border-bottom:1px dashed var(--border)}
.order-items li:last-child{border-bottom:none}

/* Shop panel order */
.p-order{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);border-left:4px solid var(--primary);margin-bottom:1.2rem;overflow:hidden}
.p-order.new-order{border-left-color:var(--secondary);animation:pulseB 2s infinite}
@keyframes pulseB{0%,100%{border-left-color:var(--secondary)}50%{border-left-color:#fcd34d}}
.p-order-header{padding:1rem 1.2rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem}
.p-order-body{padding:1.1rem 1.2rem}
.p-order-footer{padding:.85rem 1.2rem;background:#fafafa;border-top:1px solid var(--border);display:flex;gap:.6rem;flex-wrap:wrap}

/* Delivery boy */
.db-card{background:var(--card);border-radius:var(--radius);padding:1.1rem;box-shadow:var(--shadow);display:flex;align-items:center;gap:1rem;margin-bottom:.75rem}
.db-avatar{width:52px;height:52px;border-radius:50%;object-fit:cover;background:#e0e7ff;display:flex;align-items:center;justify-content:center;font-size:1.5rem;flex-shrink:0;overflow:hidden}
.db-info{flex:1;min-width:0}
.db-name{font-weight:600;font-size:.95rem}
.db-meta{font-size:.8rem;color:var(--text-muted);margin-top:.15rem}
.db-actions{flex-shrink:0;display:flex;gap:.4rem}
.avail-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:4px}
.avail-dot.on{background:var(--success)}.avail-dot.off{background:var(--danger)}

/* Delivery dashboard */
.deliv-hero{background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;padding:1.4rem;border-radius:var(--radius);margin-bottom:1.4rem;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem}
.deliv-hero h2{font-size:1.2rem;font-weight:700}
.deliv-order{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow-md);padding:1.35rem;margin-bottom:1rem;border-top:4px solid var(--primary)}

/* Misc utilities */
.divider{border:none;border-top:1px solid var(--border);margin:1.25rem 0}
.text-muted{color:var(--text-muted)}.text-primary{color:var(--primary)}.text-success{color:var(--success)}.text-danger{color:var(--danger)}
.fw-bold{font-weight:700}.fw-semibold{font-weight:600}
.text-sm{font-size:.82rem}.text-lg{font-size:1.05rem}
.d-flex{display:flex}.align-center{align-items:center}.justify-between{justify-content:space-between}
.gap-1{gap:.5rem}.gap-2{gap:1rem}
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.p-1{padding:.5rem}.p-2{padding:1rem}.p-3{padding:1.5rem}
.rounded{border-radius:var(--radius)}.rounded-full{border-radius:9999px}
.w-100{width:100%}.text-center{text-align:center}
.section{padding:1.75rem 0}

/* Responsive */
@media(max-width:768px){
  .admin-layout{flex-direction:column}
  .sidebar{width:100%;height:auto;position:relative;top:0;display:flex;flex-wrap:wrap;gap:.25rem;padding:.5rem}
  .sidebar-shop{display:none}
  .sidebar-nav{display:flex;flex-wrap:wrap;width:100%}
  .sidebar-nav a{padding:.5rem .75rem;font-size:.82rem;border-right:none!important}
  .admin-main{padding:1rem}
  .hero h1{font-size:1.55rem}
  .form-row,.form-row-3{grid-template-columns:1fr}
  .shop-grid{grid-template-columns:1fr}
  .product-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .page-hdr{flex-direction:column;align-items:flex-start}
  .shop-hero{flex-direction:column;text-align:center}
}
@media(max-width:480px){
  .auth-card{padding:1.6rem}
  .hero h1{font-size:1.3rem}
  .product-grid{grid-template-columns:repeat(2,1fr)}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .container{padding:0 .75rem}
  .card-body{padding:1rem}
  .btn-lg{padding:.7rem 1.3rem}
  /* Make room for bottom nav */
  main.section { padding-bottom: 5rem !important; }
}

/* =====================================================
   BOTTOM NAVIGATION BAR — Mobile Native App Style
   ===================================================== */
.bottom-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.10);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 600;
    gap: .2rem;
    cursor: pointer;
    padding: .4rem 0;
    transition: color .2s;
  }
  .bottom-nav-item:hover,
  .bottom-nav-item.active { color: #4f46e5; }

  .bottom-nav-icon { font-size: 1.35rem; line-height: 1; }
  .bottom-nav-label { font-size: .68rem; font-weight: 600; letter-spacing: .02em; }

  /* ── Center Scan FAB (Swiggy style raised circle) ── */
  .bottom-nav-scan {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: -20px; /* raise above bar */
  }
  .scan-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 1.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(79,70,229,.55);
    transition: transform .2s, box-shadow .2s;
    border: 3px solid #fff;
  }
  .scan-fab:active {
    transform: scale(.92);
    box-shadow: 0 2px 10px rgba(79,70,229,.4);
  }

  /* Shop page float-cart needs to stay above bottom nav */
  .float-cart { bottom: 4.5rem !important; }
}

/* =====================================================
   DESKTOP — Scan QR Button in header area
   ===================================================== */
.scan-qr-desktop-btn {
  display: none;
}
@media (min-width: 769px) {
  .scan-qr-desktop-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.18);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .4rem .85rem;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
  }
  .scan-qr-desktop-btn:hover { background: rgba(255,255,255,.3); }
}

/* =====================================================
   SHOP CARD WRAP — for heart button positioning
   ===================================================== */
.shop-card-wrap { position: relative; }
.shop-card-wrap .shop-card { display: block; }

/* =====================================================================
   LAUNCH POLISH v2 — Mobile-first refinements (loaded last = overrides)
   ===================================================================== */

/* Crisper text + no grey tap flash on touch */
*{ -webkit-tap-highlight-color: transparent; }
body{ -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }

/* Respect notch / status bar on sticky header */
.site-header{ padding-top: calc(.9rem + env(safe-area-inset-top, 0px)); }

/* Hover effects ONLY on devices with a real pointer (prevents sticky
   hover state on touch screens) */
@media (hover:hover){
  .stat-card{ transition:transform .2s, box-shadow .2s; }
  .stat-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
}

/* Product name: clamp to 2 lines so cards stay even height */
.product-card-name{ display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.4em; }

/* Bottom-nav: active indicator pill + cart count badge */
.bottom-nav-item{ position:relative; }
.bottom-nav-item.active::before{
  content:''; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:26px; height:3px; border-radius:0 0 4px 4px; background:var(--primary);
}
.bottom-nav-badge{
  position:absolute; top:-6px; left:60%;
  background:var(--secondary); color:#fff; font-size:.6rem; font-weight:800;
  min-width:16px; height:16px; padding:0 4px; border-radius:9px;
  display:flex; align-items:center; justify-content:center; line-height:1;
  box-shadow:0 1px 4px rgba(0,0,0,.25);
}
.bottom-nav-icon{ position:relative; }

/* Reusable sticky action bar (e.g. checkout / accept) */
.sticky-cta{
  position:sticky; bottom:0; z-index:50;
  background:rgba(255,255,255,.97); backdrop-filter:blur(8px);
  border-top:1px solid var(--border);
  margin:1.25rem -1rem 0;
  padding:.85rem 1rem calc(.85rem + env(safe-area-inset-bottom,0px));
}

/* ---------- Touch-friendly sizing on phones/tablets ---------- */
@media (max-width:768px){
  body{ font-size:15.5px; }

  /* Bigger tap targets (Apple/Google guideline ~44px) */
  .btn{ min-height:44px; padding:.7rem 1.1rem; }
  .btn-sm{ min-height:38px; }
  .qty-btn{ width:36px; height:36px; font-size:1.25rem; }

  /* 16px inputs stop iOS Safari auto-zoom on focus */
  .form-control{ padding:.72rem .9rem; font-size:16px; }

  /* Header gets tight on small screens — shrink secondary links */
  .header-nav{ gap:.25rem; }
  .header-nav a:not(.cart-link){ font-size:.8rem; padding:.35rem .5rem; }

  /* Keep page content clear of the fixed bottom nav (all phones, not just <480) */
  main.section{ padding-bottom:5rem; }
  .sticky-cta{ bottom:62px; }

  /* Admin/shop/delivery sidebar -> horizontal scrolling pill bar
     (so 8+ items don't wrap into a tall block) */
  .sidebar{
    overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap;
    -webkit-overflow-scrolling:touch; gap:.4rem;
    scrollbar-width:none;
  }
  .sidebar::-webkit-scrollbar{ display:none; }
  .sidebar-nav{ flex-wrap:nowrap; }
  .sidebar-nav a{ white-space:nowrap; border-radius:8px; flex-shrink:0; }
  .sidebar-nav a.active{ background:rgba(99,102,241,.45); }

  /* Wrapped tables scroll horizontally without squashing */
  .table-wrap table{ min-width:520px; }
}

@media (max-width:480px){
  .page-hdr h1{ font-size:1.25rem; }
  .stat-icon{ font-size:1.5rem; margin-bottom:.3rem; }
  .modal{ border-radius:16px 16px 0 0; }
  /* Sheet-style modals on small phones */
  .modal-overlay{ align-items:flex-end; padding:0; }
  .modal{ max-height:92vh; }
  .modal-overlay.show .modal{ transform:translateY(0); }
}
