/* ============================================================
   DEPO2 — Unified Design System
   B2B Wholesale Platform
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
    /* Brand */
    --brand-50:  #eff6ff;
    --brand-100: #dbeafe;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-900: #1e3a8a;

    /* Neutrals */
    --neutral-0:   #ffffff;
    --neutral-50:  #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Semantic */
    --color-bg:       #f0f4f8;
    --color-surface:  #ffffff;
    --color-border:   #e2e8f0;
    --color-text:     #0f172a;
    --color-muted:    #64748b;
    --color-accent:   #2563eb;
    --color-accent-h: #1d4ed8;
    --color-success:  #16a34a;
    --color-danger:   #dc2626;
    --color-warning:  #d97706;

    /* Legacy aliases (keeps old classes working) */
    --bg:           var(--color-bg);
    --panel:        var(--color-surface);
    --panel-glass:  rgba(255,255,255,0.95);
    --border:       var(--color-border);
    --text:         var(--color-text);
    --muted:        var(--color-muted);
    --accent:       var(--color-accent);
    --accent-strong:var(--color-accent-h);
    --accent-soft:  rgba(37,99,235,0.12);
    --primary:      var(--neutral-900);
    --success:      var(--color-success);
    --error:        var(--color-danger);
    --danger:       var(--color-danger);
    --ring:         rgba(37,99,235,0.3);
    --radius:       16px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.05);
    --shadow-md:  0 4px 16px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
    --shadow-lg:  0 12px 40px rgba(15,23,42,0.14), 0 4px 12px rgba(15,23,42,0.08);
    --shadow-xl:  0 24px 60px rgba(15,23,42,0.18), 0 8px 20px rgba(15,23,42,0.10);
    --shadow:     var(--shadow-xl);
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── AUTH LAYOUT (login, register, forgot-password, email-confirmation) ── */
body.auth-page {
    background:
        radial-gradient(ellipse 80% 60% at 20% -10%, rgba(37,99,235,0.13) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 110%, rgba(124,58,237,0.10) 0%, transparent 55%),
        linear-gradient(160deg, #f0f4f8 0%, #e8eef6 50%, #f0f2f8 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px 40px;
}

body.auth-page .page {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(240px, 380px) 1fr;
    gap: 28px;
    position: relative;
    z-index: 1;
}

/* ── AUTH HERO (left panel) ───────────────────────────────── */
body.auth-page .hero {
    background: linear-gradient(155deg, var(--neutral-900) 0%, #1a2744 50%, #0c1628 100%);
    color: #f8fafc;
    border-radius: 24px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    min-height: 280px;
    animation: ds-slideUp 0.55s cubic-bezier(.22,.68,0,1.2) both;
}

body.auth-page .hero::before {
    content: "";
    position: absolute;
    top: -60px; right: -60px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(59,130,246,0.30) 0%, transparent 70%);
    pointer-events: none;
}

body.auth-page .hero::after {
    content: "";
    position: absolute;
    bottom: -40px; left: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(124,58,237,0.20) 0%, transparent 70%);
    pointer-events: none;
}

.hero-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.hero-logo {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-logo::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    flex-shrink: 0;
}

.hero-tagline {
    font-size: 13px;
    color: rgba(248,250,252,0.6);
    font-weight: 400;
}

.hero-text {
    font-size: 22px;
    font-weight: 700;
    color: #e2e8f0;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(248,250,252,0.75);
}

.hero-feature::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-400);
    flex-shrink: 0;
}

/* ── AUTH CARD (right panel) ──────────────────────────────── */
body.auth-page .card {
    background: rgba(255,255,255,0.97);
    border: 1px solid rgba(226,232,240,0.8);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    animation: ds-slideUp 0.65s cubic-bezier(.22,.68,0,1.2) 0.1s both;
}

/* ── APP NAVBAR ───────────────────────────────────────────── */
.ds-nav {
    background: rgba(255,255,255,0.97);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(15,23,42,0.06);
}

.ds-nav-brand {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--neutral-900);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ds-nav-brand::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    flex-shrink: 0;
}

.ds-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ds-nav-link {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--neutral-600);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.ds-nav-link:hover,
.ds-nav-link.active {
    background: var(--neutral-100);
    color: var(--neutral-900);
}

