/* static/style.css */

/* --- Basic Reset & Font --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #fff;
    color: #171a20;
    overflow-x: hidden;
}

a {
    color: #5c5e62;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Main Header --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid #ddd;
    gap: 32px;
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: #171a20;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex: 1;
    align-items: center;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #171a20;
    cursor: pointer;
    flex-shrink: 0;
}

.globe-icon {
    font-size: 1.1rem;
}

/* --- Menu Toggle Button (Mobile) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #171a20;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --- Navigation Bar (deprecated - now part of header) --- */
.navbar {
    display: none;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: #171a20;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #f4f4f4;
    text-decoration: none;
}

/* --- Page Wrapper (Padding) --- */
.page-wrapper {
    padding: 20px;
    background-color: #fff;
    min-height: calc(100vh - 109px);
}

/* --- Main Layout (Flexbox) --- */
.container {
    display: flex;
    height: calc(100vh - 149px);
    max-height: calc(100vh - 149px);
    background-color: #fff;
    border-radius: 8px;
}

.main-content {
    flex: 3; /* Takes 3/4 of the width */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* --- Image Slider --- */
.image-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #171a20;
    transition: background-color 0.2s;
}

.chat-icon:hover {
    background-color: rgba(255, 255, 255, 1);
}

.chat-icon svg {
    width: 20px;
    height: 20px;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.car-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.car-image.slide.active {
    opacity: 1;
    z-index: 1;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.slider-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.2s;
}

.dot.active,
.dot:hover {
    background-color: rgba(255, 255, 255, 1);
}

.sidebar {
    flex: 1; /* Takes 1/4 of the width */
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid #ddd;
    background-color: #fff;
    border-radius: 0 8px 8px 0;
}

/* --- Sidebar Content --- */
.sidebar-content {
    padding: 24px 40px;
    overflow-y: auto; /* <-- This makes it scrollable */
    flex-grow: 1;     /* <-- This makes it fill the space */
}

.sidebar-content h1 {
    font-size: 2.5rem;
    font-weight: 600;
}

.lease-promo {
    font-size: 0.9rem;
    color: #5c5e62;
    margin-bottom: 24px;
}
.lease-promo a {
    font-weight: 600;
    color: #3e6ae1;
}

/* --- Specs --- */
.specs {
    display: flex;
    justify-content: space-between;
    text-align: left;
    margin-bottom: 32px;
}
.specs h2 {
    font-size: 1.5rem;
    font-weight: 600;
}
.specs .unit {
    font-size: 1rem;
    font-weight: 400;
    margin-left: 4px;
}
.specs p {
    font-size: 0.8rem;
    color: #5c5e62;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    margin-bottom: 24px;
    border-radius: 99px;
    background-color: #f4f4f4;
    padding: 4px;
}
.tab-link {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background-color: transparent;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}
.tab-link.active {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Option Boxes --- */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.option-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 2px solid #d0d1d2;
    border-radius: 12px;
    cursor: pointer;
}
.option-box.selected {
    border-color: #3e6ae1;
    box-shadow: 0 0 0 3px #3e6ae1;
}
.option-box h3 {
    font-size: 1rem;
    font-weight: 600;
}
.option-box p {
    font-size: 0.9rem;
    color: #5c5e62;
}
.option-box .price {
    font-size: 1.1rem;
    font-weight: 600;
}

.link {
    font-weight: 600;
    font-size: 0.9rem;
}
.finance-details, .links-group, .savings-note {
    font-size: 0.8rem;
    color: #5c5e62;
    margin-top: 16px;
}
.links-group {
    display: flex;
    gap: 16px;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 16px 30px;
    border-top: 1px solid #ddd;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-price p {
    font-size: 0.75rem;
    color: #5c5e62;
    margin-bottom: 4px;
}
.footer-price strong {
    font-size: 1.1rem;
    font-weight: 600;
}
.order-button {
    background-color: #3e6ae1;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.order-button:hover {
    background-color: #3457b1;
}
.button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    color: #3e6ae1;
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 768px) {
    /* Header adjustments on mobile */
    .main-header {
        padding: 12px 16px;
        flex-wrap: nowrap;
        gap: 16px;
        position: relative;
    }

    /* Show menu toggle on mobile */
    .menu-toggle {
        display: flex;
        order: 2;
        margin-left: auto;
    }

    .language-selector {
        order: 3;
    }

    /* Hide nav links by default on mobile */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        flex-direction: column;
        width: 100%;
        padding: 16px;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        z-index: 150;
    }

    /* Show nav links when active */
    .nav-links.active {
        max-height: 400px;
        opacity: 1;
        padding: 16px;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 12px 16px;
        width: 100%;
        display: block;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Prevent body scrolling on mobile */
    body {
        overflow: hidden;
        height: 100vh;
    }

    /* Remove padding on mobile for edge-to-edge */
    .page-wrapper {
        padding: 0;
        height: calc(100vh - 61px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Vertical layout on mobile */
    .container {
        flex-direction: column;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        flex: 1;
        overflow: hidden;
        display: flex;
        gap: 20px;
        padding: 0 16px;
    }

    /* Main content fixed on mobile - no scrolling */
    .main-content {
        flex: none;
        width: 100%;
        height: 25vh;
        min-height: 25vh;
        max-height: 25vh;
        border-radius: 12px;
        position: relative;
        overflow: hidden;
    }

    /* Hide slider controls on mobile */
    .slider-btn,
    .slider-dots {
        display: none;
    }

    /* Sidebar full width on mobile - scrollable */
    .sidebar {
        flex: 1;
        width: 100%;
        height: 75vh;
        min-height: 0;
        border-left: none;
        border-top: 1px solid #ddd;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-top: 20px;
    }

    /* Sidebar content scrollable on mobile */
    .sidebar-content {
        padding: 24px 20px;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        padding-bottom: 100px;
    }

    /* Sidebar footer fixed at bottom on mobile */
    .sidebar-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px 20px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 150;
        flex-shrink: 0;
    }

    /* Adjust header padding on mobile */
    .main-header {
        padding: 12px 16px;
        flex-shrink: 0;
    }

    /* Adjust specs spacing on mobile */
    .specs {
        gap: 16px;
    }

    .specs h2 {
        font-size: 1.3rem;
    }

    /* Adjust sidebar title on mobile */
    .sidebar-content h1 {
        font-size: 2rem;
    }

    /* Adjust order button on mobile */
    .order-button {
        padding: 6px 18px;
        font-size: 0.8rem;
    }
    
    /* Footer price adjustments on mobile */
    .footer-price p {
        font-size: 0.7rem;
    }
    
    .footer-price strong {
        font-size: 1rem;
    }

    /* Chat icon positioning on mobile */
    .chat-icon {
        top: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
    }

    .chat-icon svg {
        width: 18px;
        height: 18px;
    }
}