/* =========================================
   FERRARI SF90 — ROYAL VIP CARS
   MOBILE + LAPTOP RESPONSIVE DESIGN
========================================= */

/* ---------- RESET ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #090909;
    color: #f5f1e8;
    font-family: "Poppins", sans-serif;
    overflow-x: hidden;
}

img {
    width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}


/* ---------- GLOBAL VARIABLES ---------- */

:root {
    --black: #090909;
    --soft-black: #111111;
    --card-black: #171717;
    --border-dark: rgba(255, 255, 255, 0.11);
    --white: #f5f1e8;
    --muted: #aaa59b;
    --gold: #c8a45d;
    --gold-light: #e2c17d;
    --ferrari-red: #d40000;
    --section-padding: 110px 7%;
}


/* =========================================
   HEADER
========================================= */

.page-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;

    width: 100%;
    height: 82px;
    padding: 0 7%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(7, 7, 7, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.logo {
    font-family: "Cinzel", serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 2.4px;
    color: var(--gold-light);
    white-space: nowrap;
}

.page-header nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.page-header nav a {
    position: relative;

    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.3px;
    text-transform: uppercase;

    transition: color 0.3s ease;
}

.page-header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;

    width: 0;
    height: 1px;

    background: var(--gold);
    transition: width 0.3s ease;
}

.page-header nav a:hover {
    color: var(--gold-light);
}

.page-header nav a:hover::after {
    width: 100%;
}


/* =========================================
   HERO SECTION
========================================= */

.car-hero {
    position: relative;

    min-height: 100vh;
    padding: 160px 7% 90px;

    display: flex;
    align-items: flex-end;

    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    isolation: isolate;
}

.ferrari-hero {
    background-image: url("images/ferrari-sf90/front.jpg");
}

.car-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.22) 0%,
            rgba(0, 0, 0, 0.18) 35%,
            rgba(0, 0, 0, 0.82) 100%
        ),
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.78) 0%,
            rgba(0, 0, 0, 0.2) 62%,
            rgba(0, 0, 0, 0.1) 100%
        );
}

.car-hero-content {
    width: min(720px, 100%);
    padding-left: 26px;

    border-left: 2px solid var(--gold);
}

.car-hero-content span {
    display: block;
    margin-bottom: 14px;

    color: var(--gold-light);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 5px;
}

.car-hero-content h1 {
    margin-bottom: 24px;

    font-family: "Playfair Display", serif;
    font-size: clamp(50px, 7vw, 100px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -2px;
    text-wrap: balance;
}

.car-hero-content p {
    max-width: 590px;

    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.9;
}


/* =========================================
   ABOUT SECTION
========================================= */

.car-about {
    padding: var(--section-padding);

    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 80px;

    background:
        radial-gradient(
            circle at top left,
            rgba(200, 164, 93, 0.08),
            transparent 32%
        ),
        var(--soft-black);
}

.car-about-text {
    max-width: 620px;
}

.car-about-text > span {
    display: block;
    margin-bottom: 18px;

    color: var(--gold);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 4px;
}

.car-about-text h2 {
    margin-bottom: 28px;

    font-family: "Playfair Display", serif;
    font-size: clamp(38px, 5vw, 68px);
    font-weight: 600;
    line-height: 1.08;
}

.car-about-text p {
    margin-bottom: 18px;

    color: var(--muted);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.9;
}

.car-about-image {
    position: relative;
    overflow: hidden;

    min-height: 520px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    background: #141414;
}

.car-about-image::before {
    content: "";
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;

    width: 78px;
    height: 78px;

    border-top: 1px solid var(--gold);
    border-right: 1px solid var(--gold);
    pointer-events: none;
}

.car-about-image::after {
    content: "";
    position: absolute;
    bottom: 18px;
    left: 18px;
    z-index: 2;

    width: 78px;
    height: 78px;

    border-bottom: 1px solid var(--gold);
    border-left: 1px solid var(--gold);
    pointer-events: none;
}

.car-about-image img {
    width: 100%;
    height: 100%;
    min-height: 520px;
    object-fit: cover;
    object-position: center;

    transition: transform 0.8s ease;
}

.car-about-image:hover img {
    transform: scale(1.035);
}


/* =========================================
   GALLERY
========================================= */

.car-gallery {
    padding: var(--section-padding);
    background: var(--black);
}

.car-gallery h2,
.car-details > h2,
.perfect-for > h2 {
    margin-bottom: 52px;

    font-family: "Playfair Display", serif;
    font-size: clamp(38px, 5vw, 62px);
    font-weight: 600;
    text-align: center;
}

.car-gallery h2::after,
.car-details > h2::after,
.perfect-for > h2::after {
    content: "";
    display: block;

    width: 58px;
    height: 1px;
    margin: 18px auto 0;

    background: var(--gold);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.gallery-grid img {
    height: 340px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;

    object-fit: cover;
    cursor: pointer;

    filter: brightness(0.88);
    transition:
        transform 0.45s ease,
        filter 0.45s ease,
        border-color 0.45s ease;
}

.gallery-grid img:nth-child(1) {
    grid-column: span 7;
}

.gallery-grid img:nth-child(2) {
    grid-column: span 5;
}

.gallery-grid img:nth-child(3) {
    grid-column: 3 / span 8;
    height: 430px;
}

.gallery-grid img:hover {
    transform: translateY(-5px);
    filter: brightness(1);
    border-color: rgba(200, 164, 93, 0.58);
}


/* =========================================
   VEHICLE DETAILS
========================================= */

.car-details {
    padding: var(--section-padding);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.015),
            transparent
        ),
        var(--soft-black);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.detail-box {
    position: relative;
    overflow: hidden;

    min-height: 170px;
    padding: 32px 26px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    background: var(--card-black);
    border: 1px solid var(--border-dark);
    border-radius: 3px;

    transition:
        transform 0.35s ease,
        border-color 0.35s ease,
        background 0.35s ease;
}

.detail-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 2px;

    background: linear-gradient(
        90deg,
        var(--gold),
        transparent
    );
}