.ds-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── APP LAYOUT ───────────────────────────────────────────── */
body.app-page {
    background: var(--color-bg);
    min-height: 100vh;
}

body.app-page .page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── DASHBOARD HERO (app header bar) ─────────────────────── */
body.app-page .hero {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

body.app-page .hero-logo {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--neutral-900);
}

/* ── CARD ─────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
.heading {
    margin: 0 0 6px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1.heading { font-size: 26px; }
h2.heading { font-size: 20px; }
h3.heading { font-size: 17px; }

.subtitle {
    margin: 0 0 20px;
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.5;
}

.meta {
    font-size: 13px;
    color: var(--color-muted);
}

.top-link {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--color-muted);
}

/* ── FORM ─────────────────────────────────────────────────── */
form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--neutral-700);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-50);
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

input[type="checkbox"] { accent-color: var(--color-accent); }

.password-row {
    display: flex;
    gap: 8px;
}
.password-row input { flex: 1; }

/* ── CHOICE CARDS ─────────────────────────────────────────── */
.choice-group {
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    padding: 14px;
    background: var(--neutral-50);
}

.choice-group legend {
    font-weight: 600;
    font-size: 13.5px;
    padding: 0 6px;
    color: var(--neutral-700);
}

.choice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--color-border);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.choice-card:hover {
    border-color: var(--brand-400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

.choice-card input { margin-top: 2px; }
.choice-card span  { font-weight: 600; font-size: 14px; }
.choice-card small { display: block; margin-top: 3px; color: var(--color-muted); font-size: 12px; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(37,99,235,0.25), 0 6px 16px rgba(37,99,235,0.18);
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
    text-decoration: none;
    white-space: nowrap;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37,99,235,0.28), 0 10px 24px rgba(37,99,235,0.22);
    filter: brightness(1.04);
}

.primary-btn:active { transform: translateY(0); filter: brightness(0.97); }

.primary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-100);
    color: var(--neutral-700);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
    white-space: nowrap;
    text-decoration: none;
}

.toggle-btn:hover {
    background: var(--neutral-200);
    border-color: var(--neutral-300);
    transform: translateY(-1px);
}

.toggle-btn.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--color-danger);
}

.toggle-btn.danger:hover {
    background: #fee2e2;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: transparent;
    color: var(--neutral-700);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.ghost-btn:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
}


.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: transparent;
    color: var(--neutral-700);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.logout-btn:hover {
        background: var(--neutral-100);
        border-color: var(--neutral-300);
    }

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-100);
    color: var(--neutral-700);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    flex-shrink: 0;
}

.icon-btn:hover { background: var(--neutral-200); transform: translateY(-1px); }

.icon-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-50);
    color: var(--neutral-700);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
    position: relative;
    flex-shrink: 0;
}

.icon-action-btn:hover {
    background: var(--neutral-100);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.icon-action-btn.fav-btn.filled {
    color: #e11d48;
    border-color: #fecaca;
    background: #fff5f5;
}

/* ── ACTIONS ROW ──────────────────────────────────────────── */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

/* ── LINK ─────────────────────────────────────────────────── */
.link {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}

.link:hover {
    color: var(--color-accent-h);
    text-decoration: underline;
}

/* ── STATUS / ALERT ───────────────────────────────────────── */
.status {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-50);
    font-size: 13.5px;
    line-height: 1.5;
}

.status.error   { border-color: #fca5a5; color: #991b1b; background: #fff5f5; }
.status.success { border-color: #86efac; color: #14532d; background: #f0fdf4; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-yellow  { background: #fef9c3; color: #a16207; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }

/* ── CARD GRID ────────────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

/* ── TILE (dashboard nav card) ───────────────────────────── */
.tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 14px;
    border: 1.5px solid var(--color-border);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    cursor: pointer;
}

.tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-400);
}

.tile-title { font-weight: 700; font-size: 16px; }
.tile-desc  { color: var(--color-muted); font-size: 13px; line-height: 1.45; }

/* ── PRODUCT CARD ─────────────────────────────────────────── */
.product {
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    overflow: hidden;
    transition: transform 0.18s, box-shadow 0.18s;
}

.product:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.product img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--neutral-100);
}

