/* ═══════════════════════════════════════════════════════
   GozeBV Portal — portal.css v4
   ═══════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px; line-height: 1.6;
    background: #f8fafc; color: #0f172a;
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Tokens ──────────────────────────────────────────── */
:root {
    --container:    1200px;
    --header-h:     56px;
    --radius:       8px;
    --radius-sm:    5px;
    --radius-lg:    12px;
    --bg:           #f8fafc;
    --surface:      #ffffff;
    --surface-2:    #f1f5f9;
    --border:       #e2e8f0;
    --text:         #0f172a;
    --text-2:       #334155;
    --muted:        #64748b;
    --faint:        #94a3b8;
    --navy:         #0f172a;
    --navy-2:       #1e293b;
    --gold:         #facc15;
    --blue:         #3b82f6;
    --green:        #25d366;
    --red:          #ef4444;
    --asnew:        #059669;
    --status-pending:   #d97706;
    --status-confirmed: #059669;
    --status-rejected:  #ef4444;
    --cart-bar-h:   64px;
}

/* ── Container ───────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 760px) { .container { padding: 0 16px; } }

/* ── Page shell ──────────────────────────────────────── */
#page { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
#main { flex: 1; }

/* ════════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════════ */
#masthead {
    background: var(--navy); border-bottom: 1px solid var(--navy-2);
    height: var(--header-h); position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo-link { display: inline-flex; flex-direction: column; gap: 1px; transition: opacity .15s; }
