/* ══════════════════════════════════════════════════
   REVOZPORT CONFIGURATOR — Light/White Theme
   Barlow Condensed · rasmdagi dizayn
   ══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Barlow o'rniga Poppins override */
* {
    font-family: 'Poppins', sans-serif !important;
}

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

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --s2: #f0eeec;
    --border: #e0dedd;
    --accent: #c8a84b;
    --accent2: #e8c96a;
    --text: #111111;
    --muted: #888880;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background: #e8e7e4;
    color: var(--text);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

/* ══ THREE.JS CANVAS — proportsiya to'g'ri ══ */
body>canvas {
    position: fixed !important;
    left: 0 !important;
    width: calc(100% - 480px) !important;
    height: 100% !important;
    /* object-fit ekvivalenti: renderer o'zi bajaradi,
       lekin distortion bo'lmasligi uchun aspect ratio app.js da yangilanadi */
}

/* ══ NAV ══ */
.rp-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    background: rgba(245, 244, 242, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.rp-nav-links {
    display: flex;
    gap: 32px;
}

.rp-nav-links a {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.2s;
}

.rp-nav-links a:hover {
    color: var(--text);
}

.rp-logo {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.rp-logo span {
    color: var(--accent);
}

.rp-nav-icons {
    display: flex;
    gap: 18px;
    align-items: center;
}

.rp-nav-icons button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    transition: color 0.2s;
}

.rp-nav-icons button:hover {
    color: var(--text);
}

/* ══ PRELOADER ══ */
.rp-preloader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rp-preloader-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.rp-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.rp-preloader-logo {
    max-width: 180px;
    opacity: 0.85;
}

.rp-preloader-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
}

.rp-preloader-desc {
    font-size: 13px;
    color: var(--muted);
}

.rp-enter-btn {
    padding: 12px 32px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    margin-top: 8px;
}

.rp-enter-btn:hover {
    border-color: var(--text);
    background: var(--text);
    color: #fff;
}

/* ── Car selector ── */
.rp-selector-wrap {
    padding: 40px 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 640px;
    max-width: 900px;
    width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.rp-selector-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 28px;
    text-align: center;
}

.rp-selector-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.rp-sel-group {
    flex: 1;
    position: relative;
}

.rp-sel-num {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    border-right: 1px solid var(--border);
    padding-right: 8px;
    pointer-events: none;
    z-index: 1;
}

.rp-sel-group select {
    width: 100%;
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 12px 12px 36px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 0.2s;
}

.rp-sel-group select:focus {
    outline: none;
    border-color: var(--text);
}

#searchBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--text);
    border: none;
    border-radius: 2px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

#searchBtn:hover {
    background: #333;
}

#searchBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ══ SCREEN FADER ══ */
.rp-fader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 900;
    display: none;
    opacity: 0;
}

/* ══ CONFIGURATOR PANEL (interface.js injects this) ══ */
.rp-configurator {
    position: fixed;
    right: 0;
    width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 100;
    animation: cfgIn 0.4s ease both;
}

@keyframes cfgIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.rp-breadcrumb {
    padding: 14px 36px 0;
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 0.05em;
    background: var(--surface);
    flex-shrink: 0;
}

.rp-breadcrumb span {
    color: var(--text);
    font-weight: 600;
}

.rp-config-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--border);
    overflow: hidden;
}

.rp-panel-title {
    padding: 10px 36px 20px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.rp-panel-title em {
    color: var(--accent);
    font-style: normal;
}

/* Scrollable sections */
.rp-sections-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 36px;
}

.rp-sections-list::-webkit-scrollbar {
    width: 3px;
}

.rp-sections-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

/* ── Section row ── */
.rp-section {
    border-top: 1px solid var(--border);
    animation: secIn 0.5s ease both;
    overflow: hidden;
}

@keyframes secIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.18s;
}

.rp-section-header:hover {
    opacity: 0.65;
}

.rp-section-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.rp-section-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: background 0.3s;
}

.rp-section-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1;
    margin-bottom: 3px;
}

.rp-section-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
}

.rp-section-toggle {
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    color: var(--muted);
    font-weight: 300;
    flex-shrink: 0;
    transition: all 0.28s;
}

.rp-section.open .rp-section-toggle {
    border-color: var(--text);
    color: var(--text);
    transform: rotate(45deg);
}

.rp-section-inner {
    padding-bottom: 18px;
}

/* ── Color swatches ── */
.rp-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.rp-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rp-swatch::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.25s;
}

.rp-swatch.active::after {
    border-color: var(--text);
}

.rp-swatch:hover {
    transform: scale(1.12);
}

.rp-color-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.rp-color-label strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Design chips ── */
.rp-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rp-chip {
    padding: 8px 16px;
    background: var(--s2);
    border: 1px solid var(--border);
    border-radius: 2px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
}

.rp-chip:hover {
    border-color: #aaa;
    color: var(--text);
}

.rp-chip.active {
    border-color: var(--text);
    color: var(--text);
    background: var(--surface);
}

/* ══ BOTTOM BAR ══ */
.rp-bottom-bar {
    padding: 14px 36px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.rp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
}

.rp-pulse-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(76, 175, 80, 0);
    }
}

.rp-shipping-note {
    font-size: 9px;
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.55;
}

.rp-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.rp-price-label {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.rp-price-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 900;
    color: var(--text);
}

.rp-add-btn {
    width: 100%;
    padding: 15px 0;
    background: var(--text);
    border: none;
    border-radius: 2px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.25s, transform 0.12s;
}

.rp-add-btn::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.55s ease;
}

.rp-add-btn:hover {
    background: #333;
}

.rp-add-btn:hover::before {
    left: 100%;
}

.rp-add-btn:active {
    transform: scale(0.99);
}

/* ══ MOBILE ══ */
@media (max-width: 900px) {
    body>canvas {
        width: 100% !important;
        height: 50% !important;
        top: 64px !important;
    }

    .rp-configurator {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 50%;
    }

    .rp-nav {
        padding: 0 20px;
    }

    .rp-selector-wrap {
        min-width: unset;
        width: 92vw;
        padding: 24px 20px;
    }

    .rp-selector-form {
        flex-wrap: wrap;
    }
}

/* touch */
@media (hover: none) and (pointer: coarse) {
    .rp-swatch:hover {
        transform: none;
    }

    .rp-swatch:active {
        transform: scale(0.95);
    }
}

/* ══ LOADING DOTS (for async section content) ══ */
.rp-loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

@media (max-width: 900px) {
    .rp-panel-title {
        font-size: 24px;
        padding: 8px 20px 14px;
    }
}

/* ── Narx o'zgarganda smooth animatsiya ── */
.rp-price-value {
    transition: all 0.25s ease;
}

/* ── Chip ichidagi narx label ── */
.rp-chip-price {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.55;
    margin-left: 4px;
    letter-spacing: 0;
    text-transform: none;
}
.rp-chip.active .rp-chip-price {
    opacity: 0.75;
}

@media (max-width: 900px) {
    .rp-selector-form {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .rp-sel-group {
        width: 100%;
    }

    #searchBtn {
        width: 100%;
        justify-content: center;
    }
}