:root {
    --bg-dark: #0a0a0c;
    --card-bg: rgba(18, 18, 24, 0.7);
    --card-border: rgba(212, 175, 55, 0.12);
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-hover: #f3c63f;
    --amber: #f59e0b;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    --success: #10b981;
    --danger: #ef4444;
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 20%, rgba(212, 175, 55, 0.03) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(245, 158, 11, 0.03) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(124, 58, 237, 0.02) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f0f13;
}
::-webkit-scrollbar-thumb {
    background: var(--gold-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Header & Navigation */
header {
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 2rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span.logo-icon,
.logo span {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.logo-text-desktop {
    display: inline;
}

.logo-text-mobile {
    display: none;
}

.mobile-header-actions {
    display: none;
}

.nav-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

/* Main Tab Bar Styling */
.main-tab-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    flex-wrap: wrap;
}

.main-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.75rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
    font-family: var(--font-body);
}

.main-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.main-tab-btn.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 0.08) 100%);
    border-color: rgba(212, 175, 55, 0.45);
    color: var(--gold);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--gold-glow);
}

.btn-primary {
    background: var(--gold);
    color: var(--bg-dark);
    border: 1px solid var(--gold);
}

.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
}

.btn-danger {
    border-color: var(--danger);
    color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-success {
    border-color: var(--success);
    color: var(--success);
}
.btn-success:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* User Profile Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--input-border);
    font-size: 0.85rem;
}

.user-badge .role-tag {
    background: var(--gold-glow);
    color: var(--gold);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Hero Section */
.hero {
    position: relative;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
    text-align: center;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Glassmorphic Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title span {
    color: var(--gold);
    font-size: 0.9rem;
}

/* Product Catalog Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(212, 175, 55, 0.05);
}

/* Skeleton Shimmer Loading Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 380px;
}

.skeleton-box {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.product-image-wrap {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrap:hover {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.product-image {
    width: 100%;
    height: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    padding: 0.5rem;
    display: block;
    transition: transform 0.3s ease;
}

.product-image-wrap:hover .product-image {
    transform: scale(1.05);
}

.product-image-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 18, 26, 0.85);
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    opacity: 0.85;
    transition: all 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.product-image-wrap:hover .product-image-badge {
    opacity: 1;
    background: var(--gold);
    color: #12121a;
    font-weight: 700;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.product-spec {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.min-qty-tag {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.product-desc {
    font-size: 0.75rem;
    color: #9097a5;
    margin-bottom: 0.75rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-box {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.msrp-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.guest-msrp-only {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.b2b-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-tag-custom {
    background: #7c3aed;
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 700;
}

.price-tag-wholesale {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold);
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 700;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.qty-input {
    width: 60px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 0.4rem;
    border-radius: 4px;
    text-align: center;
}

.qty-input:focus {
    outline: none;
    border-color: var(--gold);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Cart & Sidebar */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.cart-item-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-total-box {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gold-border);
}

.cart-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cart-row.grand-total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: 0.75rem;
}

.alert-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

/* Points Milestones Progress */
.points-widget {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.points-val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    font-family: var(--font-heading);
}

.milestone-container {
    margin-top: 1rem;
}

.milestone-bar-bg {
    background: rgba(255, 255, 255, 0.08);
    height: 10px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.milestone-bar-fill {
    background: linear-gradient(90deg, var(--gold), var(--amber));
    height: 100%;
    width: 0%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.milestone-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Modal Popup Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top to allow natural scrolling of tall content */
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    overflow-y: auto; /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth iOS / LINE browser touch scrolling */
    padding: 2rem 1rem 4rem; /* Generous bottom padding so footer is never cut off */
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #121218;
    border: 1px solid var(--gold-border);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8);
    margin: auto; /* Auto margin ensures vertical centering when short, and top alignment when tall */
}

.modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    z-index: 10;
}

.modal-close:hover {
    color: var(--gold);
}

/* Tabs UI */
.tab-headers {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 0;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.tab-pane,
.client-tab-pane,
.admin-tab-pane {
    display: none;
    scroll-margin-top: 90px;
}

.tab-pane.active,
.client-tab-pane.active,
.admin-tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tables Styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: left;
}

