/* ============================================================
   Papad Bazaar — storefront + admin styles
   Warm, spice-inspired palette · mobile-first
   ============================================================ */
:root {
    --bg:        #fffaf3;
    --surface:   #ffffff;
    --ink:       #2b1d12;
    --muted:     #8a7563;
    --line:      #efe3d4;
    --primary:   #d2691e;   /* spicy orange */
    --primary-d: #b4541a;
    --accent:    #c0392b;   /* chilli red */
    --gold:      #e9a319;
    --green:     #2e7d52;
    --radius:    14px;
    --shadow:    0 8px 28px rgba(120, 72, 20, .08);
    --shadow-sm: 0 2px 8px rgba(120, 72, 20, .06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4, .brand-text, .price, .price-lg, .stat-num { font-family: 'Baloo 2', 'Inter', sans-serif; }
a { color: var(--primary-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, 92%); margin-inline: auto; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border: 0; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 600; padding: .6rem 1.3rem;
    transition: transform .08s ease, background .15s ease, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-primary:disabled { background: #d8c5b3; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-d); }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.7rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.topbar {
    background: linear-gradient(90deg, #2b1d12, #5a3a1e);
    color: #f3e3d2; font-size: .8rem;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: .45rem 0; gap: 1rem; }
.topbar a { color: var(--gold); font-weight: 600; }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .85rem 0; }
.nav-toggle {
    display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer;
    color: var(--ink); line-height: 1; padding: 0;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
    height: 52px; width: auto; border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow-sm); flex-shrink: 0; display: block;
    background: #fff0db;
}
.brand-mark img { height: 100%; width: auto; object-fit: contain; display: block; }
.brand-text { font-weight: 700; font-size: 1.4rem; line-height: 1.05; display: flex; flex-direction: column; }
.brand-text small { font-family: 'Inter', sans-serif; font-size: .62rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }

.search { display: flex; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
    flex: 1; border: 1.5px solid var(--line); border-right: 0;
    border-radius: 999px 0 0 999px; padding: .6rem 1.1rem; font: inherit; background: var(--bg); min-width: 0;
}
.search input:focus { outline: none; border-color: var(--primary); }
.search button {
    border: 0; background: var(--primary); color: #fff;
    border-radius: 0 999px 999px 0; padding: 0 1.1rem; cursor: pointer; font-size: 1rem;
}
.search button:hover { background: var(--primary-d); }

.header-actions { display: flex; align-items: center; gap: .6rem; }

/* Account icon + dropdown */
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-trigger {
    display: flex; align-items: center; gap: .35rem;
    color: var(--ink); font-weight: 600; padding: .5rem .8rem;
    border-radius: 999px; border: 1.5px solid var(--line); white-space: nowrap;
}
.account-trigger:hover { border-color: var(--primary); }
.account-ico { font-size: 1.2rem; }
.account-caret { font-size: .7rem; color: var(--muted); }
.account-dropdown {
    position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow); min-width: 220px; padding: .5rem; overflow: hidden;
}
.account-dropdown a { display: block; padding: .6rem .8rem; border-radius: 9px; color: var(--ink); font-weight: 500; font-size: .92rem; }
.account-dropdown a:hover { background: var(--bg); text-decoration: none; color: var(--primary-d); }
.account-greet { padding: .6rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; line-height: 1.3; }
.account-greet small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }

.cart-link {
    position: relative; display: flex; align-items: center; gap: .4rem;
    color: var(--ink); font-weight: 600; padding: .5rem .9rem;
    border-radius: 999px; border: 1.5px solid var(--line);
}
.cart-link:hover { text-decoration: none; border-color: var(--primary); }
.cart-ico { font-size: 1.2rem; }
.cart-count {
    position: absolute; top: -7px; right: -6px;
    background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
    font-family: 'Inter', sans-serif;
}

/* Category nav */
.cat-nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 66px; z-index: 40; }
.cat-nav-inner { display: flex; gap: .4rem; overflow-x: auto; padding: .55rem 0; scrollbar-width: none; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-link {
    color: var(--ink); font-weight: 600; font-size: .9rem; white-space: nowrap;
    padding: .42rem .95rem; border-radius: 999px; transition: background .15s, color .15s;
}
.cat-link:hover { background: var(--bg); text-decoration: none; }
.cat-link.active { background: var(--primary); color: #fff; }

/* ---- Alerts ---- */
.alert { padding: .8rem 1.1rem; border-radius: var(--radius); margin: 1rem 0; font-size: .92rem; }
.alert-success { background: #e7f6ec; color: #1e5a39; border: 1px solid #bfe6cd; }
.alert-error   { background: #fdecea; color: #a02a1c; border: 1px solid #f4c7c0; }
.alert ul { margin: 0; padding-left: 1.2rem; }

/* ============================================================
   HOME / STOREFRONT
   ============================================================ */
.home-banner {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    overflow: hidden;
    height: 515px;
}
.home-banner > a { display: block; }
.home-banner img { width: 100%; height: auto; display: block; }
.banner-cta { position: absolute; left: 5%; bottom: 12%; }

.hero {
    display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 2rem;
    background: linear-gradient(135deg, #fff3e0, #ffe8d0);
    border-radius: 24px; padding: 3rem; margin: 2rem 0; border: 1px solid var(--line);
}
.hero h1 { font-size: 2.8rem; line-height: 1.1; margin: 0 0 1rem; }
.hero h1 span { color: var(--primary-d); }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 38ch; }
.hero-actions { display: flex; gap: .8rem; margin-top: 1.6rem; flex-wrap: wrap; }
.hero-art { font-size: 11rem; text-align: center; filter: drop-shadow(0 12px 20px rgba(180,84,26,.25)); }

.section { margin: 3rem 0; }
.section-title { font-size: 1.8rem; margin: 0 0 1.2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.2rem; }
.link-more { font-weight: 600; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.category-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem 1rem; text-align: center; color: var(--ink); font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: .6rem;
    transition: transform .12s ease, box-shadow .15s;
}
.category-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.category-emoji { font-size: 2.4rem; }

/* Product grid & cards (2 per row on mobile) */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.product-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .12s ease, box-shadow .15s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card-img { position: relative; display: block; aspect-ratio: 1; background: #fdf3e7; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-card-img img { transform: scale(1.05); }
.badge {
    position: absolute; top: .6rem; left: .6rem;
    background: var(--gold); color: #fff; font-size: .68rem; font-weight: 700;
    padding: .2rem .6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.badge-out { background: var(--muted); left: auto; right: .6rem; }
.product-card-body { padding: 1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-d); font-weight: 700; }
.product-card-body h3 { margin: 0; font-size: 1.02rem; line-height: 1.25; }
.product-card-body h3 a { color: var(--ink); }
.card-variants { margin: 0; font-size: .8rem; }
.product-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .6rem; }
.price { font-weight: 700; font-size: 1.1rem; color: var(--primary-d); }
.muted { color: var(--muted); font-size: .88rem; }

/* ---- Category carousels ---- */
.cat-carousel-section { margin: 2.5rem 0; }
.carousel-outer { position: relative; padding: 0 22px; }
.carousel-track {
    display: flex;
    gap: 1.4rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: .3rem;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .product-card {
    flex: 0 0 calc(25% - 1.05rem);
    min-width: 0;
    scroll-snap-align: start;
}
.carousel-btn {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition: background .15s, border-color .15s, color .15s;
    padding: 0;
}
.carousel-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

/* Features */
.features {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
    padding: 2rem; margin: 3rem 0;
}
.feature { text-align: center; }
.feature span { font-size: 2.2rem; }
.feature h3 { margin: .5rem 0 .3rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .88rem; }

/* Page head / breadcrumb */
.page-head { margin: 2rem 0 1.5rem; }
.page-head h1 { margin: 0; font-size: 2rem; }
.breadcrumb { margin: 1.2rem 0; color: var(--muted); font-size: .85rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { color: var(--ink); }

/* Shop layout */
.shop-layout { display: grid; grid-template-columns: 210px 1fr; gap: 2rem; align-items: start; margin-bottom: 3rem; }
.shop-filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; position: sticky; top: 120px; }
.shop-filters h4 { margin: 0 0 .8rem; }
.filter-link { display: block; padding: .4rem .6rem; border-radius: 8px; color: var(--ink); font-size: .92rem; }
.filter-link:hover { background: var(--bg); text-decoration: none; }
.filter-link.active { background: var(--primary); color: #fff; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; margin-bottom: 3rem; }
.product-gallery { position: sticky; top: 120px; }
.product-detail-img { background: #fdf3e7; border-radius: 20px; border: 1px solid var(--line); overflow: hidden; aspect-ratio: 1; }
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { color: var(--primary-d); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; }
.product-detail-info h1 { margin: .3rem 0 .5rem; font-size: 2.2rem; }
.price-lg { font-size: 1.9rem; font-weight: 700; color: var(--primary-d); margin: .3rem 0; }
.desc { color: #54453a; margin: 1rem 0 1.5rem; }

.variant-picker { margin: 1.2rem 0; }
.variant-label-title { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .55rem; }
.variant-options { display: flex; flex-wrap: wrap; gap: .6rem; }
.variant-chip {
    position: relative; cursor: pointer; border: 1.5px solid var(--line); border-radius: 12px;
    padding: .55rem .9rem; display: flex; flex-direction: column; min-width: 88px;
    transition: border-color .15s, background .15s; background: var(--surface);
}
.variant-chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip-label { font-weight: 700; font-size: .95rem; }
.chip-price { font-size: .82rem; color: var(--muted); }
.variant-chip:has(input:checked) { border-color: var(--primary); background: #fff5ec; box-shadow: 0 0 0 3px rgba(210,105,30,.12); }
.variant-chip.disabled { opacity: .5; cursor: not-allowed; }
.chip-out { font-size: .68rem; color: var(--accent); font-weight: 700; }

.stock { font-weight: 600; margin: .4rem 0; }
.stock.in { color: var(--green); }
.stock.out { color: var(--accent); }
.add-row { display: flex; align-items: flex-end; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.qty-field { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.qty-field input { width: 84px; padding: .55rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; }
.trust-list { list-style: none; padding: 0; margin: 1.8rem 0 0; border-top: 1px solid var(--line); }
.trust-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; color: #54453a; }

/* Gallery thumbs */
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.gallery-thumb-btn { padding: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; width: 72px; height: 72px; }
.gallery-thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb-btn.active { border-color: var(--primary); }

/* ---- Cart ---- */
.cart-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cart-table th, .cart-table td { padding: .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-table thead th { background: #fdf3e7; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cart-table.compact th, .cart-table.compact td { padding: .6rem .8rem; }
.cart-thumb img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.qty { width: 64px; padding: .4rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.cart-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.cart-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.cart-summary { display: flex; align-items: center; gap: 1.2rem; }
.cart-total { font-size: 1.1rem; }
.cart-total strong { font-size: 1.5rem; color: var(--primary-d); font-family: 'Baloo 2', sans-serif; }
.link-danger { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-weight: 600; }

/* ---- Checkout ---- */
.checkout-layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 2rem; align-items: start; margin-bottom: 3rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.checkout-form h3, .order-summary h3 { margin-top: 0; }
.checkout-form label, .stack-form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.checkout-form input, .checkout-form textarea,
.stack-form input, .stack-form select, .stack-form textarea,
.status-form select {
    width: 100%; margin-top: .35rem; padding: .65rem .8rem;
    border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: var(--bg);
}
.checkout-form input:focus, .checkout-form textarea:focus,
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus {
    outline: none; border-color: var(--primary);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pay-note { background: #fdf3e7; border: 1px dashed var(--gold); border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0; }
.pay-note-warn { background: #fff2d6; border-color: #e0a000; }
.summary-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; gap: .5rem; }
.summary-row.total { font-weight: 700; font-size: 1.15rem; border-bottom: 0; padding-top: 1rem; }
.checkbox { display: flex !important; align-items: center; gap: .5rem; }
.checkbox input { width: auto !important; margin: 0 !important; }
.checkout-login-hint { background: #fdf3e7; border: 1px solid var(--line); color: var(--ink); }

/* Payment selector */
.pay-title { margin: 1.5rem 0 .6rem; }
.pay-options { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.2rem; }
.pay-option { display: flex; align-items: flex-start; gap: .7rem; border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-option:has(input:checked) { border-color: var(--primary); background: #fff5ec; box-shadow: 0 0 0 3px rgba(210,105,30,.1); }
.pay-option input { margin-top: .25rem; }
.pay-option-body { display: flex; flex-direction: column; }
.pay-option-body small { color: var(--muted); }

/* UPI / pay page */
.pay-page { max-width: 760px; margin: 2rem auto; }
.pay-page h1 { margin-top: 0; }
.pay-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; margin-top: 1.2rem; }
.pay-qr { text-align: center; }
.pay-qr img { border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.qr-fallback { display: none; color: var(--accent); font-size: .85rem; padding: 1rem; }
.pay-line { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.upi-id-copy { display: inline-flex; align-items: center; gap: .5rem; }
.upi-id-copy .btn { padding: .25rem .6rem; }
.pay-details .btn { margin-top: 1rem; }
.pay-hint { font-size: .82rem; margin: .6rem 0 1rem; }
.pay-confirm { margin-top: .8rem; }

/* ---- Success ---- */
.success-box { max-width: 640px; margin: 3rem auto; text-align: center; }
.success-mark { width: 70px; height: 70px; margin: 0 auto 1rem; background: var(--green); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.success-box .cart-table { text-align: left; margin: 1.5rem 0; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 3rem; text-align: center; color: var(--muted); font-size: 1.05rem; }

/* Customer auth */
.auth-wrap { display: flex; justify-content: center; padding: 2.5rem 0 4rem; }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { margin: 0 0 .3rem; font-size: 1.7rem; }
.auth-card form { margin-top: 1.2rem; }
.auth-card label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 1rem; }
.auth-card input { width: 100%; margin-top: .35rem; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: var(--bg); }
.auth-card input:focus { outline: none; border-color: var(--primary); }
.auth-alt { text-align: center; margin-top: 1.2rem; color: var(--muted); }

/* Account / order history */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; margin-bottom: 3rem; }
.account-side .btn { margin-top: .6rem; }
.order-card { margin-bottom: 1.2rem; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }

/* ---- Footer ---- */
.site-footer { background: #2b1d12; color: #e8d9c9; margin-top: 4rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.footer-inner h4 { margin: 0 0 .8rem; color: #fff; }
.footer-inner a { display: block; color: #c9b6a3; font-size: .9rem; padding: .15rem 0; }
.footer-inner p { color: #c9b6a3; font-size: .9rem; margin: 0; }
.footer-bottom { border-top: 1px solid #463422; text-align: center; padding: 1.2rem; font-size: .85rem; color: #a8917c; }

/* ============================================================
   ADMIN
   ============================================================ */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #fff3e0, #ffe2c4); padding: 1rem; }
.login-card { background: var(--surface); padding: 2.5rem; border-radius: 20px; box-shadow: var(--shadow); width: min(380px, 100%); text-align: center; }
.login-logo { font-size: 3rem; }
.login-card h1 { margin: .3rem 0 1.5rem; font-size: 1.5rem; }
.login-card label { display: block; text-align: left; font-weight: 600; font-size: .88rem; margin-bottom: 1rem; }
.login-card input { width: 100%; margin-top: .35rem; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; }
.login-hint { color: var(--muted); font-size: .82rem; margin-top: 1rem; }
.login-hint code { background: var(--bg); padding: .1rem .4rem; border-radius: 5px; }

body.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: #f7f2ea; }
.admin-sidebar { background: #2b1d12; color: #e8d9c9; padding: 1.5rem 1rem; position: sticky; top: 0; height: 100vh; }
.admin-brand { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.15rem; display: flex; flex-direction: column; line-height: 1.2; margin-bottom: 2rem; }
.admin-brand span { font-size: .72rem; font-weight: 500; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: .3rem; }
.admin-sidebar nav a { color: #d8c6b4; padding: .65rem .8rem; border-radius: 9px; font-size: .92rem; }
.admin-sidebar nav a:hover { background: #3c2b1c; color: #fff; text-decoration: none; }
.admin-sidebar nav a.logout { margin-top: 1rem; color: #e7a99a; }
.admin-main { padding: 2rem 2.5rem; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-topbar h1 { margin: 0; font-size: 1.6rem; }
.admin-user { color: var(--muted); font-size: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 1.9rem; font-weight: 700; color: var(--primary-d); }
.stat-label { color: var(--muted); font-size: .85rem; }

.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.admin-split { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; align-items: start; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card h3 { margin-top: 0; }

.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.data-table thead th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.row-actions { display: flex; gap: .8rem; align-items: center; }
.row-actions form { display: inline; }
.text-danger { color: var(--accent); font-weight: 700; }
.pill { background: var(--gold); color: #fff; font-size: .7rem; padding: .05rem .4rem; border-radius: 999px; }

.img-preview { display: block; margin: .4rem 0; }
.img-preview img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.variant-editor { margin-bottom: 1rem; }
.variant-row { display: grid; grid-template-columns: 1.3fr 1fr .8fr 28px; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.variant-row input { margin: 0 !important; }
.variant-row-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: .3rem; }
.variant-row-head span { padding-left: .2rem; }
.gallery-manage { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1rem; }
.gallery-thumb { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .72rem; }
.gallery-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.gallery-del { color: var(--accent); display: flex; align-items: center; gap: .2rem; }

.status { font-size: .76rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; text-transform: capitalize; }
.status-pending   { background: #fff2d6; color: #946400; }
.status-confirmed { background: #dceeff; color: #18608f; }
.status-shipped   { background: #e6e0ff; color: #4a3aa0; }
.status-delivered { background: #e0f5e6; color: #1e7a44; }
.status-cancelled { background: #fde2de; color: #a3271a; }
.pay-tag { font-size: .7rem; font-weight: 700; background: var(--ink); color: #fff; padding: .12rem .5rem; border-radius: 999px; }
.pay-state { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; text-transform: capitalize; }
.pay-pending, .pay-awaiting { background: #fff2d6; color: #946400; }
.pay-paid { background: #e0f5e6; color: #1e7a44; }
.pay-summary { margin: .6rem 0; }
.stack-form .btn { margin-top: .5rem; }
.status-form { margin-top: 1rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Large tablet / small desktop (≤1024px) ─────────────────────────────── */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .checkout-layout { grid-template-columns: 1fr; }
    .admin-split { grid-template-columns: 1fr; }
}

/* ── Tablet (≤860px) ─────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    /* Header */
    .nav-toggle { display: block; }
    .brand-text small { display: none; }
    .brand-text { font-size: 1.2rem; }
    .brand { margin-right: auto; }
    .search { order: 3; flex-basis: 100%; max-width: none; margin: .7rem 0 0; }
    .header-inner { flex-wrap: wrap; row-gap: 0; }
    .header-actions { margin-left: auto; }
    .cart-word { display: none; }
    .account-caret { display: none; }
    .topbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cat-nav { position: static; }
    .cat-nav-inner { display: none; flex-direction: column; padding: .5rem 0; }
    .cat-nav.open .cat-nav-inner { display: flex; }
    .cat-link { width: 100%; }
    .banner-cta { left: 50%; transform: translateX(-50%); bottom: 8%; padding: .55rem 1.2rem; font-size: .92rem; }

    /* Banner — remove fixed height so image shows fully */
    .home-banner { height: auto; }
    .home-banner img { height: auto; }

    /* Hero */
    .hero { grid-template-columns: 1fr; text-align: center; padding: 2.2rem 1.5rem; }
    .hero h1 { font-size: 2.1rem; }
    .hero p { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .hero-art { font-size: 7rem; }

    /* Category — 3 columns on tablet */
    .category-grid { grid-template-columns: repeat(3, 1fr); gap: .8rem; }
    .category-card { padding: 1.1rem .7rem; }
    .category-emoji { font-size: 2rem; }

    /* Products */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    /* Carousel */
    .carousel-outer { padding: 0; }
    .carousel-btn { display: none; }
    .carousel-track { gap: 1rem; }
    .carousel-track .product-card { flex: 0 0 calc(50% - .5rem); }

    /* Features & footer */
    .features { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }

    /* Shop & account */
    .account-layout { grid-template-columns: 1fr; }
    .shop-layout { grid-template-columns: 1fr; }
    .shop-filters { position: static; display: flex; flex-wrap: wrap; gap: .4rem; }
    .shop-filters h4 { width: 100%; }

    /* Product detail */
    .product-detail { grid-template-columns: 1fr; gap: 1.5rem; }
    .product-gallery { position: static; max-width: 100%; }

    /* Checkout & pay */
    .pay-grid { grid-template-columns: 1fr; }
    .pay-qr { margin-bottom: 1rem; }

    /* Admin — sidebar becomes top bar */
    body.admin { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static; height: auto;
        padding: .8rem 1rem;
    }
    .admin-brand { margin-bottom: .6rem; flex-direction: row; align-items: center; gap: .8rem; }
    .admin-brand span { display: none; }
    .admin-sidebar nav {
        flex-direction: row; flex-wrap: nowrap;
        overflow-x: auto; gap: .25rem;
        scrollbar-width: none; padding-bottom: .2rem;
    }
    .admin-sidebar nav::-webkit-scrollbar { display: none; }
    .admin-sidebar nav a {
        white-space: nowrap; padding: .5rem .75rem; font-size: .85rem; border-radius: 8px;
    }
    .admin-sidebar nav a.logout { margin-top: 0; }
    .admin-main { padding: 1.5rem 1rem; }
    .admin-cols, .admin-split { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .admin-topbar { flex-wrap: wrap; gap: .5rem; }
    .admin-topbar h1 { font-size: 1.4rem; }
}

/* ── Mobile (≤560px) ─────────────────────────────────────────────────────── */
@media (max-width: 560px) {
    /* Header */
    .topbar span { font-size: .7rem; }
    .account-word { display: none; }
    .banner-cta { display: none; }
    .header-inner { gap: .6rem; }
    .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
    .brand-text { font-size: 1.12rem; }
    .account-trigger { padding: .5rem .6rem; }
    .cart-link { padding: .5rem .7rem; }

    /* Category — 2 columns on mobile */
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .category-card { padding: .8rem .5rem; gap: .4rem; }
    .category-emoji { font-size: 1.7rem; }
    .category-card span:last-child { font-size: .82rem; }

    /* Products & carousel */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
    .carousel-track { gap: .7rem; }
    .carousel-track .product-card { flex: 0 0 calc(50% - .35rem); }
    .product-card-body { padding: .6rem; }
    .product-card-body h3 { font-size: .88rem; }
    .price { font-size: .95rem; }
    .product-card-foot { flex-direction: column; align-items: stretch; gap: .35rem; padding-top: .4rem; }
    .product-card-foot .btn { width: 100%; }

    /* Features & footer */
    .features { grid-template-columns: repeat(2, 1fr); padding: 1.2rem; gap: .8rem; }
    .feature span { font-size: 1.8rem; }
    .feature h3 { font-size: .92rem; margin: .3rem 0 .2rem; }
    .feature p { font-size: .8rem; }
    .footer-inner { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem 0; }

    /* Typography */
    .section-title { font-size: 1.5rem; }
    .page-head h1 { font-size: 1.5rem; }
    .product-detail-info h1 { font-size: 1.6rem; }
    .price-lg { font-size: 1.4rem; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; }
    .variant-row { grid-template-columns: 1fr 1fr; }
    .variant-row input[name="variant_label[]"] { grid-column: 1 / -1; }

    /* Admin mobile */
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
    .stat-card { padding: 1rem; }
    .stat-num { font-size: 1.5rem; }
    .admin-topbar h1 { font-size: 1.2rem; }
    .admin-sidebar nav a { font-size: .8rem; padding: .45rem .6rem; }
}

/* ── Small mobile (≤400px) ───────────────────────────────────────────────── */
@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .carousel-track .product-card { flex: 0 0 calc(50% - .35rem); }
    .product-card-body h3 { font-size: .82rem; }
    .checkout-layout { gap: 1rem; }
}

/* ── Cart: card layout on small screens ──────────────────────────────────── */
@media (max-width: 640px) {
    .cart-items { display: block; background: none; border: 0; box-shadow: none; }
    .cart-items thead { display: none; }
    .cart-items tbody { display: block; }
    .cart-items tr {
        position: relative; display: grid;
        grid-template-columns: 72px 1fr;
        grid-template-areas: "thumb info" "thumb price" "thumb qty" "thumb sub";
        gap: .4rem .8rem; align-items: center;
        background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); box-shadow: var(--shadow-sm);
        padding: .8rem; margin-bottom: .8rem;
    }
    .cart-items td { border: 0; padding: 0; }
    .cart-items .cart-thumb { grid-area: thumb; align-self: start; }
    .cart-items .cart-thumb img { width: 72px; height: 72px; }
    .cart-items .cart-info { grid-area: info; padding-right: 1.8rem; }
    .cart-items .cart-info a { font-weight: 600; }
    .cart-items .cart-price { grid-area: price; }
    .cart-items .cart-qty  { grid-area: qty; }
    .cart-items .cart-sub  { grid-area: sub; }
    .cart-items .cart-price, .cart-items .cart-qty, .cart-items .cart-sub {
        display: flex; align-items: center; gap: .5rem;
    }
    .cart-items td[data-label]::before {
        content: attr(data-label); color: var(--muted); font-size: .8rem;
        font-weight: 600; min-width: 60px;
    }
    .cart-items .cart-sub { font-weight: 700; color: var(--primary-d); }
    .cart-items .cart-rm { position: absolute; top: .6rem; right: .7rem; }
    .cart-items .cart-rm .link-danger { font-size: 1.1rem; }
    .cart-foot { flex-direction: column; align-items: stretch; gap: .9rem; }
    .cart-actions { justify-content: space-between; }
    .cart-actions .btn { flex: 1; }
    .cart-summary { flex-direction: column; align-items: stretch; gap: .8rem; }
    .cart-summary .btn { width: 100%; }
    .cart-total { text-align: center; }
}
