/* ============================================================
   LAMI TRIMS — PORTAL GLOBAL STYLESHEET
   Single source of truth for all customer portal pages.
   Included via portal_header.asp.
   ============================================================ */

/* ── Font faces ─────────────────────────────────────────────── */
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('fonts/PlusJakartaSans-variable.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ============================================================
   DESIGN TOKENS — mirrors admin_global.css / Corp_website/global.css
============================================================ */
:root {
    /* Saffron scale */
    --saffron-50:  #FDF6E7;
    --saffron-100: #FAE6B7;
    --saffron-300: #EFAE38;
    --saffron-500: #DD8903;
    --saffron-600: #B26F03;
    --saffron-700: #875502;

    /* Industrial blue scale */
    --blue-50:  #E8F1FB;
    --blue-100: #C7DDF3;
    --blue-200: #92BCE4;
    --blue-300: #5798CF;
    --blue-400: #1F75B8;
    --blue-500: #0056A2;
    --blue-600: #004584;
    --blue-700: #003568;
    --blue-800: #00284E;
    --blue-900: #001A34;

    /* Neutrals */
    --neutral-0:   #FFFFFF;
    --neutral-50:  #F5F5F3;
    --neutral-100: #ECECE8;
    --neutral-200: #DCDCD7;
    --neutral-300: #BFBFB9;
    --neutral-400: #919189;
    --neutral-500: #62625C;
    --neutral-600: #424239;
    --neutral-700: #292924;
    --neutral-800: #161613;

    /* Semantic */
    --color-success: #2E6B4A;
    --color-warning: #C77A14;
    --color-error:   #9A2828;
    --color-info:    #1E4A8C;

    /* ── Semantic aliases ── */
    --navy:        var(--blue-500);
    --navy-deep:   var(--blue-700);
    --navy-mid:    var(--blue-600);
    --gold:        var(--saffron-500);
    --gold-light:  var(--saffron-300);
    --gold-pale:   var(--saffron-50);
    --white:       var(--neutral-0);
    --off-white:   var(--neutral-50);
    --light-bg:    var(--neutral-100);
    --border:      var(--neutral-200);
    --border-dark: var(--neutral-300);
    --text-main:   var(--neutral-800);
    --text-muted:  var(--neutral-500);
    --text-light:  var(--neutral-400);
    --green:       var(--color-success);
    --green-deep:  #255940;
    --green-pale:  #EAF4EE;
    --red:         var(--color-error);
    --red-bg:      #F9ECEC;

    /* Layout */
    --radius:          4px;
    --radius-md:       8px;
    --shadow-sm:       0 2px 12px rgba(0,86,162,0.07);
    --shadow-md:       0 8px 32px rgba(0,86,162,0.12);
    --transition:      all 0.25s cubic-bezier(0.4,0,0.2,1);
    --portal-sidebar:  240px;
    --portal-topbar:   60px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main); line-height: 1.6;
    background: var(--off-white);
    overflow-x: hidden;
}
a { transition: var(--transition); }
img { max-width: 100%; display: block; }

/* ── PORTAL SHELL ── */
.portal-shell { display: block; min-height: 100vh; }

/* ============================================================
   SIDEBAR
============================================================ */
.portal-sidebar {
    width: var(--portal-sidebar);
    min-width: var(--portal-sidebar);
    background: var(--navy-deep);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform 0.28s ease;
}
.portal-sidebar.collapsed { transform: translateX(-100%); }

/* Brand */
.sidebar-brand {
    padding: 20px 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex; align-items: center; flex-shrink: 0;
}
.sidebar-logo { width: 160px; height: auto; display: block; opacity: 0.92; }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 12px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-section-label {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: rgba(255,255,255,0.22);
    padding: 18px 20px 6px; display: block;
}
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin: 1px 10px;
    border-radius: 10px;
    color: rgba(255,255,255,0.52); font-size: 13px; font-weight: 500;
    text-decoration: none; white-space: nowrap; font-family: 'Inter', sans-serif;
    transition: background 0.15s, color 0.15s; position: relative;
    border: none; background: none; cursor: pointer; width: calc(100% - 20px);
    text-align: left;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }
.nav-link.active { background: rgba(255,255,255,0.10); color: var(--white); font-weight: 600; }
.nav-link i {
    font-size: 15px; width: 20px; text-align: center;
    flex-shrink: 0; opacity: 0.7; transition: opacity 0.15s;
}
.nav-link:hover i { opacity: 0.9; }
.nav-link.active i { opacity: 1; color: var(--gold); }
.nav-badge {
    margin-left: auto; background: rgba(249,166,2,0.2); color: var(--gold);
    border-radius: 20px; padding: 2px 8px;
    font-size: 10px; font-weight: 700; flex-shrink: 0;
}

