/* Extracted from demo.html */

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

        :root {
            --bg: #0a0a0f;
            --bg2: #12121a;
            --card: #1a1a24;
            --hover: #252532;
            --border: #2a2a3a;
            --accent: #ff6b35;
            --accent-glow: rgba(255, 107, 53, 0.25);
            --text: #ffffff;
            --text2: #a0a0b0;
            --success: #22c55e;
            --info: #3b82f6;
        }

        body {
            font-family: 'DM Sans', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }

        /* --- Header --- */
        .header {
            position: fixed;
            top: 0; left: 0; right: 0;
            z-index: 100;
            background: rgba(18, 18, 26, 0.92);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border-bottom: 1px solid var(--border);
            padding: 0.7rem 2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 0.7rem;
        }

        .logo-mark {
            width: 40px; height: 40px;
            background: linear-gradient(135deg, var(--accent), #ff4500);
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.3rem;
            box-shadow: 0 3px 16px var(--accent-glow);
        }

        .logo-text {
            font-family: 'Outfit', sans-serif;
            font-weight: 800;
            font-size: 1.3rem;
            background: linear-gradient(135deg, #fff, var(--accent));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .logo-sub {
            font-size: 0.6rem;
            color: var(--text2);
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .header-search {
            position: relative;
            width: 340px;
        }

        .header-search input {
            width: 100%;
            padding: 0.5rem 0.8rem 0.5rem 2.2rem;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 10px;
            color: var(--text);
            font-family: 'DM Sans', sans-serif;
            font-size: 0.85rem;
            outline: none;
            transition: border-color 0.2s;
        }

        .header-search input:focus { border-color: var(--accent); }
        .header-search input::placeholder { color: var(--text2); }

        .header-search svg {
            position: absolute;
            left: 0.7rem; top: 50%;
            transform: translateY(-50%);
            width: 16px; height: 16px;
            color: var(--text2);
            pointer-events: none;
        }

        .search-drop {
            position: absolute;
            top: calc(100% + 4px);
            left: 0; right: 0;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 10px;
            max-height: 320px;
            overflow-y: auto;
            box-shadow: 0 12px 40px rgba(0,0,0,0.5);
            display: none;
            z-index: 200;
        }

        .search-drop.open { display: block; }

        .search-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.55rem 0.8rem;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: background 0.15s;
        }

        .search-item:last-child { border-bottom: none; }
        .search-item:hover { background: var(--hover); }

        .search-item .si-oem {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--accent);
        }

        .search-item .si-name {
            font-size: 0.8rem;
            color: var(--text2);
            margin-left: 0.5rem;
        }

        .search-item .si-cat {
            font-size: 0.7rem;
            color: var(--text2);
        }

        .badge-demo {
            font-size: 0.65rem;
            font-weight: 700;
            background: var(--accent);
            color: #fff;
            padding: 0.2rem 0.6rem;
            border-radius: 5px;
            letter-spacing: 0.08em;
        }

        /* --- Main --- */
        .main {
            max-width: 1200px;
            margin: 0 auto;
            padding: 4.5rem 1.5rem 2rem;
        }

        /* --- Breadcrumb --- */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            margin-bottom: 1rem;
            font-size: 0.8rem;
            flex-wrap: wrap;
        }

        .breadcrumb span {
            color: var(--text2);
        }

        .breadcrumb a {
            color: var(--accent);
            text-decoration: none;
            cursor: pointer;
        }

        .breadcrumb a:hover { text-decoration: underline; }

        .breadcrumb .sep {
            color: var(--border);
        }

        /* --- Section title --- */
        .section-title {
            font-family: 'Outfit', sans-serif;
            font-weight: 700;
            font-size: 1.4rem;
            margin-bottom: 1rem;
        }

        .section-subtitle {
            font-size: 0.85rem;
            color: var(--text2);
            margin-top: -0.6rem;
            margin-bottom: 1rem;
        }

        /* --- Grid --- */
        .grid {
            display: grid;
            gap: 0.6rem;
        }

        .grid-brands {
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        }

        .grid-models {
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        }

        .grid-vehicles {
            grid-template-columns: 1fr;
        }

        .grid-categories {
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        }

        .grid-parts {
            grid-template-columns: 1fr;
        }

        /* --- Card --- */
        .card {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 0.8rem 1rem;
            cursor: pointer;
            transition: border-color 0.2s, transform 0.15s, background 0.2s;
        }

        .card:hover {
            border-color: var(--accent);
            background: var(--hover);
        }

        .card:active {
            transform: scale(0.98);
        }

        /* Brand card */
        .card-brand {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .card-brand .cb-name {
            font-weight: 700;
            font-size: 0.95rem;
        }

        .card-brand .cb-count {
            font-size: 0.7rem;
            color: var(--text2);
            font-family: 'JetBrains Mono', monospace;
        }

        /* Model card */
        .card-model {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
        }

        .card-model .cm-name {
            font-weight: 700;
            font-size: 1rem;
        }

        .card-model .cm-years {
            font-size: 0.75rem;
            color: var(--text2);
        }

        .card-model .cm-count {
            font-size: 0.7rem;
            color: var(--text2);
            font-family: 'JetBrains Mono', monospace;
        }

        /* Vehicle row */
        .card-vehicle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }

        .cv-main {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .cv-year {
            font-family: 'Outfit', sans-serif;
            font-weight: 700;
            font-size: 1.1rem;
            color: var(--accent);
            min-width: 50px;
        }

        .cv-engine {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .cv-details {
            font-size: 0.75rem;
            color: var(--text2);
        }

        .cv-trim {
            font-size: 0.7rem;
            color: var(--info);
            background: rgba(59, 130, 246, 0.1);
            padding: 0.15rem 0.5rem;
            border-radius: 4px;
        }

        /* Category card */
        .card-category {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .cc-name {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .cc-count {
            font-size: 0.7rem;
            color: var(--text2);
            font-family: 'JetBrains Mono', monospace;
        }

        /* Group header */
        .group-header {
            padding: 0.6rem 0;
            margin-top: 0.5rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .group-header .gh-name {
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--accent);
        }

        .group-header .gh-count {
            font-size: 0.7rem;
            color: var(--text2);
        }

        /* Part row */
        .part-row {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.5rem 0.6rem;
            border-bottom: 1px solid rgba(42, 42, 58, 0.4);
            transition: background 0.15s;
        }

        .part-row:hover {
            background: var(--hover);
            border-radius: 6px;
        }

        .part-oem {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--accent);
            min-width: 160px;
        }

        .part-name {
            font-size: 0.85rem;
            flex: 1;
        }

        .part-pos {
            font-size: 0.7rem;
            color: var(--text2);
        }

        .part-qty {
            font-size: 0.7rem;
            color: var(--text2);
            font-family: 'JetBrains Mono', monospace;
            min-width: 40px;
            text-align: right;
        }

        /* --- Loading / Empty --- */
        .loading, .empty {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--text2);
            font-size: 0.9rem;
        }

        /* --- Responsive --- */
        @media (max-width: 768px) {
            .header-search { display: none; }
            .grid-brands { grid-template-columns: repeat(2, 1fr); }
            .main { padding: 4rem 0.8rem 1.5rem; }
            .part-oem { min-width: 120px; font-size: 0.8rem; }
        }

        /* --- Part row clickable --- */
        .part-row {
            cursor: pointer;
        }

        /* --- Modal overlay --- */
        .modal-bg {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            z-index: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s;
        }

        .modal-bg.open {
            opacity: 1;
            pointer-events: auto;
        }

        .modal {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 14px;
            width: 600px;
            max-width: 95vw;
            max-height: 85vh;
            overflow-y: auto;
            transform: translateY(12px) scale(0.97);
            transition: transform 0.25s;
        }

        .modal-bg.open .modal {
            transform: translateY(0) scale(1);
        }

        /* Modal header */
        .modal-head {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 1.2rem 1.2rem 0.8rem;
            border-bottom: 1px solid var(--border);
        }

        .modal-head-info {
            flex: 1;
            min-width: 0;
        }

        .modal-oem {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 1.2rem;
            color: var(--accent);
            word-break: break-all;
        }

        .modal-part-name {
            font-size: 0.95rem;
            margin-top: 0.2rem;
        }

        .modal-close {
            background: none;
            border: none;
            color: var(--text2);
            font-size: 1.4rem;
            cursor: pointer;
            padding: 0.2rem 0.4rem;
            border-radius: 6px;
            transition: background 0.15s, color 0.15s;
            flex-shrink: 0;
            margin-left: 0.5rem;
        }

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

        /* Modal detail fields */
        .modal-fields {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            padding: 0.8rem 1.2rem;
        }

        .mf {
            display: flex;
            flex-direction: column;
            gap: 0.1rem;
        }

        .mf-label {
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text2);
            font-weight: 600;
        }

        .mf-value {
            font-size: 0.85rem;
            font-weight: 500;
        }

        /* Modal sections */
        .modal-section {
            padding: 0.8rem 1.2rem;
            border-top: 1px solid var(--border);
        }

        .modal-section-title {
            font-family: 'DM Sans', sans-serif;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--accent);
            margin-bottom: 0.6rem;
        }

        /* Alternatives table */
        .alt-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
        }

        .alt-table th {
            text-align: left;
            padding: 0.35rem 0.5rem;
            border-bottom: 1px solid var(--border);
            color: var(--text2);
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 600;
        }

        .alt-table td {
            padding: 0.4rem 0.5rem;
            border-bottom: 1px solid rgba(42, 42, 58, 0.4);
        }

        .alt-table .alt-pn {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
            color: var(--info);
        }

        .alt-table .alt-mfr {
            font-weight: 600;
        }

        .alt-quality {
            font-size: 0.65rem;
            font-weight: 600;
            padding: 0.12rem 0.4rem;
            border-radius: 4px;
            text-transform: uppercase;
        }

        .alt-quality.premium { background: rgba(34, 197, 94, 0.15); color: var(--success); }
        .alt-quality.economy { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
        .alt-quality.oem { background: rgba(59, 130, 246, 0.15); color: var(--info); }

        /* Cross-ref rows */
        .xref-row {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.35rem 0;
            border-bottom: 1px solid rgba(42, 42, 58, 0.3);
        }

        .xref-row:last-child { border-bottom: none; }

        .xref-number {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--text);
        }

        .xref-type {
            font-size: 0.65rem;
            font-weight: 600;
            padding: 0.1rem 0.35rem;
            border-radius: 3px;
            background: rgba(255, 107, 53, 0.12);
            color: var(--accent);
            text-transform: uppercase;
        }

        .xref-source {
            font-size: 0.75rem;
            color: var(--text2);
        }

        .modal-empty {
            text-align: center;
            padding: 1rem;
            color: var(--text2);
            font-size: 0.8rem;
        }

        .modal-loading {
            text-align: center;
            padding: 0.8rem;
            color: var(--text2);
            font-size: 0.8rem;
        }

        /* --- Region Filter --- */
        .region-bar {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
        }

        .region-label {
            font-size: 0.75rem;
            color: var(--text2);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-weight: 600;
            margin-right: 0.3rem;
        }

        .region-chip {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.75rem;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--card);
            color: var(--text2);
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            user-select: none;
        }

        .region-chip:hover {
            border-color: var(--accent);
            color: var(--text);
        }

        .region-chip.active {
            background: rgba(255, 107, 53, 0.15);
            border-color: var(--accent);
            color: var(--accent);
        }

        .region-chip .rc-flag {
            font-size: 1rem;
            line-height: 1;
        }

        /* --- Animations --- */
        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .card, .part-row, .group-header {
            animation: fadeUp 0.3s ease both;
        }
