/* ── The Candy Shop — retro candy shop × modern urban ──────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Titan+One&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
    --cream: #fbf3e4;
    --ink: #1c1620;
    --white: #fffdf8;
    --pink: #ff5ca8;
    --pink-deep: #e63e8b;
    --mint: #2fd08c;
    --amber: #ffb03a;
    --purple: #8c5bff;
    --muted: #6f6678;
    --border: #1c1620;
    --radius: 18px;
    --shadow: 6px 6px 0 var(--ink);
    --shadow-sm: 3px 3px 0 var(--ink);
    --font-display: 'Titan One', system-ui, sans-serif;
    --font-body: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

/* Candy stripe utility */
.stripes {
    background: repeating-linear-gradient(-45deg,
        var(--pink) 0 22px, var(--white) 22px 44px);
}
.stripes.thin {
    background: repeating-linear-gradient(-45deg,
        var(--pink) 0 10px, var(--white) 10px 20px);
}

/* ── Nav ── */
.navbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1.4rem;
    background: var(--cream);
    border-bottom: 3px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-swirl {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid var(--ink);
    background: repeating-conic-gradient(var(--pink) 0 25deg, var(--white) 25deg 50deg);
}
.brand-name { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .92rem; }
.nav-links a:hover { color: var(--pink-deep); }
.pill-btn {
    display: inline-block;
    font-family: var(--font-body); font-weight: 700; font-size: .92rem;
    padding: .45rem 1.05rem; border-radius: 999px;
    border: 3px solid var(--ink);
    background: var(--pink); color: var(--ink) !important;
    box-shadow: var(--shadow-sm);
    cursor: pointer; text-decoration: none;
    transition: transform .08s ease, box-shadow .08s ease;
}
.pill-btn:hover { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--ink); }
.pill-btn.ghost { background: var(--white); }
.pill-btn.mint { background: var(--mint); }

/* ── Hero ── */
.awning { height: 26px; border-bottom: 3px solid var(--ink); }
.hero { text-align: center; padding: 3.2rem 1.2rem 2.4rem; }
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 8vw, 5.4rem);
    line-height: 1.02;
    text-shadow: 4px 4px 0 var(--pink);
    -webkit-text-stroke: 1px var(--ink);
}
.hero .tagline { margin-top: 1rem; font-size: 1.15rem; color: var(--muted); font-weight: 500; }
.hero .badges { margin-top: 1.3rem; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.chip {
    font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    border: 2px solid var(--ink); border-radius: 999px; padding: .3rem .8rem;
    background: var(--white);
}
.chip.pink { background: var(--pink); }
.chip.mint { background: var(--mint); }
.chip.amber { background: var(--amber); }

/* ── Menu ── */
.menu-wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.2rem 4rem; }
.cat-title {
    font-family: var(--font-display); font-size: 1.7rem; margin: 2.4rem 0 1.1rem;
    display: flex; align-items: center; gap: .8rem;
}
.cat-title::after { content: ''; flex: 1; height: 10px; border-radius: 999px;
    background: repeating-linear-gradient(-45deg, var(--pink) 0 10px, transparent 10px 20px); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem; }