/* Sidebar footer / user */
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.09);
    flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--white);
    flex-shrink: 0;
}
.user-info strong { display: block; font-size: 12px; color: var(--white); font-weight: 600; }
.user-info span   { font-size: 10px; color: rgba(255,255,255,0.38); }
.sidebar-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px;
    color: rgba(255,255,255,0.42);
    text-decoration: none; font-size: 12.5px; font-weight: 500;
    transition: background 0.15s, color 0.15s;
    width: 100%;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); }

/* ============================================================
   MAIN AREA
============================================================ */
.portal-main {
    margin-left: var(--portal-sidebar);
    display: flex; flex-direction: column;
    flex: 1; min-height: 100vh;
}

/* Topbar */
.portal-topbar {
    height: var(--portal-topbar);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center;
    flex-direction: column; justify-content: center;
    gap: 0;
    position: sticky; top: 0; z-index: 100;
}
.topbar-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 16px;
    padding: 4px; display: none;
    min-width: 32px; min-height: 32px;
    align-items: center; justify-content: center;
    transition: color 0.2s; flex-shrink: 0;
}
.topbar-toggle:hover { color: var(--navy); }
.topbar-search-wrap { position: relative; flex: 1; max-width: 420px; }
.topbar-search-wrap i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 13px; pointer-events: none;
    transition: color 0.2s;
}
.topbar-search {
    width: 100%; padding: 9px 16px 9px 38px;
    border: 1.5px solid transparent;
    border-radius: 24px;
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: var(--text-main); background: var(--off-white);
    outline: none; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.topbar-search:focus {
    border-color: var(--navy); background: var(--white);
    box-shadow: 0 0 0 3px rgba(10,121,187,0.08);
}
.topbar-search-wrap:focus-within i { color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cart-pill {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: none; border: none;
    color: var(--text-muted); font-size: 17px; cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative; flex-shrink: 0;
}
.cart-pill:hover { background: var(--off-white); color: var(--navy); transform: none; }
.cart-pill i { font-size: 17px; }
.cart-pill .cart-pill-label,
.cart-pill .cart-pill-sep { display: none; }
.cart-pill #topbarCartCount {
    position: absolute; top: 1px; right: 1px;
    min-width: 16px; height: 16px; border-radius: 10px;
    background: var(--green); color: #fff;
    font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; line-height: 1;
    font-family: 'Inter', sans-serif;
}
.topbar-icon-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 17px; cursor: pointer;
    transition: background 0.15s, color 0.15s; position: relative;
}
.topbar-icon-btn:hover { background: var(--off-white); color: var(--navy); }
.notif-dot {
    position: absolute; top: -3px; right: -3px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold); border: 2px solid var(--white);
}
.notif-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 16px; height: 16px; border-radius: 8px;
    background: var(--gold); border: 2px solid var(--white);
    font-size: 9px; font-weight: 800; color: var(--navy-deep);
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; line-height: 1;
}
.notif-panel {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 280px; background: var(--white);
    border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 8px 32px rgba(5,40,70,0.14);
    z-index: 500; overflow: hidden;
    display: flex; flex-direction: column;
    max-height: 320px;
}
.notif-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 700; color: var(--navy-deep);
    flex-shrink: 0;
}
.notif-panel-body {
    overflow-y: auto; flex: 1; scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    overscroll-behavior: contain;
}
.notif-panel-body::-webkit-scrollbar { width: 4px; }
.notif-panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.notif-mark-all {
    font-size: 10.5px; color: var(--navy); text-decoration: none; font-weight: 600;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-item {
    display: block; padding: 10px 14px; border-bottom: 1px solid var(--border);
    text-decoration: none; transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--off-white); }
.notif-item-unread { background: rgba(221,137,3,0.06); }
.notif-item-unread:hover { background: rgba(221,137,3,0.12); }
.notif-item-msg {
    font-size: 12px; color: var(--text-main); line-height: 1.45; margin-bottom: 2px;
}
.notif-item-ref {
    font-size: 10px; color: var(--text-muted); font-family: monospace;
}
.notif-empty-msg {
    padding: 24px 14px; font-size: 12px; color: var(--text-muted); text-align: center;
}

