/* PHL 2026 - Modern CSS Styling */

:root {
    /* Light mode (default) */
    --bg-dark: #f0f4ff;
    --bg-darker: #e2e8f8;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-hover: rgba(255, 255, 255, 0.97);
    --accent-blue: #3b82f6;
    --accent-blue-dark: #1e40af;
    --accent-orange: #f97316;
    --accent-purple: #8b5cf6;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.22);
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    /* theme-sensitive */
    --navbar-bg: rgba(255, 255, 255, 0.88);
    --input-bg: #ffffff;
    --input-bg-focus: #f4f7ff;
    --select-option-bg: #ffffff;
    --table-row-alt: rgba(0, 0, 0, 0.03);
    /* aliases used in hover states */
    --primary: #3b82f6;
    --primary-color: #3b82f6;
}

.dark-mode {
    --bg-dark: #0a0e1a;
    --bg-darker: #06080f;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    --navbar-bg: rgba(10, 14, 26, 0.85);
    --input-bg: #141829;
    --input-bg-focus: #1a2035;
    --select-option-bg: #141829;
    --table-row-alt: rgba(255, 255, 255, 0.03);
}

.salmon-mode {
    --bg-dark: #fdf5f1;
    --bg-darker: #f5e6df;
    --bg-card: rgba(255, 140, 130, 0.12);
    --bg-card-hover: rgba(255, 140, 130, 0.18);
    --accent-blue: #ff6b54;
    --accent-blue-dark: #d9513a;
    --accent-orange: #ff8c82;
    --accent-purple: #ff9999;
    --text-primary: #000000;
    --text-secondary: #000000;
    --border: rgba(255, 107, 84, 0.15);
    --border-hover: rgba(255, 107, 84, 0.25);
    --shadow: 0 20px 25px -5px rgba(255, 107, 84, 0.15);
    --navbar-bg: rgba(255, 245, 240, 0.92);
    --input-bg: #fff9f7;
    --input-bg-focus: #ffe8e0;
    --select-option-bg: #fff9f7;
    --table-row-alt: rgba(255, 107, 84, 0.05);
}