th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-shipping {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* LINE Simulator Styles */
.line-simulator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

@media (max-width: 900px) {
    .line-simulator-grid {
        grid-template-columns: 1fr;
    }
}

.line-phone-wrapper {
    background: #0f1013;
    border: 12px solid #2d2e35;
    border-radius: 40px;
    height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}

.line-phone-header {
    background: #2b303b;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.line-phone-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.line-phone-body {
    flex: 1;
    background: #8b9bb4; /* Typical LINE chat background color */
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.line-msg-bubble {
    background: #ffffff;
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.85rem;
    word-break: break-all;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    align-self: flex-start;
    position: relative;
}

.line-msg-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 10px;
    border-width: 6px 8px 6px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

.line-msg-bubble.admin-side {
    background: #85e285;
    align-self: flex-end;
}

.line-msg-bubble.admin-side::before {
    left: auto;
    right: -8px;
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent #85e285;
}

.line-msg-meta {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.25rem;
    display: block;
    text-align: right;
}

.line-phone-footer {
    background: #f4f5f7;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid #d8d8d8;
}

.line-input {
    flex: 1;
    border: 1px solid #cccccc;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    outline: none;
}

.line-send-btn {
    background: #06c755; /* LINE Green */
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Custom Price Matrix Dedicated Grid & Freeze-Panes Styling */
.matrix-scroll-container {
    overflow-x: auto !important;
    overflow-y: auto !important;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(0, 0, 0, 0.5);
    background: #0d0d12;
}

.matrix-scroll-container::-webkit-scrollbar {
    height: 14px !important;
    width: 10px !important;
}

.matrix-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 7px;
}

.matrix-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #967520, var(--gold)) !important;
    border-radius: 7px;
    border: 2px solid #14141e;
    cursor: grab;
}

.matrix-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--gold-hover) !important;
}

.matrix-table {
    border-collapse: separate !important;
    border-spacing: 0;
    min-width: 100%;
    margin-top: 0 !important;
    table-layout: fixed;
}

/* Sticky Header (Freeze Row 1) */
.matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #191924 !important;
    border-bottom: 2px solid var(--gold-border) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    width: 155px;
    min-width: 155px;
    max-width: 155px;
    font-size: 0.78rem !important;
    line-height: 1.35;
    padding: 0.75rem 0.5rem !important;
    vertical-align: top;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sticky First Column (Freeze Column 1 - Store Name & Tax ID) */
.matrix-table thead th:first-child {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 30;
    background: #202030 !important;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    border-right: 2px solid var(--gold) !important;
    text-align: left;
    padding-left: 0.85rem !important;
}

.matrix-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #14141e !important;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    border-right: 2px solid var(--gold) !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.6);
    text-align: left;
    padding-left: 0.85rem !important;
}

.matrix-table tbody tr:hover td:first-child {
    background: #1b1b28 !important;
}

/* Product columns and inputs */
.matrix-table tbody td {
    text-align: center;
    padding: 0.6rem 0.4rem;
    width: 155px;
    min-width: 155px;
    max-width: 155px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.matrix-input {
    width: 100px !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--gold);
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.35rem 0.3rem;
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s ease;
}

.matrix-input.has-custom-price {
    background: rgba(124, 58, 237, 0.25) !important;
    border-color: #8b5cf6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.matrix-input:focus {
    outline: none;
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
}

.matrix-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-weight: normal;
    font-style: italic;
}

/* =========================================================
   Mobile Responsive Styles (2-Column Products Grid)
   ========================================================= */