/* ============================================================
   INQUIRY CART DRAWER
============================================================ */
.cart-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(5,40,70,0.45); z-index: 300;
}
.cart-backdrop.open { display: block; }
.cart-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 340px; background: var(--white);
    box-shadow: -8px 0 40px rgba(5,40,70,0.15);
    display: flex; flex-direction: column; z-index: 301;
    transform: translateX(100%); transition: transform 0.3s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.cart-drawer-title {
    font-family:'Plus Jakarta Sans', sans-serif;
    font-size: 16px; color: var(--navy); font-weight: 700;
}
.cart-drawer-close {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--light-bg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted); font-size: 14px;
    transition: var(--transition);
}
.cart-drawer-close:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

.cart-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    color: var(--text-muted); padding: 32px;
}
.cart-empty i { font-size: 40px; opacity: 0.25; }
.cart-empty p { font-size: 13px; text-align: center; line-height: 1.6; }

.cart-items { flex: 1; overflow-y: auto; padding: 10px 15px; display: flex; flex-direction: column; gap: 10px; }
.cart-item {
    background: var(--off-white); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 8px;
}
.cart-item-top { display: flex; align-items: flex-start; gap: 10px; }
.cart-item-thumb {
    width: 100px; height: 85px; border-radius: var(--radius);
    background: var(--light-bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
    background-image: var(--thumb-url);
    background-size: cover;
    background-position: center;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-code { font-size: 9.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cart-item-name { font-size: 12.5px; font-weight: 700; color: var(--navy); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cart-remove-btn {
    background: none; border: none; color: var(--text-light);
    cursor: pointer; font-size: 13px; padding: 2px; flex-shrink: 0;
    transition: color 0.2s;
}
.cart-remove-btn:hover { color: var(--red); }
.cart-note-field {
    width: 100%; margin-top: 8px; padding: 7px 9px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: 'Inter',sans-serif; font-size: 11px;
    color: var(--text-main); background: var(--white);
    resize: none; outline: none; min-height: 20px;
}
.cart-note-field:focus { border-color: var(--navy); }
.cart-qty-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 9px;
}
.qty-control { display: flex; align-items: center; gap: 6px; }
.qty-btn {
    width: 22px; height: 22px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-muted); cursor: pointer; font-weight: 600;
    transition: var(--transition);
}
.qty-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.qty-val { font-size: 13px; font-weight: 700; color: var(--navy); min-width: 28px; text-align: center; }
.qty-unit { font-size: 10px; color: var(--text-muted); }
.cart-item-rate { font-size: 13px; font-weight: 700; color: var(--navy); }

.cart-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0; display: flex; flex-direction: column; gap: 10px;
    background: var(--white);
}
.cart-summary {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--text-muted);
}
.cart-preview-toggle {
    font-size: 11px; color: var(--navy-mid); font-weight: 600;
    cursor: pointer; text-align: center; padding: 2px 0;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.cart-preview-toggle:hover { color: var(--navy); }
.cart-preview-box {
    display: none; background: var(--navy-deep);
    border-radius: var(--radius); padding: 10px 12px;
    font-size: 10.5px; color: rgba(255,255,255,0.70);
    line-height: 1.65; max-height: 100px; overflow: auto;
    font-family: 'Inter', monospace; white-space: pre-line;
}
.cart-preview-box.open { display: block; }
.cart-wa-btn {
    width: 100%; padding: 12px; background: var(--green);
    border: none; border-radius: var(--radius); color: var(--white);
    font-family: 'Inter',sans-serif; font-size: 13px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition);
}
.cart-wa-btn:hover { background: var(--green-deep); transform: translateY(-1px); }
.cart-email-btn {
    width: 100%; padding: 11px; background: var(--off-white);
    border: 2px solid var(--border); border-radius: var(--radius);
    font-family: 'Inter',sans-serif; font-size: 13px; font-weight: 700;
    color: var(--navy); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition);
}
.cart-email-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.cart-clear-btn {
    width: 100%; padding: 7px; background: none;
    border: none; font-size: 11px; color: var(--text-muted);
    cursor: pointer; transition: color 0.2s; font-family: 'Inter',sans-serif;
}
.cart-clear-btn:hover { color: var(--red); }