.product-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* ── ORDER CARD ───────────────────────────────────────────── */
.order {
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 0.15s;
}

.order:hover { box-shadow: var(--shadow-sm); }

.items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    background: var(--neutral-50);
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 4px;
}

/* ── CART BADGE ───────────────────────────────────────────── */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    background: var(--brand-600);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    padding: 0 3px;
    line-height: 1;
    border: 2px solid var(--color-surface);
}

/* ── PROFILE DROPDOWN ─────────────────────────────────────── */
.profile-menu    { position: relative; }

.profile-dropdown {
    position: absolute;
    right: 0;
    margin-top: 8px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    padding: 8px;
    min-width: 200px;
    display: none;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.profile-dropdown button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--color-text);
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.profile-dropdown button:hover { background: var(--neutral-100); }

/* ── ORDER CHAT PANEL ─────────────────────────────────────── */
.chat-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 72%;
    align-self: flex-start;
}

.chat-item.mine { align-self: flex-end; }

.chat-meta {
    font-size: 11px;
    color: var(--color-muted);
}

.chat-text {
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--neutral-100);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-item.mine .chat-text {
    background: var(--brand-600);
    color: #fff;
}

/* ── TABS ─────────────────────────────────────────────────── */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 4px;
    border-bottom: 1.5px solid var(--color-border);
    margin-bottom: 16px;
}

/* ── SUMMARY ──────────────────────────────────────────────── */
.summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1.5px solid var(--color-border);
}

.summary-total { font-size: 18px; font-weight: 700; }

/* ── SEARCH INPUT ─────────────────────────────────────────── */
.search-input {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px 8px 36px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 11px center;
    font-size: 13.5px;
    color: var(--color-text);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--color-border);
    margin: 16px 0;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
    background: var(--neutral-900);
    color: #f8fafc;
    border-radius: 16px;
    padding: 24px;
    font-size: 13.5px;
}

.footer-bottom {
    margin-top: 12px;
    text-align: center;
    font-size: 12.5px;
    color: var(--neutral-500);
}

/* ── SPINNER ──────────────────────────────────────────────── */
@keyframes ds-spin { to { transform: rotate(360deg); } }

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ds-spin 0.65s linear infinite;
    display: inline-block;
}

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes ds-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.ds-animate { animation: ds-slideUp 0.45s cubic-bezier(.22,.68,0,1.2) both; }

/* ── UTILS ────────────────────────────────────────────────── */
.text-muted { color: var(--color-muted); }
.font-bold  { font-weight: 700; }
.mt-2       { margin-top: 8px; }
.mt-4       { margin-top: 16px; }
.gap-2      { gap: 8px; }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full     { width: 100%; }

/* ── HOME LINK (back/home icon button) ────────────────────── */
.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--neutral-100);
    border: 1.5px solid var(--color-border);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.15s, transform 0.12s;
    flex-shrink: 0;
}

.home-link:hover {
    background: var(--neutral-200);
    transform: translateY(-1px);
}

/* ── ITEM (cart / favorites list item) ────────────────────── */
.item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1.5px solid var(--color-border);
}

.item:last-child { border-bottom: none; }

.item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-100);
}

.item-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-title { font-weight: 700; }

.qty-input,
.qty-edit {
    width: 70px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1.5px solid var(--color-border);
    background: var(--neutral-50);
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
}

/* ── ORDER PICKER (modal dialog) ──────────────────────────── */
.order-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 20, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
}

.order-picker-backdrop.show { display: flex; }

.order-picker {
    width: min(520px, calc(100% - 24px));
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-picker-header h3 { margin: 0; font-size: 18px; }
.order-picker-header p  { margin: 4px 0 0; color: var(--color-muted); font-size: 13px; }

.order-picker-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow: auto;
}

.order-choice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.order-choice input { margin-top: 2px; }
.order-choice:hover { background: var(--neutral-50); }

.order-choice-title { font-weight: 700; display: block; }
.order-choice-meta  { color: var(--color-muted); font-size: 12px; }

.order-picker-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ── MODAL (generic) ──────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 { margin: 0; }

.modal-body { margin-bottom: 16px; }

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── ADDRESS INPUT ────────────────────────────────────────── */
.address-input-group {
    display: flex;
    gap: 8px;
}