.retro-mode {
    --bg-dark: #ffffff;
    --bg-darker: #ffffff;
    --bg-card: rgba(255, 255, 255, 1);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --accent-blue: #347fd3;
    --accent-blue-dark: #2a5fa8;
    --accent-orange: #83cc3f;
    --accent-purple: #83cc3f;
    --text-primary: #000000;
    --text-secondary: #000000;
    --border: rgba(0, 0, 0, 0.2);
    --border-hover: rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --navbar-bg: #347fd3;
    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;
    --select-option-bg: #ffffff;
    --table-row-alt: rgba(0, 0, 0, 0.02);
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

html {
    scroll-padding-top: 100px;
}

/* ============================================================================
   HEADER / NAVBAR
   ============================================================================ */

.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    sticky: top;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.navbar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-user {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-blue);
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.view-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-icon {
    font-size: 1.5rem;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ============================================================================
   MAIN CONTAINER
   ============================================================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ============================================================================
   SEARCH WRAPPER
   ============================================================================ */

.search-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.search-card-full {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

.login-section {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.login-card-centered {
    width: 100%;
    max-width: 420px;
}

.brand-link {
    text-decoration: none;
    color: inherit;
}

.brand-link:hover {
    opacity: 0.85;
}

.login-card,
.search-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.login-card:hover,
.search-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.login-card h3,
.search-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input,
select {
    width: 100%;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

select option {
    background-color: var(--select-option-bg);
    color: var(--text-primary);
}

.form-input:focus,
select:focus {
    outline: none;
    background: var(--input-bg-focus);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.zip-input-group {
    display: flex;
    gap: 0.5rem;
}

.zip-input-group .form-input {
    flex: 1;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-add-cart {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-blue));
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.btn-secondary {
    color: var(--text-primary);
}

/* ============================================================================
   LOGIN FORM
   ============================================================================ */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================================================
   SEARCH FORM
   ============================================================================ */

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
    color: var(--text-primary);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
    color: var(--text-primary);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-left-color: #fbbf24;
    color: var(--text-primary);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: var(--text-primary);
}

/* ============================================================================
   RESULTS
   ============================================================================ */

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    overflow: visible;
}

.results-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.results-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================================================
   SEARCH RESULTS TABLE
   ============================================================================ */

.results-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    position: sticky;
    top: -calc(60px + 2rem);
    z-index: 100;
}

.results-table thead th {
    background: var(--bg-card);
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.results-table tbody tr:hover {
    background: var(--table-row-alt);
}

.results-table tbody td {
    padding: 0.9rem 0.75rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

.rt-img-header {
    width: 80px;
}

.rt-img {
    width: 80px;
    padding: 0.75rem !important;
}

.rt-img img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.rt-img img:hover {
    opacity: 0.8;
}

.rt-img-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--table-row-alt);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.5rem;
}

.rt-vehicle {
    flex: 1;
}

.rt-vehicle-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.rt-part-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.rt-mobile-info {
    display: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.rt-mobile-info span {
    margin-right: 0.75rem;
}

.rt-mobile-info .rt-grade-mobile {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.rt-miles {
    min-width: 80px;
}

.rt-grade {
    min-width: 100px;
}

.rt-color {
    min-width: 90px;
}

.rt-price {
    min-width: 110px;
}

.rt-yard {
    min-width: 140px;
}

.rt-yard > div:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.rt-location {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.rt-phone {
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.rt-phone a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rt-phone a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.rt-stock {
    min-width: 90px;
}

.rt-action {
    white-space: nowrap;
    padding: 0.75rem !important;
}

.rt-action-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: row;
}

.price-badge-mobile {
    display: none;
}

@media (max-width: 768px) {
    .rt-action-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .price-badge-mobile {
        display: inline-block;
        text-align: center;
        width: 100%;
    }

    .rt-action-content form {
        display: flex;
        justify-content: center;
    }

    .rt-action-content .btn {
        width: 100%;
    }
}

.grade-badge-inline {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.price-badge {
    background: linear-gradient(135deg, var(--accent-orange), #f97316);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    display: inline-block;
}

.btn-add-cart {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.loading-more {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .rt-mobile-info {
        display: block;
    }

    .results-table thead th {
        top: 0;
    }

    .results-table thead th:last-child {
        display: none;
    }

    .results-table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .results-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .rt-vehicle-name {
        font-size: 0.75rem;
    }

    .rt-part-name {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .rt-mobile-info {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }

    .rt-mobile-info span {
        margin-right: 0.5rem;
    }

    .price-badge {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }

    .btn-add-cart {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

.hide-desktop {
    display: none;
}

@media (max-width: 768px) {
    .hide-desktop {
        display: block;
    }
}

/* ============================================================================
   VIEW TOGGLE VISIBILITY
   ============================================================================ */

/* Default: show table, hide cards */
.view-table-container {
    display: block;
}

.view-cards-container {
    display: none;
}

/* When card-view is active: hide table, show cards */
.card-view .view-table-container {
    display: none;
}

.card-view .view-cards-container {
    display: block;
}

/* ============================================================================
   SEARCH RESULTS CARD LAYOUT
   ============================================================================ */

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

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

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.result-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--table-row-alt);
    flex-shrink: 0;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.grade-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent-blue);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.result-content {
    padding: 1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.result-vehicle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-part-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-comments {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.result-yard {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 0.5rem;
}

.result-phone {
    font-size: 0.85rem;
}

.result-phone a {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.result-phone a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.result-stock {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
}

/* ============================================================================
   CART
   ============================================================================ */

.cart-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.cart-container h2 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.cart-items {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-table th {
    background: var(--bg-card);
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.cart-table tr:hover {
    background: var(--table-row-alt);
}

@media (max-width: 480px) {
    .cart-table {
        display: block;
        border: none;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody {
        display: block;
    }

    .cart-table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1rem;
        margin-bottom: 1rem;
        background: var(--bg-card);
    }

    .cart-table tr:hover {
        background: var(--table-row-alt);
    }

    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border);
    }

    .cart-table td:last-child {
        border-bottom: none;
    }

    .cart-table td:nth-child(1):before { content: "Part: "; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
    .cart-table td:nth-child(2):before { content: "Yard: "; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
    .cart-table td:nth-child(3):before { content: "Price: "; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
    .cart-table td:nth-child(4):before { content: "Qty: "; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
    .cart-table td:nth-child(5):before { content: "Subtotal: "; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
    .cart-table td:nth-child(6):before { content: "Action: "; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

@media (max-width: 768px) {
    .cart-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
}

.total-amount {
    color: var(--accent-orange);
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-actions {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .cart-actions {
        flex-direction: column;
    }
}

/* ============================================================================
   CHECKOUT
   ============================================================================ */

.checkout-container {
    max-width: 600px;
    margin: 0 auto;
}

.checkout-confirmation {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.checkout-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.checkout-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.checkout-items {
    background: var(--table-row-alt);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1rem;
    color: var(--accent-orange);
}

.checkout-notice {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ============================================================================
   ORDERS
   ============================================================================ */

.orders-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.orders-container h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.orders-table,
.order-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.order-detail-table th {
    background: var(--bg-card);
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.sortable-header {
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable-header:hover {
    background-color: var(--bg-card-hover);
}

.orders-table td,
.order-detail-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.orders-table tr:hover,
.order-detail-table tr:hover {
    background: var(--table-row-alt);
}

/* ============================================================================
   STATUS BADGES
   ============================================================================ */

.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending,
.status-pending-cancellation,
.status-payment-incomplete {
    background: rgba(249, 115, 22, 0.15);
    color: #9a3412;
}

.status-accepted,
.status-ready-for-pickup,
.status-order-shipped,
.status-order-picked-up,
.status-order-delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.status-declined,
.status-order-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
}

.status-request-for-credit {
    background: rgba(59, 130, 246, 0.15);
    color: #1e40af;
}

/* Dark mode: flip to light text on semi-transparent coloured backgrounds */
.dark-mode .status-pending,
.dark-mode .status-pending-cancellation,
.dark-mode .status-payment-incomplete {
    color: #ffedd5;
}

.dark-mode .status-accepted,
.dark-mode .status-ready-for-pickup,
.dark-mode .status-order-shipped,
.dark-mode .status-order-picked-up,
.dark-mode .status-order-delivered {
    color: #dcfce7;
}

.dark-mode .status-declined,
.dark-mode .status-order-cancelled {
    color: #fee2e2;
}

.dark-mode .status-request-for-credit {
    color: #dbeafe;
}

/* ============================================================================
   ORDER DETAIL
   ============================================================================ */

.order-detail-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.order-detail-container h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.order-detail-table {
    margin-bottom: 2rem;
}

.order-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.order-detail-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-hover);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .navbar-container {
        flex-direction: column;
        padding: 1rem;
    }

    .navbar-nav {
        width: 100%;
        justify-content: space-around;
    }

    .login-card,
    .search-card {
        padding: 1.5rem;
    }

    .cart-table,
    .orders-table,
    .order-detail-table {
        font-size: 0.9rem;
    }

    .cart-table th,
    .orders-table th,
    .order-detail-table th,
    .cart-table td,
    .orders-table td,
    .order-detail-table td {
        padding: 0.75rem;
    }
}

/* ============================================================================
 * IMAGE GALLERY MODAL
 * ============================================================================ */

.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.gallery-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.gallery-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.gallery-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 500px;
    margin-bottom: 20px;
}

.gallery-main {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.gallery-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    max-height: 120px;
}

.gallery-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gallery-thumbnail:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.3);
}

.gallery-thumbnail.active {
    opacity: 1;
    border-color: var(--accent-blue);
}

@media (max-width: 768px) {
    .gallery-container {
        height: 300px;
        gap: 10px;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .gallery-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .gallery-modal-content {
        max-height: 95vh;
    }

    .gallery-thumbnail {
        width: 80px;
        height: 80px;
    }
}

/* ============================================================================
   ROLLCALL PAGE
   ============================================================================ */

.rollcall-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1400px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.rollcall-container h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.75rem;
}

.rollcall-filters {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group .form-input {
    font-size: 0.9rem;
    padding: 0.65rem 0.75rem;
}

.rollcall-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rollcall-actions .btn {
    font-size: 0.95rem;
}

.rc-add-form {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

.rc-add-form h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.rc-add-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.rc-add-form .form-group.full-width {
    grid-column: 1 / -1;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.form-actions button {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
}

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

.rollcall-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.rollcall-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rollcall-table thead {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.rollcall-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rollcall-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

.rollcall-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.rollcall-table tbody tr:nth-child(even) {
    background: var(--table-row-alt);
}

.rollcall-table td {
    padding: 0.75rem 0.75rem;
    text-align: left;
    color: var(--text-primary);
}

.rc-status-select {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rc-status-select:hover {
    border-color: var(--border-hover);
    background: var(--input-bg-focus);
}

.rc-status-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rc-totals-row {
    background: rgba(255, 255, 255, 0.05);
    border-top: 2px solid var(--border-hover);
    font-weight: 600;
}

.rc-totals-row td {
    padding: 1rem 0.75rem;
    color: var(--accent-blue);
}

/* ============================================================================
   NEWSEARCH — Google-style typeahead search page
   ============================================================================ */

.newsearch-hero {
    text-align: center;
    padding: 3rem 1rem 1.5rem;
}

.newsearch-hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.newsearch-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.newsearch-wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 0.5rem 1rem 3rem;
}

.newsearch-bar-wrap {
    position: relative;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s, border-radius 0.2s;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.newsearch-bar-wrap:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), 0 4px 24px rgba(0,0,0,0.25);
}

.newsearch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.newsearch-chips:empty {
    display: none;
}

.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.7rem 0.22rem 0.8rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
}

.search-chip--blue {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.search-chip--orange {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.search-chip--purple {
    background: rgba(139, 92, 246, 0.12);
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.dark-mode .search-chip--blue {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.dark-mode .search-chip--orange {
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
}

.dark-mode .search-chip--purple {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
}

.salmon-mode .search-chip--blue {
    background: rgba(59, 130, 246, 0.2);
    color: #003d99;
}

.salmon-mode .search-chip--orange {
    background: rgba(249, 115, 22, 0.2);
    color: #7d2a0f;
}

.salmon-mode .search-chip--purple {
    background: rgba(139, 92, 246, 0.2);
    color: #3d1a7d;
}

.chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    padding: 0;
}

.chip-remove:hover { opacity: 1; }

.newsearch-input-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.newsearch-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    padding: 0.35rem 0;
    min-width: 0;
}

.newsearch-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.75;
}

.newsearch-camera-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.35rem;
    color: var(--text-secondary);
    padding: 0.3rem;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.newsearch-camera-btn:hover {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.newsearch-submit {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 0.55rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.newsearch-submit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.newsearch-submit:not(:disabled):hover {
    background: var(--accent-blue-dark);
}

/* Suggestions dropdown */
.newsearch-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--input-bg);
    border: 1px solid var(--border-hover);
    border-radius: 18px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.45);
    z-index: 1100;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

.suggestion-group {
    padding: 0.4rem 0;
}

.suggestion-group + .suggestion-group {
    border-top: 1px solid var(--border);
}

.suggestion-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    padding: 0.45rem 1.1rem 0.2rem;
}

.suggestion-item {
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: background 0.13s;
}

.suggestion-item:hover {
    background: var(--bg-card-hover);
}

.suggestion-item mark {
    background: transparent;
    color: var(--accent-blue);
    font-weight: 600;
}

.newsearch-zip-status {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.newsearch-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

/* ============================================================================
   VIN SCANNER MODAL
   ============================================================================ */

.vin-scanner-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.vin-scanner-content {
    background: var(--input-bg);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

.vin-scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.vin-scanner-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.vin-scanner-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.vin-scanner-close:hover { color: var(--text-primary); }

.camera-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

#vinCameraStream {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vin-overlay-rect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 82%;
    height: 40%;
    border: 2px solid rgba(59, 130, 246, 0.9);
    border-radius: 6px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

/* Corner accent marks */
.vin-overlay-rect::before,
.vin-overlay-rect::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: #60a5fa;
    border-style: solid;
}

.vin-overlay-rect::before {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
}

.vin-overlay-rect::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
}

.vin-scanner-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.vin-capture-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.vin-detected-indicator {
    text-align: center;
    color: #15803d;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: var(--radius);
}

.dark-mode .vin-detected-indicator {
    color: #4ade80;
}

#cameraError {
    text-align: center;
    color: #991b1b;
    padding: 1rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.dark-mode #cameraError {
    color: #f87171;
}

.vin-manual-entry {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.vin-manual-entry label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.vin-input-row {
    display: flex;
    gap: 0.6rem;
}

.vin-text-input {
    flex: 1;
    background: var(--input-bg-focus);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    min-width: 0;
    transition: border-color 0.2s;
}

.vin-text-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.sug-sub {
    font-size: 0.82em;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Interchange auto-suggest panel */
.interchange-panel {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ic-panel-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ic-panel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ic-chip {
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 20px;
    padding: 0.28rem 0.8rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ic-chip:hover {
    background: rgba(139, 92, 246, 0.22);
    color: #5b21b6;
}

.dark-mode .ic-chip {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.dark-mode .ic-chip:hover {
    background: rgba(139, 92, 246, 0.28);
    color: #ddd6fe;
}

.salmon-mode .ic-chip {
    background: rgba(139, 92, 246, 0.2);
    color: #3d1a7d;
}

.salmon-mode .ic-chip:hover {
    background: rgba(139, 92, 246, 0.35);
    color: #2a0d5c;
}

/* ============================================================================
   RETRO MODE SPECIFIC OVERRIDES
   ============================================================================ */

.retro-mode .navbar-brand h1 {
    background: none;
    -webkit-text-fill-color: white;
    color: white;
}

.retro-mode .navbar-user {
    color: white;
}

.retro-mode .nav-link {
    color: white;
}

.retro-mode .nav-link:hover {
    color: #e0e0e0;
}

.retro-mode .newsearch-hero h2 {
    background: none;
    -webkit-text-fill-color: red;
    color: red;
}

.retro-mode .newsearch-bar-wrap:focus-within {
    border-color: #347fd3;
    box-shadow: 0 0 0 3px rgba(52, 127, 211, 0.18), 0 4px 24px rgba(0,0,0,0.25);
}

.retro-mode .newsearch-submit {
    background: #83cc3f;
}

.retro-mode .newsearch-submit:not(:disabled):hover {
    background: #6ba83a;
}

/* ============================================================================
   INTERCHANGE NOTES TOOLTIP
   ============================================================================ */

.notes-icon-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: baseline;
}

.notes-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background-color: var(--accent-blue);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    margin: 0 4px;
    user-select: none;
    transition: background-color 0.2s ease;
}

.notes-icon:hover {
    background-color: var(--accent-blue-dark);
}

.notes-tooltip {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background-color: var(--bg-dark);
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    max-width: 350px;
    width: max-content;
    white-space: pre-wrap;
    word-wrap: break-word;
    pointer-events: auto;
    block-size: fit-content;
}

.dark-mode .notes-tooltip {
    background-color: #1a2035;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.notes-icon-wrapper.active .notes-tooltip {
    display: block !important;
}

.notes-tooltip-content {
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.4;
    cursor: text;
    user-select: text;
}

@media (max-width: 600px) {
    .newsearch-hero h2 { font-size: 1.8rem; }
    .newsearch-submit { padding: 0.5rem 1rem; font-size: 0.88rem; }
    .newsearch-input  { font-size: 1rem; }
    .vin-input-row    { flex-direction: column; }
}