/* ============================================================
   SHARED BUTTON STYLES
============================================================ */
.btn-primary {
    background: var(--gold); color: var(--white);
    padding: 9px 20px; border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px; font-weight: 600; letter-spacing: 0.1px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: none; cursor: pointer; text-decoration: none;
    transition: var(--transition); white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.4;
}
.btn-primary i, .btn-primary .fa, .btn-primary .fab { font-size: 11px; line-height: 1; flex-shrink: 0; }
.btn-primary:hover { background: #e09200; box-shadow: 0 4px 14px rgba(249,166,2,0.35); transform: translateY(-1px); color: var(--white); }

.btn-outline {
    background: transparent; color: var(--navy);
    padding: 10px 20px; border-radius: var(--radius);
    font-family: 'Inter',sans-serif;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    display: inline-flex; align-items: center; gap: 7px;
    border: 2px solid var(--navy); cursor: pointer; text-decoration: none;
    transition: var(--transition); white-space: nowrap;
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* ── Status pills ── */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.pill-green  { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.pill-amber  { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.pill-red    { background: var(--red-bg); color: var(--red); border: 1px solid #FECACA; }
.pill-blue   { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.pill-navy   { background: rgba(10,121,187,0.10); color: var(--navy); border: 1px solid rgba(10,121,187,0.20); }
.pill-grey   { background: var(--light-bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Sale / new badges ── */
.badge-sale { display: inline-block; background: var(--red); color: var(--white); border-radius: 3px; padding: 2px 6px; font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-new  { display: inline-block; background: var(--gold); color: var(--navy-deep); border-radius: 3px; padding: 2px 6px; font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   PAGE LAYOUT HELPERS
============================================================ */
.topbar-page-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px; font-weight: 700; color: var(--navy-deep);
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.portal-content { flex: 1; padding: 28px 20px 20px; min-width: 0; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb a { color: var(--navy-mid); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb i { font-size: 9px; }

/* Section label */
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-label::before { content: ''; width: 24px; height: 2px; background: var(--gold); }

/* Topbar rows */
.topbar-logo-link { display: none; }
.topbar-search-btn { display: none; }
.topbar-row-1 {
    display: flex; align-items: center; gap: 14px;
    flex: 1; width: 100%; padding: 0 24px; height: var(--portal-topbar);
}
.topbar-row-2 { display: none; }

/* ============================================================
   GO-TO-TOP BUTTON
============================================================ */
#gotoTopBtn {
    position: fixed;
    bottom: 28px;
    right: 22px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--navy);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,71,143,0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#gotoTopBtn.gtt-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
#gotoTopBtn:hover {
    background: var(--navy-deep);
    box-shadow: 0 6px 18px rgba(0,71,143,0.45);
}
#gotoTopBtn:active {
    transform: scale(0.93);
    transition: transform 0.1s;
}

/* ============================================================
   RESPONSIVE — TABLET & MOBILE
============================================================ */

/* ── Sidebar: off-canvas below 960px ── */
@media (max-width: 960px) {
    .portal-main    { margin-left: 0; }
    .portal-sidebar { transform: translateX(-100%); }
    .portal-sidebar.open { transform: translateX(0); }
    .sidebar-nav { -webkit-overflow-scrolling: touch; }

    .sidebar-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(5,40,70,0.50); z-index: 199;
        -webkit-tap-highlight-color: transparent;
    }
    .sidebar-overlay.open { display: block; }
	.portal-content { flex: 1; padding: 20px 18px 18px; min-width: 0; }
}

/* ── Tablet (769–960px): hamburger visible, full search bar ── */
@media (min-width: 769px) and (max-width: 960px) {
    .topbar-toggle { display: flex; }
    .cart-pill .cart-pill-label { display: none; }
    .cart-pill .cart-pill-sep   { display: none; }
    .cart-pill { padding: 8px 13px; border-radius: 50px; gap: 5px; }
}

/* ── Small phones: search to its own row ── */

/* ── Mobile bottom navigation bar ── */
.mobile-bottom-nav { display: none; }
@media (max-width: 960px) {
    .mobile-bottom-nav {
        display: flex; align-items: stretch;
        position: fixed; bottom: 0; left: 0; right: 0;
        height: 62px; z-index: 150;
        background: var(--white);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mob-nav-item {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 4px;
        font-size: 10px; font-weight: 500;
        color: var(--text-muted); text-decoration: none; cursor: pointer;
        border: none; background: none; font-family: 'Inter', sans-serif;
        transition: color 0.15s; position: relative; padding: 6px 2px 4px;
        -webkit-tap-highlight-color: transparent;
    }
    .mob-nav-item i {
        font-size: 19px; width: 44px; height: 28px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 14px; transition: background 0.18s, color 0.18s;
    }
    .mob-nav-item:hover { color: var(--navy); }
    .mob-nav-item.active { color: var(--navy); font-weight: 600; }
    .mob-nav-item.active i { background: rgba(10,121,187,0.10); }
    .mob-nav-cart { background: none; border-radius: 0; color: var(--text-muted); padding: 6px 2px 4px; max-width: none; }
    .mob-nav-cart i { font-size: 19px; }
    .mob-nav-cart:hover { background: none; color: var(--navy); }
    .mob-cart-badge {
        position: absolute; top: 4px; right: calc(50% - 22px);
        min-width: 15px; height: 15px; border-radius: 10px;
        background: var(--green); color: #fff;
        font-size: 8px; font-weight: 700;
        display: flex; align-items: center; justify-content: center;
        padding: 0 3px; border: 1.5px solid var(--white);
    }
    .portal-content { padding-bottom: calc(62px + env(safe-area-inset-bottom) + 16px); }
    .cart-drawer { bottom: calc(62px + env(safe-area-inset-bottom)); }
    .cart-backdrop { bottom: calc(62px + env(safe-area-inset-bottom)); }

    #gotoTopBtn {
        bottom: calc(90px + env(safe-area-inset-bottom) + 12px);
        right: 14px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* ── Cart drawer: mobile redesign ── */
@media (max-width: 600px) {
    .cart-drawer {
        width: min(340px, 86vw);
        top: 0; right: 0; bottom: 0;
        border-radius: 0;
        background: #F5F6F8;
        box-shadow: -12px 0 56px rgba(4,32,60,0.28);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.34s cubic-bezier(0.32,0,0.15,1),
                    visibility 0s linear 0.34s;
    }
    .cart-drawer.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.34s cubic-bezier(0.32,0,0.15,1),
                    visibility 0s linear 0s;
    }

    /* ── Header ── */
    .cart-drawer-header {
        background: var(--blue-700, #003568);
        padding: 0 14px 0 18px;
        height: 58px;
        border-bottom: none;
        flex-shrink: 0;
    }
    .cart-drawer-title {
        color: #fff;
        font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: -0.01em;
        gap: 8px;
    }
    .cart-drawer-close {
        width: 34px; height: 34px;
        background: rgba(255,255,255,0.10);
        border: 1px solid rgba(255,255,255,0.15);
        color: rgba(255,255,255,0.80);
        border-radius: 50%;
        font-size: 15px;
        transition: background 0.15s, color 0.15s;
    }
    .cart-drawer-close:hover {
        background: rgba(255,255,255,0.20);
        color: #fff;
    }

    /* ── Item list ── */
    .cart-items {
        padding: 12px 12px 8px;
        gap: 8px;
        background: #F5F6F8;
    }

    /* Each item as a clean white card */
    .cart-item {
        background: #ffffff;
        border: none;
        border-radius: 14px;
        padding: 11px 11px 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    }
    .cart-item-top {
        gap: 10px;
        align-items: flex-start;
    }
    .cart-item-thumb {
        width: 58px;
        height: 74px;
        border-radius: 10px;
        border: 1px solid rgba(0,0,0,0.06);
        flex-shrink: 0;
    }
    .cart-item-body {
        flex: 1;
        min-width: 0;
        padding-top: 1px;
    }
    .cart-item-code {
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1px;
        color: var(--text-light);
        text-transform: uppercase;
    }
    .cart-item-name {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--navy-deep);
        white-space: normal;
        line-height: 1.3;
        margin-top: 2px;
    }
    .cart-item-sub {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 3px;
        line-height: 1.4;
    }
    .cart-remove-btn {
        width: 28px; height: 28px;
        border-radius: 50%;
        background: #FEF2F2;
        color: #DC2626;
        display: flex; align-items: center; justify-content: center;
        font-size: 12px;
        flex-shrink: 0;
        transition: background 0.15s, color 0.15s;
    }
    .cart-remove-btn:hover { background: #DC2626; color: #fff; }

    /* ── Qty stepper ── */
    .cart-qty-row {
        margin-top: 10px;
        padding-top: 9px;
        border-top: 1px solid #F0F0F0;
    }
    .qty-btn {
        width: 32px; height: 32px;
        border-radius: 8px;
        font-size: 15px;
        background: #F5F6F8;
        border-color: #E8E9EC;
        color: var(--navy);
    }
    .qty-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
    .qty-val {
        font-size: 14px;
        font-weight: 700;
        min-width: 30px;
        color: var(--navy-deep);
    }

    /* ── Note field ── */
    .cart-note-field {
        margin-top: 9px;
        padding: 7px 10px;
        font-size: 12px;
        border: 1px solid #E8E9EC;
        border-radius: 8px;
        background: #FAFAFA;
        min-height: 28px;
        color: var(--text);
    }
    .cart-note-field:focus { border-color: var(--navy); background: #fff; }

    /* ── Footer ── */
    .cart-drawer-footer {
        background: #fff;
        border-top: 1px solid #EAEBED;
        padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
        gap: 8px;
        box-shadow: 0 -6px 20px rgba(0,0,0,0.07);
    }
    .cart-summary {
        font-size: 11px;
        color: var(--text-muted);
        padding: 0;
    }
    .cart-wa-btn {
        padding: 0 16px;
        height: 50px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.01em;
        gap: 8px;
    }
    .cart-email-btn {
        padding: 0 16px;
        height: 44px;
        border-radius: 12px;
        font-size: 13px;
        border-width: 1.5px;
    }
    .cart-preview-box {
        font-size: 10px;
        max-height: 72px;
        border-radius: 8px;
    }

    /* ── Empty state ── */
    .cart-empty {
        gap: 10px;
    }
    .cart-empty i {
        font-size: 44px;
        opacity: 0.15;
    }
    .cart-empty p {
        font-size: 13.5px;
        line-height: 1.65;
    }
}

/* ── Mobile search dropdown ── */
.mob-search-drop {
    display: none;
    position: fixed;
    top: var(--portal-topbar);
    left: 0; right: 0; z-index: 400;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    padding: 10px 16px;
    animation: mobSrchIn 0.18s ease;
}
.mob-search-drop.open { display: block; }
@keyframes mobSrchIn {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0); }
}
.mob-search-form {
    display: flex; align-items: center; gap: 10px;
    background: var(--off-white); border: 1.5px solid var(--border);
    border-radius: 12px; padding: 8px 14px;
}
.mob-search-form i { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.mob-search-form input {
    flex: 1; border: none; background: none; outline: none;
    font-size: 14px; color: var(--text-main);
    font-family: 'Inter', sans-serif;
}
.mob-search-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 15px; padding: 0;
    flex-shrink: 0; line-height: 1;
}

/* ── Clean mobile icon buttons ── */
.mob-icon-btn {
    background: none; border: none; cursor: pointer;
    color: var(--navy); font-size: 18px;
    width: 36px; height: 36px;
    display: none;
    align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.15s;
    flex-shrink: 0;
}
.mob-icon-btn:hover { background: var(--off-white); }

.portal-mobile-page-header { display: none; }
@media (max-width: 768px) {
    .portal-mobile-page-header { display: block; margin-bottom: 20px; }
    .topbar-page-title   { display: none !important; }
    .topbar-page-actions { display: none !important; }
}

/* ── Mobile topbar: logo + icon strip ── */
@media (max-width: 768px) {
    .topbar-toggle      { display: none !important; }
    .topbar-search-wrap { display: none !important; }
    .topbar-row-2       { display: none !important; }
    .topbar-logo-link   { display: flex; align-items: center; flex-shrink: 0; }
    .topbar-logo-img    { height: 55px; max-height: 55px; width: auto; max-width: 110px; display: block; object-fit: contain; }
    .topbar-search-btn  { display: flex !important; }
    .mob-icon-btn       { display: flex !important; }
    .topbar-icon-btn    { display: flex !important; background: none !important; border: none !important; color: var(--navy) !important; font-size: 18px !important; width: 36px; height: 36px; }
    .topbar-right       { margin-left: auto; gap: 2px; }
    .cart-pill          { background: none !important; border: none !important; box-shadow: none !important; color: var(--navy) !important; font-size: 18px; padding: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; gap: 0; }
    .cart-pill .cart-pill-label { display: none !important; }
    .cart-pill .cart-pill-sep   { display: none !important; }
    .cart-pill #topbarCartCount { font-size: 11px; font-weight: 700; position: absolute; top: 2px; right: 2px; background: var(--green); color: #fff; border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; line-height: 1; }
    .cart-pill { position: relative; }
}

/* ── Touch targets: minimum 44px ── */
@media (max-width: 960px) {
    .nav-link { font-size: 14px; min-height: 44px; display: flex; align-items: center; padding-top: 10px; padding-bottom: 10px; }
    .qty-btn { width: 32px; height: 32px; }
    .cart-drawer-close { width: 36px; height: 36px; }
    .topbar-toggle { min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }
}