@media (max-width: 768px) {
    .container {
        padding: 0 0.65rem;
        margin-bottom: 2rem;
    }

    .glass-card {
        padding: 1.1rem 0.75rem;
        border-radius: 10px;
        margin-bottom: 1.25rem;
    }

    .card-title {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }

    /* 2 Columns on Mobile */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    .product-card {
        padding: 0.65rem;
        border-radius: 8px;
    }

    .product-image-wrap {
        margin-bottom: 0.5rem;
        border-radius: 6px;
    }

    .product-image {
        height: 135px;
        padding: 0.25rem;
    }

    .product-image-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
        bottom: 4px;
    }

    .product-name {
        font-size: 0.85rem;
        line-height: 1.3;
        min-height: 2.4em;
        margin-bottom: 0.35rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-meta {
        font-size: 0.68rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        margin-bottom: 0.35rem;
    }

    .product-spec {
        font-size: 0.68rem;
    }

    .min-qty-tag {
        font-size: 0.62rem;
        padding: 0.05rem 0.3rem;
    }

    .product-desc {
        display: none; /* Hidden on compact 2-column mobile cards; accessible via detail modal */
    }

    .price-box {
        margin-bottom: 0.5rem;
    }

    .b2b-price {
        font-size: 1.05rem;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .guest-msrp-only {
        font-size: 0.95rem;
    }

    .price-tag-custom,
    .price-tag-wholesale {
        font-size: 0.62rem;
        padding: 0.1rem 0.35rem;
    }

    .card-action {
        display: flex;
        gap: 0.35rem;
        align-items: center;
    }

    .card-action .qty-input {
        width: 40px !important;
        padding: 0.35rem 0.1rem !important;
        font-size: 0.85rem !important;
        text-align: center;
    }

    .card-action .btn {
        padding: 0.4rem 0.35rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
        justify-content: center;
    }

    .main-tab-bar {
        gap: 0.4rem;
        padding: 0.35rem;
    }

    .main-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
        flex: 1;
        justify-content: center;
    }

    .nav-container {
        padding: 0.6rem 1rem;
        flex-direction: row; /* Horizontal compact top bar */
        align-items: center;
        justify-content: space-between;
        min-height: 54px;
        position: relative;
    }

    .logo {
        font-size: 1.05rem;
        gap: 0.35rem;
        flex-shrink: 1;
        overflow: hidden;
    }

    .logo-text-desktop {
        display: none;
    }

    .logo-text-mobile {
        display: inline;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-primary);
        white-space: nowrap;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .btn-mobile-line-quick {
        background: #06c755;
        color: #ffffff !important;
        font-size: 0.8rem;
        font-weight: 700;
        padding: 0.38rem 0.7rem;
        border-radius: 6px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        border: none;
        box-shadow: 0 2px 8px rgba(6, 199, 85, 0.35);
        white-space: nowrap;
        cursor: pointer;
    }

    .mobile-user-pill {
        background: rgba(212, 175, 55, 0.1);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 6px;
        padding: 0.3rem 0.55rem;
        font-size: 0.75rem;
        color: var(--text-primary);
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(212, 175, 55, 0.35);
        border-radius: 6px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4.5px;
        cursor: pointer;
        padding: 0;
        transition: all 0.25s ease;
    }

    .mobile-menu-toggle:active,
    .mobile-menu-toggle.active {
        background: rgba(212, 175, 55, 0.15);
        border-color: var(--gold);
    }

    .hamburger-line {
        width: 18px;
        height: 2px;
        background: var(--gold);
        border-radius: 2px;
        transition: all 0.25s ease;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    /* Mobile Collapsible Dropdown Drawer */
    .nav-menu-wrapper {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(13, 13, 17, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(212, 175, 55, 0.3);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
        padding: 1.25rem 1rem 1.75rem;
        flex-direction: column;
        gap: 1rem;
        box-sizing: border-box;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1000;
    }

    .nav-menu-wrapper.open {
        display: flex !important;
        animation: mobileNavFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes mobileNavFade {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Auth Buttons inside Mobile Drawer */
    #auth-header-section {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    #auth-header-section .btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem !important;
        font-size: 0.92rem !important;
        margin: 0 !important;
    }

    #auth-header-section .user-badge {
        margin: 0 0 0.5rem 0 !important;
        width: 100%;
        justify-content: space-between;
        padding: 0.65rem 0.85rem;
    }

    /* Nav Links inside Mobile Drawer */
    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.45rem;
        padding: 0;
        margin: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.92rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.06);
        box-sizing: border-box;
        transition: all 0.2s ease;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(212, 175, 55, 0.12);
        border-color: rgba(212, 175, 55, 0.35);
        color: var(--gold);
    }

    .hero {
        padding: 2.5rem 1rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    /* Mobile Modal & Form Adjustments */
    .modal-overlay {
        padding: 1rem 0.5rem 6rem !important;
        align-items: flex-start !important;
    }

    .modal-content {
        width: 95% !important;
        max-width: 480px !important;
        padding: 1.25rem 1rem 2.5rem !important;
        border-radius: 10px !important;
        margin: 0.5rem auto 2rem !important;
    }

    .modal-close {
        top: 0.4rem !important;
        right: 0.4rem !important;
        font-size: 1.5rem !important;
        padding: 0.35rem 0.6rem !important;
    }

    .form-group {
        margin-bottom: 0.85rem !important;
    }

    .form-group label {
        font-size: 0.8rem !important;
        margin-bottom: 0.3rem !important;
    }

    .form-control {
        font-size: 16px !important; /* Prevents auto-zoom on mobile keyboards (iOS Safari / LINE) */
        padding: 0.65rem 0.75rem !important;
    }
}