.product-card {
    background: var(--white);
    border: 3px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .1s ease;
}
.product-card:hover { transform: translateY(-3px); }
.candy-visual {
    height: 150px; display: flex; align-items: center; justify-content: center;
    font-size: 3.4rem; border-bottom: 3px solid var(--ink);
    background-size: cover; background-position: center;
}
.candy-visual.pink   { background: linear-gradient(135deg, #ffd3e8, var(--pink)); }
.candy-visual.amber  { background: linear-gradient(135deg, #ffe6bd, var(--amber)); }
.candy-visual.purple { background: linear-gradient(135deg, #ddd0ff, var(--purple)); }
.candy-visual.mint   { background: linear-gradient(135deg, #c9f5e2, var(--mint)); }
.product-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.product-name { font-weight: 700; font-size: 1.02rem; }
.product-price { font-family: var(--font-display); font-size: 1.05rem; white-space: nowrap; }
.product-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.mini-chip {
    font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    border: 2px solid var(--ink); border-radius: 999px; padding: .14rem .5rem; background: var(--cream);
}
.product-desc { font-size: .84rem; color: var(--muted); flex: 1; }
.add-btn {
    margin-top: .3rem; width: 100%;
    font-family: var(--font-body); font-weight: 700; font-size: .92rem;
    padding: .55rem; border-radius: 12px; border: 3px solid var(--ink);
    background: var(--mint); cursor: pointer; box-shadow: var(--shadow-sm);
}
.add-btn:hover { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--ink); }
.sticker-tag {
    position: absolute; top: .6rem; left: .6rem; z-index: 2;
    font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    background: var(--amber); border: 2px solid var(--ink); border-radius: 999px;
    padding: .22rem .6rem; transform: rotate(-4deg);
}

/* ── Cart drawer ── */
.drawer-backdrop {
    position: fixed; inset: 0; background: rgba(28,22,32,.45); z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
    background: var(--cream); border-left: 3px solid var(--ink); z-index: 100;
    transform: translateX(102%); transition: transform .22s ease;
    display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.2rem; border-bottom: 3px solid var(--ink);
}
.drawer-head h3 { font-family: var(--font-display); font-size: 1.3rem; }
.drawer-close { background: none; border: none; font-size: 1.6rem; cursor: pointer; line-height: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.cart-line {
    display: flex; justify-content: space-between; align-items: center; gap: .6rem;
    background: var(--white); border: 2px solid var(--ink); border-radius: 12px;
    padding: .6rem .8rem; margin-bottom: .6rem;
}
.cart-line .qty-controls { display: flex; align-items: center; gap: .45rem; }
.qty-controls button {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink);
    background: var(--pink); font-weight: 700; cursor: pointer; line-height: 1;
}
.cart-total-row {
    display: flex; justify-content: space-between; font-weight: 700; font-size: 1.05rem;
    padding: .8rem 0; border-top: 3px dashed var(--ink); margin-top: .6rem;
}
.drawer-foot { padding: 1rem 1.2rem; border-top: 3px solid var(--ink); }
.field { margin-bottom: .65rem; }
.field label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .25rem; }
.field input, .field textarea, .field select {
    width: 100%; font-family: var(--font-body); font-size: .95rem;
    padding: .55rem .7rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--white);
}
.field-row { display: flex; gap: .6rem; }
.field-row .field { flex: 1; }
.wide-btn {
    width: 100%; font-family: var(--font-display); font-size: 1.05rem;
    padding: .8rem; border-radius: 14px; border: 3px solid var(--ink);
    background: var(--pink); cursor: pointer; box-shadow: var(--shadow-sm);
}
.wide-btn:disabled { opacity: .55; cursor: not-allowed; }
.form-error { color: #c81e5b; font-size: .85rem; font-weight: 600; margin: .4rem 0; min-height: 1.1em; }

/* ── Order view ── */
.order-wrap { max-width: 680px; margin: 0 auto; padding: 2.2rem 1.2rem 4rem; }
.order-card {
    background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.4rem;
}
.order-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; }
.order-head h2 { font-family: var(--font-display); font-size: 1.5rem; }
.status-badge {
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    border: 2px solid var(--ink); border-radius: 999px; padding: .3rem .8rem;
}
.status-badge.pending   { background: var(--amber); }
.status-badge.confirmed { background: var(--mint); }
.status-badge.en_route  { background: var(--purple); color: #fff; }
.status-badge.delivered { background: var(--mint); }
.status-badge.cancelled { background: #f0637f; color: #fff; }
.status-msg { margin-top: .7rem; font-weight: 600; }
.timeline { display: flex; margin-top: 1.1rem; gap: .3rem; }
.timeline .step { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); }
.timeline .step.done { background: var(--pink); }
.order-items { margin-top: 1rem; font-size: .92rem; }
.order-items .row { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dashed var(--muted); }

.chat-box {
    background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--shadow); display: flex; flex-direction: column; height: 420px;
}
.chat-head { padding: .8rem 1.2rem; border-bottom: 3px solid var(--ink); font-family: var(--font-display); }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.bubble {
    max-width: 78%; padding: .55rem .85rem; border: 2px solid var(--ink);
    border-radius: 14px; font-size: .9rem;
}
.bubble.driver { align-self: flex-start; background: var(--cream); border-bottom-left-radius: 4px; }
.bubble.customer { align-self: flex-end; background: var(--pink); border-bottom-right-radius: 4px; }
.chat-input { display: flex; gap: .6rem; padding: .8rem; border-top: 3px solid var(--ink); }
.chat-input input { flex: 1; padding: .55rem .8rem; border: 2px solid var(--ink); border-radius: 999px; font-family: var(--font-body); }
.chat-input button {
    padding: .55rem 1.1rem; border: 2px solid var(--ink); border-radius: 999px;
    background: var(--mint); font-weight: 700; cursor: pointer;
}

/* ── Footer ── */
.site-footer {
    background: var(--ink); color: var(--cream);
    padding: 3rem 1.4rem 2rem; margin-top: 2rem;
    border-top: 3px solid var(--ink);
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-headline { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.1; }
.footer-headline .accent { color: var(--pink); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; margin-top: 2rem; font-size: .88rem; }
.footer-grid a { color: var(--cream); }
.footer-note { margin-top: 2rem; font-size: .74rem; color: #9c93a5; }

/* ── Auth pages ── */
.auth-wrap { max-width: 440px; margin: 3.5rem auto; padding: 0 1.2rem; }
.auth-card {
    background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.6rem;
}
.auth-card h1 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 1rem; text-align: center; }
.auth-tabs { display: flex; gap: .5rem; margin-bottom: 1.2rem; }
.auth-tabs button {
    flex: 1; padding: .55rem; font-weight: 700; font-family: var(--font-body);
    border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); cursor: pointer;
}
.auth-tabs button.active { background: var(--pink); }
.auth-divider { text-align: center; color: var(--muted); font-size: .8rem; margin: 1rem 0; }

/* ── Dashboard (admin & driver) ───────────────────────────────────────────── */
body.dashboard { background: #17121c; color: #efe9f4; }
body.dashboard .navbar { background: #17121c; border-color: #efe9f4; }
body.dashboard .brand, body.dashboard .nav-links a { color: #efe9f4; }
body.dashboard .brand-swirl { border-color: #efe9f4; }
.dash-wrap { max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.dash-tabs { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.dash-tabs button {
    font-family: var(--font-body); font-weight: 700; font-size: .9rem;
    padding: .5rem 1.1rem; border-radius: 999px; border: 2px solid #efe9f4;
    background: transparent; color: #efe9f4; cursor: pointer;
}
.dash-tabs button.active { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.panel {
    background: #221a2b; border: 2px solid #3a2f47; border-radius: 14px;
    padding: 1.2rem; margin-bottom: 1.2rem;
}
.panel h2 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 1rem; color: var(--pink); }
.dash-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dash-table th { text-align: left; padding: .5rem .6rem; color: #9c8fae; font-weight: 600; border-bottom: 2px solid #3a2f47; }
.dash-table td { padding: .55rem .6rem; border-bottom: 1px solid #2c2336; vertical-align: middle; }
.dash-table tr:hover td { background: #281f33; }
.dash-table select, .dash-table input {
    background: #17121c; color: #efe9f4; border: 1px solid #4a3d5c;
    border-radius: 8px; padding: .3rem .5rem; font-family: var(--font-body); font-size: .85rem;
}
.dash-btn {
    font-family: var(--font-body); font-weight: 700; font-size: .82rem;
    padding: .4rem .9rem; border-radius: 999px; border: none;
    background: var(--pink); color: var(--ink); cursor: pointer;
}
.dash-btn.mint { background: var(--mint); }
.dash-btn.subtle { background: #3a2f47; color: #efe9f4; }
.dash-btn.danger { background: #f0637f; }
.dash-btn:disabled { opacity: .5; cursor: not-allowed; }
.dash-field { margin-bottom: .7rem; }
.dash-field label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9c8fae; margin-bottom: .25rem; }
.dash-field input, .dash-field textarea, .dash-field select {
    width: 100%; background: #17121c; color: #efe9f4; border: 1px solid #4a3d5c;
    border-radius: 8px; padding: .5rem .7rem; font-family: var(--font-body); font-size: .9rem;
}
.dash-field-row { display: flex; gap: .7rem; }
.dash-field-row .dash-field { flex: 1; }
.dash-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; margin-bottom: .6rem; }
.dash-check input { width: auto; }
.orders-layout { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 900px) { .orders-layout { grid-template-columns: 380px 1fr; } }
.order-row { padding: .7rem .8rem; border: 1px solid #3a2f47; border-radius: 10px; margin-bottom: .6rem; cursor: pointer; }
.order-row:hover, .order-row.selected { border-color: var(--pink); background: #281f33; }
.order-row .top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.order-row .sub { font-size: .78rem; color: #9c8fae; margin-top: .2rem; }
.dash-chat { display: flex; flex-direction: column; height: 300px; border: 1px solid #3a2f47; border-radius: 10px; }
.dash-chat .chat-body { padding: .8rem; }
.dash-chat .bubble.driver { background: #3a2f47; color: #efe9f4; border-color: #4a3d5c; }
.dash-chat .bubble.customer { background: var(--pink); color: var(--ink); border-color: var(--pink-deep); }
.dash-chat .chat-input { border-top: 1px solid #3a2f47; }
.dash-chat .chat-input input { background: #17121c; color: #efe9f4; border: 1px solid #4a3d5c; }
.status-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.muted-note { color: #9c8fae; font-size: .82rem; }
.toast {
    position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: var(--cream); border: 2px solid var(--pink);
    border-radius: 999px; padding: .6rem 1.3rem; font-weight: 600; z-index: 200;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }
.hidden { display: none !important; }

/* tier grid in product form */
.tier-grid { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .4rem; }
.tier-grid th, .tier-grid td { padding: .35rem .5rem; border-bottom: 1px solid #2c2336; text-align: left; }
.tier-grid input[type="number"] { width: 90px; }

@media (max-width: 640px) {
    .field-row, .dash-field-row { flex-direction: column; gap: 0; }
}