.detail-box span {
    margin-bottom: 10px;

    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.detail-box h3 {
    color: var(--white);
    font-family: "Playfair Display", serif;
    font-size: 24px;
    font-weight: 600;
}

.detail-box:hover {
    transform: translateY(-5px);
    border-color: rgba(200, 164, 93, 0.45);
    background: #1b1b1b;
}


/* =========================================
   PERFECT FOR
========================================= */

.perfect-for {
    padding: var(--section-padding);
    background: var(--black);
}

.perfect-grid {
    width: min(980px, 100%);
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.perfect-grid div {
    min-height: 88px;
    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ded8cc;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.6px;
    text-align: center;

    background: #131313;
    border: 1px solid var(--border-dark);
    border-radius: 3px;

    transition:
        color 0.35s ease,
        border-color 0.35s ease,
        background 0.35s ease;
}

.perfect-grid div:hover {
    color: var(--gold-light);
    border-color: rgba(200, 164, 93, 0.42);
    background: #181818;
}


/* =========================================
   BOOKING SECTION
========================================= */

.book-car {
    position: relative;
    overflow: hidden;

    min-height: 500px;
    padding: 120px 7%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    background:
        linear-gradient(
            rgba(0, 0, 0, 0.8),
            rgba(0, 0, 0, 0.9)
        ),
        url("images/ferrari-sf90/side.jpg");

    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.book-car::before {
    content: "";
    position: absolute;
    inset: 30px;

    border: 1px solid rgba(200, 164, 93, 0.28);
    pointer-events: none;
}

.book-car h2 {
    position: relative;

    margin-bottom: 20px;

    font-family: "Playfair Display", serif;
    font-size: clamp(39px, 5vw, 70px);
    font-weight: 600;
    line-height: 1.1;
}

.book-car p {
    position: relative;

    max-width: 650px;
    margin-bottom: 34px;

    color: rgba(255, 255, 255, 0.68);
    font-size: 15px;
    line-height: 1.8;
}

.book-car a {
    position: relative;

    min-width: 230px;
    padding: 17px 30px;

    color: #080808;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;

    background: var(--gold);
    border: 1px solid var(--gold);

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}

.book-car a:hover {
    color: var(--gold-light);
    background: transparent;
    transform: translateY(-3px);
}


/* =========================================
   TABLET VIEW
========================================= */

@media (max-width: 1024px) {

    :root {
        --section-padding: 90px 5%;
    }

    .page-header {
        padding: 0 5%;
    }

    .page-header nav {
        gap: 22px;
    }

    .car-hero {
        padding-left: 5%;
        padding-right: 5%;
    }

    .car-about {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .car-about-text {
        max-width: 760px;
    }

    .car-about-image,
    .car-about-image img {
        min-height: 500px;
    }

    .gallery-grid img {
        height: 300px;
    }

    .gallery-grid img:nth-child(3) {
        height: 390px;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* =========================================
   MOBILE VIEW
========================================= */

@media (max-width: 768px) {

    :root {
        --section-padding: 76px 20px;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* HEADER */

    .page-header {
        position: absolute;

        height: auto;
        min-height: 72px;
        padding: 18px 20px;

        flex-direction: column;
        align-items: flex-start;
        gap: 15px;

        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.9),
            rgba(0, 0, 0, 0.15)
        );

        border-bottom: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .logo {
        font-size: 15px;
        letter-spacing: 2px;
    }

    .page-header nav {
        width: 100%;
        gap: 0;

        justify-content: space-between;
    }

    .page-header nav a {
        font-size: 10px;
        letter-spacing: 0.8px;
    }

    .page-header nav a::after {
        display: none;
    }

    /* HERO */

    .car-hero {
        min-height: 100svh;
        padding: 150px 20px 55px;

        align-items: flex-end;
        background-position: 60% center;
    }

    .car-overlay {
        background:
            linear-gradient(
                180deg,
                rgba(0, 0, 0, 0.26) 0%,
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0.94) 100%
            );
    }

    .car-hero-content {
        padding-left: 17px;
        border-left-width: 1px;
    }

    .car-hero-content span {
        margin-bottom: 11px;

        font-size: 10px;
        letter-spacing: 3.6px;
    }

    .car-hero-content h1 {
        margin-bottom: 18px;

        font-size: clamp(42px, 13vw, 62px);
        line-height: 1;
        letter-spacing: -1px;
    }

    .car-hero-content p {
        max-width: 94%;

        font-size: 13px;
        line-height: 1.75;
    }

    /* ABOUT */

    .car-about {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .car-about-text > span {
        margin-bottom: 13px;

        font-size: 10px;
        letter-spacing: 3px;
    }

    .car-about-text h2 {
        margin-bottom: 22px;

        font-size: 39px;
        line-height: 1.12;
    }

    .car-about-text p {
        font-size: 13px;
        line-height: 1.85;
    }

    .car-about-image {
        min-height: 290px;
        border-radius: 2px;
    }

    .car-about-image img {
        min-height: 290px;
        aspect-ratio: 4 / 3;
    }

    .car-about-image::before,
    .car-about-image::after {
        width: 48px;
        height: 48px;
    }

    /* SECTION TITLES */

    .car-gallery h2,
    .car-details > h2,
    .perfect-for > h2 {
        margin-bottom: 36px;
        font-size: 39px;
    }

    /* GALLERY */

    .gallery-grid {
        display: flex;
        gap: 14px;

        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;

        margin-right: -20px;
        padding-right: 20px;
        padding-bottom: 6px;
    }

    .gallery-grid::-webkit-scrollbar {
        display: none;
    }

    .gallery-grid img,
    .gallery-grid img:nth-child(1),
    .gallery-grid img:nth-child(2),
    .gallery-grid img:nth-child(3) {
        flex: 0 0 86%;
        width: 86%;
        height: 270px;

        grid-column: auto;
        scroll-snap-align: start;

        border-radius: 2px;
        filter: brightness(0.95);
    }

    .gallery-grid img:hover {
        transform: none;
    }

    /* DETAILS */

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .detail-box {
        min-height: 140px;
        padding: 24px 17px;
    }

    .detail-box span {
        font-size: 9px;
        letter-spacing: 1.4px;
    }

    .detail-box h3 {
        font-size: 19px;
        line-height: 1.25;
    }

    .detail-box:hover {
        transform: none;
    }

    /* PERFECT FOR */

    .perfect-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 11px;
    }

    .perfect-grid div {
        min-height: 76px;
        padding: 15px 10px;

        font-size: 12px;
        line-height: 1.4;
    }

    /* BOOKING */

    .book-car {
        min-height: 520px;
        padding: 90px 25px;

        background-position: center;
    }

    .book-car::before {
        inset: 16px;
    }

    .book-car h2 {
        max-width: 330px;
        margin-bottom: 18px;

        font-size: 40px;
    }

    .book-car p {
        max-width: 320px;
        margin-bottom: 29px;

        font-size: 13px;
        line-height: 1.7;
    }

    .book-car a {
        width: min(280px, 100%);
        min-width: 0;
        padding: 16px 22px;

        font-size: 11px;
    }
}


/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 420px) {

    .page-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .page-header nav a {
        font-size: 9px;
        letter-spacing: 0.45px;
    }

    .car-hero {
        padding-left: 16px;
        padding-right: 16px;
    }

    .car-hero-content h1 {
        font-size: 42px;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .detail-box {
        min-height: 120px;
    }

    .perfect-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-grid img,
    .gallery-grid img:nth-child(1),
    .gallery-grid img:nth-child(2),
    .gallery-grid img:nth-child(3) {
        flex-basis: 91%;
        width: 91%;
        height: 245px;
    }
}


/* =========================================
   REDUCED MOTION ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}