.address-input-group input { flex: 1; }

.address-preview {
    margin-top: 16px;
    padding: 12px;
    background: var(--neutral-50);
    border-radius: 8px;
}

/* ── CHAT PANEL ───────────────────────────────────────────── */
.chat-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 12000;
}

.chat-modal {
    width: min(720px, 100%);
    max-height: 86vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-messages {
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    padding: 10px;
    min-height: 240px;
    max-height: 52vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input-row textarea {
    flex: 1;
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
}

/* ── FORM ROW ─────────────────────────────────────────────── */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.form-row select,
.form-row input { width: 100%; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 860px) {
    body.auth-page .page {
        grid-template-columns: 1fr;
    }

    body.auth-page .hero {
        min-height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px 24px;
    }

    body.auth-page .hero-features { display: none; }
}

@media (max-width: 560px) {
    body.auth-page {
        padding: 20px 14px 32px;
    }

    body.auth-page .card,
    body.auth-page .hero {
        padding: 22px 20px;
    }

    h1.heading { font-size: 22px; }

    .ds-nav { padding: 0 14px; }

    .ds-nav-links { display: none; }
}

@media (max-width: 768px) {
    .item { grid-template-columns: 1fr; }
    .actions { flex-wrap: wrap; }
}

/* ──────────────────────────────────────────────────────────────
   MOBILE-FIRST RESPONSIVE ENHANCEMENTS (≤ 480px)
   Improves usability on smartphones without breaking desktop.
   ────────────────────────────────────────────────────────────── */

/* ── MOBILE: GLOBAL ────────────────────────────────────────── */
@media (max-width: 480px) {
    body { font-size: 14px; }

    /* Ensure touch-friendly input sizes */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        padding: 12px 14px;
        font-size: 16px; /* prevents iOS zoom on focus */
        border-radius: 10px;
    }

    /* Touch-friendly buttons – minimum 44px tap target */
    .primary-btn {
        padding: 12px 18px;
        font-size: 15px;
        min-height: 44px;
        width: 100%;
    }

    .toggle-btn {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
    }

    .ghost-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    .logout-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    .icon-btn {
        width: 44px;
        height: 44px;
    }

    .icon-action-btn {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    /* Typography */
    h1.heading { font-size: 20px; }
    h2.heading { font-size: 18px; }
    h3.heading { font-size: 16px; }

    .subtitle { font-size: 13px; margin-bottom: 14px; }
    .meta { font-size: 12px; }

    /* Cards */
    .card { padding: 16px; border-radius: 14px; }

    /* Grids */
    .grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Actions wrap vertically */
    .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .actions .primary-btn,
    .actions .toggle-btn,
    .actions .ghost-btn {
        width: 100%;
        justify-content: center;
    }

    /* Links in actions remain inline */
    .actions .link {
        text-align: center;
        padding: 8px 0;
    }

    /* Search input full width */
    .search-input {
        max-width: 100%;
    }

    /* Summary row */
    .summary {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 10px;
    }

    .summary-total { font-size: 16px; }

    /* Auth pages */
    body.auth-page {
        padding: 12px 10px 24px;
    }

    body.auth-page .page {
        gap: 12px;
    }

    body.auth-page .hero {
        padding: 16px 18px;
        border-radius: 16px;
    }

    body.auth-page .card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .hero-logo {
        font-size: 18px;
        gap: 8px;
    }

    .hero-logo::before {
        width: 8px;
        height: 8px;
    }

    .hero-tagline { font-size: 11px; }

    .hero-text { font-size: 16px; }

    /* Choice cards stack */
    .choice-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .choice-card {
        padding: 14px;
    }

    /* Password row */
    .password-row {
        flex-direction: column;
        gap: 6px;
    }

    .password-row .toggle-btn {
        width: 100%;
    }

    /* App page layout */
    body.app-page .page {
        padding: 12px 10px 32px;
        gap: 12px;
    }

    body.app-page .hero {
        padding: 10px 14px;
        border-radius: 12px;
    }

    body.app-page .hero-logo {
        font-size: 15px;
    }

    body.app-page .hero .hero-text {
        font-size: 12px;
    }

    /* Tiles (dashboard cards) */
    .tile {
        padding: 16px;
        border-radius: 12px;
    }

    .tile-title { font-size: 15px; }
    .tile-desc { font-size: 12px; }

    /* Product card */
    .product img {
        height: 140px;
    }

    .product-body {
        padding: 12px;
    }

    /* Order card */
    .order {
        padding: 12px;
        border-radius: 10px;
    }

    .items {
        padding: 8px;
        font-size: 12px;
    }

    /* Cart/favorites items */
    .item {
        grid-template-columns: 64px 1fr;
        gap: 10px;
        padding: 12px 0;
    }

    .item img {
        width: 64px;
        height: 64px;
        border-radius: 10px;
    }

    .item-title { font-size: 14px; }

    /* Tabs – horizontal scroll on mobile */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
    }

    .tabs::-webkit-scrollbar { display: none; }

    /* Order tabs – scroll horizontally */
    #ordersTabs,
    #incomingOrdersTabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    #ordersTabs::-webkit-scrollbar,
    #incomingOrdersTabs::-webkit-scrollbar { display: none; }

    #ordersTabs .primary-btn,
    #ordersTabs .toggle-btn,
    #incomingOrdersTabs .primary-btn,
    #incomingOrdersTabs .toggle-btn {
        flex-shrink: 0;
        width: auto;
        font-size: 12px;
        padding: 8px 12px;
        min-height: 36px;
    }

    /* Profile dropdown – full width */
    .profile-dropdown {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 10px;
        min-width: auto;
        width: auto;
        border-radius: 16px;
        padding: 10px;
        z-index: 300;
    }

    .profile-dropdown button {
        padding: 14px 14px;
        font-size: 15px;
        border-bottom: 1px solid var(--color-border);
    }

    .profile-dropdown button:last-child {
        border-bottom: none;
    }

    /* Modals – full screen on mobile */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
        padding: 20px 16px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .modal-actions .primary-btn,
    .modal-actions .toggle-btn {
        width: 100%;
        justify-content: center;
    }

    /* Order picker modal – bottom sheet */
    .order-picker-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .order-picker {
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 18px 14px;
        max-height: 85vh;
    }

    .order-picker-header h3 { font-size: 16px; }

    .order-picker-body {
        max-height: 45vh;
    }

    .order-picker-actions {
        flex-direction: column;
        gap: 8px;
    }

    .order-picker-actions .primary-btn,
    .order-picker-actions .ghost-btn {
        width: 100%;
        justify-content: center;
    }

    /* Chat modal – full screen */
    .chat-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .chat-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        padding: 16px 12px;
    }

    .chat-messages {
        min-height: 180px;
        max-height: 50vh;
    }

    .chat-item { max-width: 85%; }

    .chat-input-row {
        flex-direction: column;
        gap: 8px;
    }

    .chat-input-row .primary-btn {
        width: 100%;
    }

    /* Address input group */
    .address-input-group {
        flex-direction: column;
        gap: 6px;
    }

    .address-input-group .toggle-btn {
        width: 100%;
    }

    /* Footer */
    .footer {
        border-radius: 12px;
        padding: 16px;
        font-size: 12px;
    }

    .footer-bottom {
        font-size: 11px;
        padding: 8px 0;
    }

    /* Home link button */
    .home-link {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Badges */
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Form row */
    .form-row {
        margin-top: 8px;
    }

    /* Status messages */
    .status {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Qty inputs */
    .qty-input,
    .qty-edit {
        width: 60px;
        padding: 8px;
        font-size: 16px;
    }

    /* Price range side by side */
    .price-range {
        flex-direction: column;
        gap: 8px;
    }
}

/* ── MOBILE: VERY SMALL SCREENS (≤ 360px) ─────────────────── */
@media (max-width: 360px) {
    body.auth-page { padding: 8px 6px 16px; }

    body.auth-page .card { padding: 14px 12px; }
    body.auth-page .hero { padding: 14px; }

    body.app-page .page { padding: 8px 6px 24px; }

    .card { padding: 12px; border-radius: 12px; }

    h1.heading { font-size: 18px; }
    h2.heading { font-size: 16px; }

    .hero-logo { font-size: 15px; }

    .primary-btn { font-size: 14px; padding: 11px 14px; }
}
