/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; overflow-x: hidden; background: #080808; color: #f3f3f3; transition: background 0.35s ease, color 0.35s ease; padding-top: 84px; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }

:root {
    --astra-red: #d32f2f;
    --dark-bg: #111;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --text-muted: #b8b8b8;
    --border: rgba(255, 255, 255, 0.12);
}

/* Navigation */
#navbar {
    position: fixed;
    inset: 0 auto auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    width: 100%;
    z-index: 1000;
    background: rgba(9, 9, 9, 0.72);
    backdrop-filter: blur(18px);
    transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
}
#navbar.scrolled {
    background: rgba(8, 8, 8, 0.92);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.logo {
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: 0.08em;
}
.logo span { color: var(--astra-red); }
#nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}
#nav-menu li a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    transition: color 0.25s ease;
}
#nav-menu li a:hover { color: var(--astra-red); }
.hamburger { display: none; }
.hamburger span { width: 1.35rem; height: 0.15rem; background: #fff; border-radius: 999px; transition: transform 0.3s ease, opacity 0.3s ease; }

/* Active nav link */
#nav-menu li a.active {
    color: var(--astra-red) !important;
    font-weight: 800;
}

/* Smooth sections */
section, .container, .parallax, .service-card, .flip-card, .card-panel {
    transition: transform 0.35s ease, opacity 0.35s ease, background 0.35s ease;
}

/* Hero & parallax */
.parallax {
    min-height: calc(100vh - 84px);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.parallax::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.85));
}
/* Custom styles for the interactive video gallery */
        .reel-overlay {
            opacity: 1;
            transition: opacity 0.3s ease;
        }
        .reel-container:hover .reel-overlay {
            opacity: 0;
        }
        .playing-text {
            display: none;
        }
        .reel-container:hover .playing-text {
            display: inline-block;
        }
        
.content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: min(100%, 920px);
    padding: 0 1rem;
}
h1 {
    font-size: 3.1rem;
    letter-spacing: 0.18em;
    line-height: 1.02;
}

/* Layout containers */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 4.5rem 1.5rem;
    width: 100%;
}

/* Page-specific detail spacing */
body.car-details-page main {
    padding-top: 6rem;
}

/* Mobile spec-card slider */
body.car-details-page .car-specs {
    display: grid;
}
body.car-details-page .car-specs > div {
    min-width: auto;
}

/* Section headings */
h2 {
    font-size: 2.6rem;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

/* Grid layouts */
.services-grid,
.values-grid,
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.service-card,
.value-item,
.card-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 1.75rem;
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
    will-change: transform, opacity;
}
.service-card:hover,
.value-item:hover,
.card-panel:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.16);
}

/* Flip gallery */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    min-height: 320px;
    position: relative;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1.25rem;
    overflow: hidden;
}
.flip-card-front img { width: 100%; height: 100%; object-fit: cover; }
.flip-card-back {
    background: rgba(17, 17, 17, 0.95);
    color: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.75rem;
    border: 1px solid rgba(255,255,255,0.12);
}

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 2rem;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    transition: all 0.25s ease;
}
.btn:hover {
    background: var(--astra-red);
    border-color: var(--astra-red);
}

/* Form controls */
input,
select,
textarea {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    outline: none;
    width: 100%;
}
input::placeholder,
select::placeholder,
textarea::placeholder { color: #aaa; }

.hero-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: stretch;
    gap: 0.9rem;
    width: min(100%, 70rem);
    margin: 0 auto;
}
.hero-search-row input#car-search {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.hero-search-row select#type-filter {
    flex: 0 0 auto;
    width: 10rem;
    min-width: 9rem;
    max-width: 12rem;
    text-transform: uppercase;
    -webkit-appearance: none;
    appearance: none;
}
.hero-search-row button {
    flex: 0 0 auto;
    min-width: 10rem;
}
@media (min-width: 1024px) {
    .hero-search-row {
        flex-wrap: nowrap;
    }
}
.hero-search-row input,
.hero-search-row select,
.hero-search-row button {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    min-height: 3.5rem;
}
.hero-search-row input:focus,
.hero-search-row select:focus,
.hero-search-row button:focus {
    outline: 2px solid rgba(211,47,47,0.45);
    outline-offset: 3px;
}

/* Utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Mobile responsiveness */
@media (max-width: 980px) {
    .container { padding: 3rem 1.25rem; }
    .parallax { min-height: calc(80vh); }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2.2rem; }
    .services-grid,
    .values-grid,
    .gallery-grid { grid-template-columns: 1fr; }
    .service-card,
    .value-item,
    .card-panel { padding: 1.75rem; }
    .flip-card { min-height: 280px; }
    .btn { width: 100%; }
}
@media (max-width: 768px) {
    /* Slightly smaller top offset on mobile where navbar is shorter */
    body { padding-top: 72px; }
}
@media (max-width: 768px) {
    #navbar { padding: 1rem 1rem; }
    .hamburger { display: flex; }
    #nav-menu {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.96);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        padding: 2.5rem;
        transform: translateX(-100%);
        transition: transform 0.35s ease;
    }
    #nav-menu.translate-x-0 { transform: translateX(0); }
    #nav-menu li a { font-size: 1rem; }
    .parallax { background-attachment: scroll; }
    .content { padding: 0 0.75rem; }
    .hero-form { gap: 0.8rem; }
    .section-heading { font-size: 2rem; }
    .container { padding: 2.5rem 1rem; }
    body.car-details-page .car-specs {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    body.car-details-page .car-specs > div {
        min-width: 18rem;
        flex: 0 0 18rem;
        scroll-snap-align: start;
    }
}
/* Responsive card slider for small devices */
@media (max-width: 480px) {
    .category > .grid {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
    }
    /* Two cards visible on smallest devices */
    .category > .grid .car-card {
        flex: 0 0 48%;
        min-width: 48%;
        scroll-snap-align: start;
        max-width: 48%;
    }
}

@media (min-width: 481px) and (max-width: 880px) {
    .category > .grid {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
    }
    /* Three cards visible on medium-small devices */
    .category > .grid .car-card {
        flex: 0 0 33.3333%;
        min-width: 33.3333%;
        scroll-snap-align: start;
        max-width: 33.3333%;
    }
}

@media (min-width: 881px) and (max-width: 992px) {
    .category > .grid {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
    }
    /* Two cards for slightly larger small screens */
    .category > .grid .car-card {
        flex: 0 0 48%;
        min-width: 48%;
        scroll-snap-align: start;
        max-width: 48%;
    }
}

/* Controls for manual slider navigation (touch-friendly) */
.slider-controls { position: absolute; top: 50%; right: 0.75rem; transform: translateY(-50%); display: flex; gap: 0.5rem; z-index: 40; }
.slider-controls button { background: rgba(0,0,0,0.6); color: #fff; border: none; width: 2.6rem; height: 2.6rem; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; }
.slider-controls button svg { width: 18px; height: 18px; display: block; }


@media (max-width: 520px) {
    h1 { font-size: 2rem; letter-spacing: 0.1em; }
    .parallax p { font-size: 0.92rem; }
    .service-card,
    .value-item,
    .card-panel { padding: 1.25rem; }
    #nav-menu { padding: 2rem 1rem; }
    #nav-menu li a { font-size: 0.95rem; }
}