.logo-link:hover { opacity: .85; }
.logo-main { font-size: 18px; font-weight: 800; color: var(--gold); letter-spacing: -.5px; line-height: 1; }
.logo-com  { color: #fff; font-size: 12px; font-weight: 400; }
.logo-tagline { font-size: 8px; color: #64748b; text-transform: uppercase; letter-spacing: 1px; line-height: 1; white-space: nowrap; }
.header-customer { display: flex; align-items: center; gap: 16px; }
.header-company  { font-size: 13px; font-weight: 600; color: #94a3b8; }
.header-company span { color: #f1f5f9; }
@media (max-width: 480px) { .header-company { display: none; } .logo-main { font-size: 16px; } }

/* ════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════ */
#footer { background: var(--navy); border-top: 1px solid var(--navy-2); margin-bottom: var(--cart-bar-h); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 0; }
.footer-copy  { font-size: 12px; color: #94a3b8; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: #94a3b8; transition: color .15s; }
.footer-links a:hover { color: #f1f5f9; }
.footer-credit-bar { border-top: 1px solid var(--navy-2); padding: 10px 0; display: flex; align-items: center; }
.footer-credit-bar .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.footer-credit-bar span { font-size: 11px; color: #475569; }
.footer-credit-bar a { color: #3b82f6; transition: color .15s; }
.footer-credit-bar a:hover { color: #60a5fa; }
body.no-cart #footer { margin-bottom: 0; }
@media (max-width: 480px) {
    .footer-credit-bar { flex-direction: column; gap: 8px; }
    .footer-credit-bar .container { flex-direction: column; gap: 8px; }
}

/* ════════════════════════════════════════════════════════
   PORTAL NAV
════════════════════════════════════════════════════════ */
.portal-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-nav-inner { display: flex; gap: 0; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.portal-nav-inner::-webkit-scrollbar { display: none; }
.portal-nav-link {
    display: flex; align-items: center; gap: 7px;
    padding: 14px 18px; font-size: 13px; font-weight: 600;
    color: var(--muted); border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s; white-space: nowrap;
}
.portal-nav-link:hover { color: var(--text); }
.portal-nav-link.active { color: var(--text); border-bottom-color: var(--navy); }

/* ════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius);
    font-size: 13px; font-weight: 600; cursor: pointer; border: none;
    transition: opacity .15s, transform .1s;
    line-height: 1; white-space: nowrap; font-family: inherit;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn-primary   { background: var(--navy); color: #fff; }
.btn-whatsapp  { background: var(--green); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-outline   { background: transparent; color: var(--text); border: 1.5px solid #94a3b8; }
.btn-outline:hover { border-color: var(--text); background: var(--surface-2); opacity: 1; }
.btn-outline-light { background: transparent; color: #f1f5f9; border: 1.5px solid #475569; }
.btn-outline-light:hover { background: #1e293b; border-color: #94a3b8; opacity: 1; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
#cart-bar .btn-primary { border: 1.5px solid #475569; }

/* ════════════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════════════ */
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.form-field input,
.form-field select,
.form-field textarea {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 12px; font-size: 14px; color: var(--text);
    background: var(--surface); width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ════════════════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════════════════ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ════════════════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════════════════ */
.login-page { min-height: 100vh; background: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.login-logo { margin-bottom: 32px; text-align: center; }
.login-logo .logo-main    { font-size: 28px; }
.login-logo .logo-tagline { font-size: 10px; letter-spacing: 2px; color: #475569; }
.login-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--navy-2); width: 100%; max-width: 420px; overflow: hidden; }
.login-card-header { background: var(--navy-2); padding: 20px 28px; border-bottom: 1px solid rgba(255,255,255,.05); }
.login-card-header h1 { font-size: 16px; font-weight: 700; color: #f1f5f9; margin-bottom: 4px; }
.login-card-header p  { font-size: 13px; color: #64748b; }
.login-card-body { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-divider   { border: none; border-top: 1px solid var(--border); }
.login-request { background: var(--surface-2); border-top: 1px solid var(--border); padding: 20px 28px; }
.login-request h2 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-request p  { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
@media (max-width: 480px) { .login-card-body { padding: 20px; } .login-card-header { padding: 16px 20px; } .login-request { padding: 16px 20px; } }

/* ════════════════════════════════════════════════════════
   BRAND TABS
════════════════════════════════════════════════════════ */
.brand-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; margin-bottom: 16px; }
.brand-tab {
    padding: 8px 18px; font-size: 13px; font-weight: 600;
    color: var(--muted); cursor: pointer;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 20px; white-space: nowrap;
    font-family: inherit; transition: all .15s; flex-shrink: 0;
}
.brand-tab:hover { color: var(--text); border-color: #94a3b8; }
.brand-tab.active { color: #fff; background: var(--navy); border-color: var(--navy); }

/* ════════════════════════════════════════════════════════
   CATALOG TABLE
════════════════════════════════════════════════════════ */
.catalog-table-wrap {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: visible;
}
.catalog-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.catalog-table thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.catalog-table thead tr:first-child th:last-child  { border-top-right-radius: var(--radius); }
.catalog-table thead th {
    background: var(--surface-2); color: var(--muted);
    padding: 10px 16px; text-align: left;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.catalog-table tbody tr {
    border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background .1s, border-left-color .1s;
    border-left: 3px solid transparent;
}
.catalog-table tbody tr:last-child { border-bottom: none; }
.catalog-table tbody tr:hover { background: #f8fafc; border-left-color: var(--blue); }
.catalog-table td { padding: 10px 16px; vertical-align: middle; }
.col-arrow { width: 28px; padding: 0 8px !important; }

/* Model cell — image stacked above model name */
.col-model { width: 140px; }
.catalog-model-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.catalog-model-info { display: flex; flex-direction: column; }
.model-name  { font-weight: 700; color: var(--text); font-size: 13px; line-height: 1.3; }
.model-brand { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Car image thumbnail */
.catalog-img-wrap {
    position: relative;
    display: inline-block;
    width: 90px;
}
.catalog-img-thumb {
    width: 90px; height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.catalog-img-svg {
    width: 90px; height: 60px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.catalog-img-svg svg { width: 90px; height: 60px; }

/* Hover preview — desktop only, fixed position set via JS */
.catalog-img-hover {
    display: none;
    position: fixed;
    z-index: 99;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    padding: 6px;
    pointer-events: none;
}
.catalog-img-hover img {
    width: 320px;
    height: 213px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
@media (hover: hover) {
    .catalog-img-wrap:hover .catalog-img-hover { display: block; }
}

/* Grade pills */
.grade-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.grade-pill {
    display: inline-flex; flex-direction: column; align-items: center;
    gap: 1px; padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    flex-shrink: 0;
}
.grade-pill-name    { font-weight: 800; font-size: 12px; color: var(--text); }
.grade-pill-warranty { font-size: 9px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.grade-pill-price   { font-weight: 700; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 2px; }

.row-arrow { color: var(--faint); font-size: 18px; text-align: center; transition: color .15s, transform .15s; }
.catalog-table tbody tr:hover .row-arrow { color: var(--blue); transform: translateX(3px); }
.catalog-click-hint { font-size: 11px; color: var(--faint); font-weight: 500; font-style: italic; margin-left: 8px; }

/* Mobile catalog — image and model stack, pills side by side */
@media (max-width: 760px) {
    .col-arrow { display: none; }
    .catalog-click-hint { display: none; }
    .col-model { width: 110px; }
    .catalog-img-wrap { width: 90px; }
    .catalog-img-thumb { width: 90px; height: 60px; }
    .catalog-img-svg   { width: 90px; height: 60px; }
    .catalog-img-svg svg { width: 90px; height: 60px; }
    .grade-pill { padding: 4px 8px; }
    .grade-pill-name    { font-size: 11px; }
    .grade-pill-warranty { font-size: 8px; }
    .grade-pill-price   { font-size: 11px; }
    .catalog-table td { padding: 10px 8px; }
}

/* ════════════════════════════════════════════════════════
   ORDER DRAWER
════════════════════════════════════════════════════════ */
#drawer-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 200; backdrop-filter: blur(2px);
}
#drawer-overlay.open { display: block; }

#order-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 100vw;
    background: var(--surface); border-left: 1px solid var(--border);
    z-index: 201; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .25s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.1);
}
#order-drawer.open { transform: translateX(0); }

.drawer-header {
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px;
    flex-shrink: 0;
}
.drawer-title { font-size: 18px; font-weight: 700; color: var(--text); }
.drawer-brand { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer-close {
    background: none; border: none; color: var(--muted);
    font-size: 22px; cursor: pointer; padding: 0 4px;
    line-height: 1; flex-shrink: 0; border-radius: 4px;
    transition: background .15s, color .15s;
}
.drawer-close:hover { background: var(--surface-2); color: var(--text); }

.drawer-hint {
    padding: 8px 16px; font-size: 11px; color: var(--muted);
    background: var(--surface-2); border-bottom: 1px solid var(--border);
    text-align: center; flex-shrink: 0;
}

/* Drawer images */
.drawer-images {
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    padding: 12px 16px;
    flex-shrink: 0;
}
.drawer-img-pair {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.drawer-img-slot {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: zoom-in;
}
.drawer-img-slot img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .15s;
}
.drawer-img-slot img:hover { opacity: .9; }
.drawer-img-svg {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2);
}
.drawer-img-svg svg { width: 100%; height: 100%; }

.drawer-body {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}

.drawer-grade-row {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px;
    display: grid; grid-template-columns: 1fr auto auto;
    gap: 12px; align-items: center;
    transition: border-color .15s, background .15s;
}
.drawer-grade-row:hover   { border-color: #94a3b8; }
.drawer-grade-row.has-qty { border-color: var(--blue); background: #eff6ff; }

.drawer-grade-info { display: flex; flex-direction: column; gap: 2px; }
.drawer-grade-name    { font-weight: 700; font-size: 15px; color: var(--text); }
.drawer-grade-warranty { font-size: 11px; color: var(--muted); }
.drawer-grade-price   { font-size: 16px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Qty control */
.qty-control {
    display: flex; align-items: center;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; background: var(--surface); transition: border-color .15s;
}
.drawer-grade-row.has-qty .qty-control { border-color: var(--blue); }
.qty-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }

.qty-btn {
    background: var(--surface-2); border: none; color: var(--text);
    font-size: 18px; font-weight: 400; width: 34px; height: 38px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s; flex-shrink: 0; line-height: 1; padding: 0; user-select: none;
}
.qty-btn:hover  { background: #e2e8f0; }
.qty-btn:active { background: #cbd5e1; }

.drawer-qty-input {
    width: 46px; text-align: center; border: none;
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    padding: 6px 4px; font-size: 14px; font-weight: 600; color: var(--text);
    background: var(--surface);
    -moz-appearance: textfield; appearance: textfield; outline: none;
}
.drawer-qty-input::-webkit-inner-spin-button,
.drawer-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.drawer-footer {
    padding: 16px; border-top: 1px solid var(--border);
    background: var(--surface); display: flex; flex-direction: column;
    gap: 10px; flex-shrink: 0;
}
.drawer-subtotal { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.drawer-subtotal-value { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
    #order-drawer {
        top: auto; left: 0; right: 0; bottom: 0; width: 100%;
        border-left: none; border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0; max-height: 88vh;
        transform: translateY(100%);
        box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    }
    #order-drawer.open { transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════
   IMAGE LIGHTBOX
════════════════════════════════════════════════════════ */
#img-lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.95); z-index: 400;
    align-items: center; justify-content: center;
}
#img-lightbox.open { display: flex; }
#img-lightbox-img {
    max-width: 92vw; max-height: 92vh;
    object-fit: contain; border-radius: 4px;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
#img-lightbox-close {
    position: fixed; top: 16px; right: 20px;
    background: none; border: none; color: #fff;
    font-size: 36px; cursor: pointer; line-height: 1;
    opacity: .7; transition: opacity .15s; z-index: 401;
}
#img-lightbox-close:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════
   STICKY CART BAR
════════════════════════════════════════════════════════ */
#cart-bar {
    position: fixed; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: var(--cart-bar-h);
    background: var(--navy);
    border-top: 1px solid var(--navy-2);
    border-left: 1px solid var(--navy-2);
    border-right: 1px solid var(--navy-2);
    border-radius: 12px 12px 0 0;
    z-index: 150; display: none; align-items: center;
    padding: 0 24px; gap: 16px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.2);
}
#cart-bar.visible { display: flex; }
.cart-bar-summary { flex: 1; display: flex; align-items: center; gap: 12px; }
.cart-bar-count { background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.cart-bar-total { font-size: 18px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.cart-bar-label { font-size: 11px; color: #64748b; }
.cart-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 640px) {
    :root { --cart-bar-h: 116px; }
    #cart-bar {
        left: 0;
        transform: none;
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        height: auto; flex-direction: column; align-items: stretch;
        padding: 12px 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        gap: 8px;
    }
    #order-summary-panel {
        bottom: 116px;
        left: 0;
        transform: translateY(100%);
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    #order-summary-panel.open { transform: translateY(0); }
    .cart-bar-summary { width: 100%; }
    .cart-bar-actions { width: 100%; display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
    .cart-bar-actions .btn { justify-content: center; }
    .cart-bar-label { display: none; }
    .cart-bar-total { font-size: 16px; }
}

/* ════════════════════════════════════════════════════════
   ORDER SUMMARY PANEL
════════════════════════════════════════════════════════ */
#order-summary-panel {
    position: fixed; bottom: var(--cart-bar-h);
    left: 50%; transform: translateX(-50%) translateY(100%);
    width: 100%; max-width: 1200px;
    background: var(--surface); border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    z-index: 149; max-height: 60vh; overflow-y: auto;
    transition: transform .25s ease;
    box-shadow: 0 -4px 24px rgba(0,0,0,.1);
}

#order-summary-panel.open { transform: translateX(-50%) translateY(0); }
.order-panel-inner { padding: 20px; }
.order-panel-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

.order-lines { display: flex; flex-direction: column; }
.order-line {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto;
    gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
    align-items: center; font-size: 13px;
}
.order-line:last-child { border-bottom: none; }
.order-line-name  { color: var(--text); font-weight: 500; }
.order-line-qty   { color: var(--muted); text-align: center; }
.order-line-price { color: var(--muted); min-width: 70px; text-align: right; font-size: 12px; }
.order-line-total { color: var(--text); font-weight: 700; min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
.order-line-remove { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1; }
.order-line-remove:hover { color: var(--red); }

.order-note { margin-top: 16px; }
.order-note label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 6px; }
.order-note textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--text); resize: vertical; min-height: 72px; font-family: inherit; transition: border-color .15s; }
.order-note textarea:focus { outline: none; border-color: var(--blue); }
.order-shipping { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 4px; }

@media (max-width: 760px) {
    .order-line { grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; }
    .order-line-price { display: none; }
    #order-summary-panel {
        left: 0; right: 0; max-width: none;
        transform: translateY(100%);
        max-height: 70vh;
    }
    #order-summary-panel.open { transform: translateY(0); }
}

@media (max-width: 640px) {
    #cart-bar {
        left: 0;
        transform: none;
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    #order-summary-panel {
        left: 0;
        transform: translateY(100%);
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    #order-summary-panel.open {
        transform: translateY(0);
    }
}

/* ════════════════════════════════════════════════════════
   EMAIL + WHATSAPP MODALS
════════════════════════════════════════════════════════ */
#email-modal-overlay,
#wa-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 300; backdrop-filter: blur(2px);
}
#email-modal-overlay.open, #wa-modal-overlay.open { display: block; }

#email-modal, #wa-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    width: 500px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px); overflow-y: auto;
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--border); z-index: 301;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
    box-shadow: 0 24px 64px rgba(0,0,0,.2);
    display: none;
}
#email-modal.open, #wa-modal.open {
    display: flex; flex-direction: column;
    opacity: 1; pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}
.email-modal-header {
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.email-modal-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.email-modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 4px; line-height: 1; }
.email-modal-close:hover { color: var(--text); }
.email-modal-body { padding: 20px; flex: 1; overflow-y: auto; }
.email-modal-summary { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; font-size: 13px; }
.email-modal-summary-line { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.email-modal-summary-line:last-child { border-bottom: none; }
.email-modal-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; color: var(--text); padding-top: 10px; border-top: 2px solid var(--text); margin-top: 6px; }
.email-modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-shrink: 0; }
.email-modal-footer .btn { flex: 1; }

.wa-preview-box {
    background: #e7f8e4; border-radius: 8px; padding: 14px;
    font-size: 13px; font-family: monospace;
    white-space: pre-wrap; line-height: 1.6;
    color: #0f172a; border: 1px solid #c3e6cb;
}

@media (max-width: 560px) {
    #email-modal, #wa-modal {
        top: auto; left: 0; right: 0; bottom: 0;
        transform: translateY(100%);
        border-radius: 16px 16px 0 0;
        max-height: 90vh; width: 100%;
    }
    #email-modal.open, #wa-modal.open { transform: translateY(0); }
    .email-modal-footer { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════
   ORDER HISTORY
════════════════════════════════════════════════════════ */
.orders-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 20px 0 20px 24px; }
.orders-header h1 { font-size: 18px; font-weight: 700; color: var(--text); }
.orders-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; margin-bottom: 40px; }
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.order-card-header { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); align-items: center; }
.order-card-id    { font-size: 13px; font-weight: 700; color: var(--text); }
.order-card-date  { font-size: 12px; color: var(--muted); }
.order-card-total { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.order-card-body  { padding: 16px 20px; }
.order-card-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.order-card-item  { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; font-size: 13px; color: var(--text-2); }
.order-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.status-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.status-pending   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.status-confirmed { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status-rejected  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.orders-empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.orders-empty h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.orders-empty p  { font-size: 13px; margin-bottom: 20px; }

@media (max-width: 600px) {
    .order-card-header { grid-template-columns: 1fr auto; gap: 8px; }
    .order-card-date   { grid-column: 1 / -1; margin-top: -4px; }
    .order-card-actions { flex-direction: column; align-items: flex-start; }
    .order-card-actions .btn { width: 100%; justify-content: center; }
}

/* ════════════════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════════════════ */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red); }
