/* ========================================
   KBi ORDER PAGE - TESLA-INSPIRED DESIGN
   ======================================== */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #171a20;
    background: #fff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   TESLA-STYLE NAVIGATION
   ======================================== */
.tesla-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.tesla-nav.scrolled {
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
}

.nav-logo img {
    height: 24px;
    width: auto;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: #393c41;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-link.active {
    color: #171a20;
    font-weight: 600;
}

.nav-locale {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #393c41;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-locale:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #171a20;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-order-btn:hover {
    background: #000;
}

.nav-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.nav-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #393c41;
    transition: all 0.3s ease;
}

/* ========================================
   MOBILE MENU
   ======================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 320px;
    background: #fff;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #393c41;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links {
    list-style: none;
    padding: 60px 0 0;
}

.mobile-nav-links li {
    border-bottom: 1px solid #e5e5e5;
}

.mobile-nav-links a {
    display: block;
    padding: 20px 0;
    color: #393c41;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.mobile-nav-links a.active {
    color: #171a20;
    font-weight: 600;
}

/* ========================================
   LOCALE MODAL (Tesla-style tds-modal)
   ======================================== */
.locale-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 2999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.locale-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.locale-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
}

.locale-modal.active {
    transform: translateX(0);
}

.locale-modal-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.locale-modal-close {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #393c41;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.locale-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.locale-modal-content {
    padding: 0 32px 40px;
}

.locale-region {
    margin-bottom: 32px;
}

.locale-region-title {
    font-size: 24px;
    font-weight: 600;
    color: #171a20;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.locale-country {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.locale-country:last-child {
    border-bottom: none;
}

.locale-country-name {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #171a20;
    margin-bottom: 6px;
}

.locale-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.locale-lang {
    font-size: 14px;
    color: #5c5e62;
    text-decoration: none;
    transition: color 0.2s ease;
}

.locale-lang:hover {
    color: #171a20;
    text-decoration: underline;
}

.locale-lang.active {
    color: #3e6ae1;
    font-weight: 500;
}

/* ========================================
   CONFIGURATOR LAYOUT
   ======================================== */
.configurator {
    display: flex;
    min-height: 100vh;
    padding-top: 0;
}

/* Product Gallery (Left Side) */
.product-gallery {
    flex: 1;
    background: #f4f4f4;
    position: relative;
}

.gallery-sticky {
    position: sticky;
    top: 20px;
    height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    align-items: stretch;
    padding: 0;
}

.gallery-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.gallery-image.exterior {
    flex: 1.55;
    background: #e8e8e8;
}

.gallery-image.exterior img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.gallery-image.interior {
    flex: 1;
    background: #f0f0f0;
    border-top: 1px solid #e0e0e0;
}

.gallery-image.interior img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Configuration Panel (Right Side) */
.config-panel {
    width: 420px;
    min-width: 420px;
    background: #fff;
    padding: 70px 32px 40px 32px;
    overflow-y: auto;
    border-left: 1px solid #e5e5e5;
}

/* Config Header */
.config-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e5e5;
}

.product-title {
    font-size: 28px;
    font-weight: 600;
    color: #171a20;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.product-tagline {
    font-size: 14px;
    color: #5c5e62;
    font-weight: 400;
}

/* Config Sections */
.config-section {
    margin-bottom: 32px;
}

.config-label {
    font-size: 14px;
    font-weight: 600;
    color: #171a20;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

/* ========================================
   COLOR SELECTION
   ======================================== */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.color-btn img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-btn:hover img {
    transform: scale(1.05);
}

.color-btn.btn-selected img {
    border-color: #3e6ae1;
    box-shadow: 0 0 0 2px rgba(62, 106, 225, 0.2);
}

.color-name {
    font-size: 11px;
    color: #5c5e62;
    font-weight: 500;
    text-align: center;
    max-width: 60px;
}

.color-btn.btn-selected .color-name {
    color: #171a20;
}

.interior-options {
    gap: 16px;
}

.interior-options .color-btn img {
    width: 40px;
    height: 40px;
}

/* ========================================
   OPTION CARDS
   ======================================== */
.option-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: #c0c0c0;
    background: #fafafa;
}

.option-card.selected {
    border-color: #3e6ae1;
    background: rgba(62, 106, 225, 0.04);
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.option-name {
    font-size: 14px;
    font-weight: 500;
    color: #171a20;
}

.option-price {
    font-size: 13px;
    color: #5c5e62;
}

.option-card.selected .option-price {
    color: #3e6ae1;
}

/* Toggle Option with Checkmark */
.toggle-option {
    position: relative;
}

.option-check {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.option-check i {
    font-size: 12px;
    color: transparent;
    transition: color 0.2s ease;
}

.toggle-option.selected .option-check {
    background: #3e6ae1;
    border-color: #3e6ae1;
}

.toggle-option.selected .option-check i {
    color: #fff;
}

/* ========================================
   PRICE BREAKDOWN TABLE
   ======================================== */
.price-breakdown {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 12px;
    margin-top: 32px;
}

.breakdown-note {
    font-size: 12px;
    color: #5c5e62;
    margin-bottom: 16px;
}

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

.price-table td {
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid #e5e5e5;
}

.price-table td:first-child {
    color: #5c5e62;
}

.price-table td:last-child {
    text-align: right;
    color: #171a20;
    font-weight: 500;
}

.price-table .total-row td {
    border-bottom: none;
    padding-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #171a20;
}

.price-notes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.notes-title {
    font-size: 11px;
    font-weight: 600;
    color: #5c5e62;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.price-notes ul {
    list-style: none;
    padding: 0;
}

.price-notes li {
    font-size: 11px;
    color: #5c5e62;
    line-height: 1.6;
    padding-left: 12px;
    position: relative;
}

.price-notes li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #999;
}

/* ========================================
   TOTAL PRICE DISPLAY
   ======================================== */
.total-section {
    background: #171a20;
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}

.total-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.total-amount {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
}

/* ========================================
   PAYMENT BREAKDOWN
   ======================================== */
.payment-section {
    margin-top: 24px;
}

.payment-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #5c5e62;
}

.payment-value {
    font-weight: 500;
    color: #171a20;
}

.payment-row.highlight {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #e5e5e5;
}

.monthly-amount {
    font-size: 24px;
    font-weight: 600;
    color: #171a20;
}

/* ========================================
   ORDER BUTTON
   ======================================== */
.order-section {
    margin-top: 32px;
    text-align: center;
}

.order-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.order-btn.primary {
    background: #3e6ae1;
    color: #fff;
}

.order-btn.primary:hover {
    background: #2d5bd1;
}

.order-disclaimer {
    font-size: 12px;
    color: #5c5e62;
    margin-top: 12px;
}

/* ========================================
   FOOTER
   ======================================== */
.tesla-footer {
    background: #f4f4f4;
    padding: 12px 40px;
    border-top: 1px solid #e5e5e5;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #5c5e62;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #171a20;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1200px) {
    .config-panel {
        width: 380px;
        min-width: 380px;
        padding: 32px 24px;
    }
}

@media (max-width: 1024px) {
    .nav-link {
        display: none;
    }

    .nav-order-btn {
        display: none;
    }

    .nav-menu-btn {
        display: flex;
    }

    .configurator {
        flex-direction: column;
    }

    .product-gallery {
        min-height: 50vh;
    }

    .gallery-sticky {
        position: relative;
        top: 0;
        height: auto;
        min-height: 60vh;
    }

    .gallery-image {
        min-height: 30vh;
    }

    .config-panel {
        width: 100%;
        min-width: 100%;
        padding: 32px 24px;
        border-left: none;
        border-top: 1px solid #e5e5e5;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }

    .gallery-sticky {
        padding: 0;
    }

    .config-panel {
        padding: 24px 16px;
    }

    .product-title {
        font-size: 24px;
    }

    .color-options {
        justify-content: center;
    }

    .total-amount {
        font-size: 28px;
    }

    .monthly-amount {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .color-btn img {
        width: 40px;
        height: 40px;
    }

    .color-name {
        font-size: 10px;
    }

    .price-breakdown {
        padding: 16px;
    }

    .total-section {
        padding: 20px;
    }

    .total-amount {
        font-size: 24px;
    }
}

/* ========================================
   JAVASCRIPT STATE CLASSES
   ======================================== */
/* Wheel button selection states */
#wheel-buttons .option-card.bg-gray-700,
#wheel-buttons .option-card.selected {
    border-color: #3e6ae1;
    background: rgba(62, 106, 225, 0.04);
}

/* Performance button toggle state */
#performance-btn.bg-gray-700,
#performance-btn.selected {
    border-color: #3e6ae1;
    background: rgba(62, 106, 225, 0.04);
}

#performance-btn.bg-gray-700 .option-check,
#performance-btn.selected .option-check {
    background: #3e6ae1;
    border-color: #3e6ae1;
}

#performance-btn.bg-gray-700 .option-check i,
#performance-btn.selected .option-check i {
    color: #fff;
}

/* Legacy support for existing JS classes */
.btn-selected {
    /* Color button selected state handled above */
}

.visible-bar {
    transform: translateY(0);
}

.hidden-bar {
    transform: translateY(-100%);
}
