/* =========================================================
   CAR MATCH
   GLOBAL STYLE
========================================================= */


/* =========================================================
   RESET
========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #111111;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

button,
input,
select {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}


/* =========================================================
   NAVBAR
========================================================= */

.navbar {
    position: relative;
    z-index: 100;

    width: 100%;
    min-height: 80px;

    padding: 0 6%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    border-bottom: 1px solid #eeeeee;

    background: rgba(255, 255, 255, 0.96);

    backdrop-filter: blur(10px);
}


/* =========================================================
   LOGO
========================================================= */

.logo {
    display: inline-flex;
    align-items: center;

    text-decoration: none;

    flex-shrink: 0;
}


/* PNG LOGO */

.logo img {
    display: block;

    width: auto;
    height: 34px;

    max-width: 180px;

    object-fit: contain;
}


/*
   Texto del logo.
   Se mantiene porque quiz/results/explore/compare
   todavía utilizan CAR<span>MATCH</span>.
*/

.logo:not(:has(img)) {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    font-weight: 400;
}


/* =========================================================
   NAVIGATION
========================================================= */

.navbar nav {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 35px;
}

.navbar nav a {
    position: relative;

    text-decoration: none;

    color: #444444;

    font-size: 14px;
    font-weight: 400;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.navbar nav a:hover {
    color: #000000;
}


/* ACTIVE PAGE */

.navbar nav a.active {
    color: #111111;
    font-weight: 700;
}

.navbar nav a.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -8px;

    height: 1px;

    background: #111111;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.secondary-button,
.nav-button,
.quiz-next,
.quiz-back,
.exit-button,
.clear-filters,
.help-understood {
    -webkit-tap-highlight-color: transparent;
}


/* PRIMARY */

.primary-button {
    border: none;

    background: #111111;
    color: #ffffff;

    padding: 17px 28px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        opacity 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
}

.primary-button:active {
    transform: translateY(0);
}


/* SECONDARY */

.secondary-button {
    border: 1px solid #cccccc;

    background: transparent;
    color: #111111;

    padding: 17px 28px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.secondary-button:hover {
    border-color: #111111;

    background: #ffffff;

    transform: translateY(-2px);
}

.secondary-button:active {
    transform: translateY(0);
}


/* OLD NAV BUTTON COMPATIBILITY */

.nav-button {
    border: none;

    background: #111111;
    color: #ffffff;

    padding: 13px 22px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    min-height: 680px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    background: #f5f5f3;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 80px 10%;
}

.eyebrow {
    font-size: 12px;

    letter-spacing: 3px;

    font-weight: 700;

    margin-bottom: 25px;
}

.hero h1 {
    font-size: clamp(48px, 5vw, 76px);

    line-height: 0.98;

    letter-spacing: -4px;

    max-width: 700px;
}

.hero h1 span {
    color: #777777;
}

.hero-description {
    max-width: 520px;

    margin-top: 30px;

    color: #555555;

    font-size: 17px;

    line-height: 1.7;
}


/* HERO BUTTONS */

.hero-buttons {
    display: flex;

    gap: 15px;

    margin-top: 40px;
}


/* =========================================================
   HERO IMAGE
========================================================= */

.hero-image {
    position: relative;

    min-height: 600px;

    background:
        linear-gradient(
            135deg,
            #202020,
            #555555
        );

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;
}


/* REAL HERO IMAGE */

.hero-image img {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    z-index: 1;
}


/* IMAGE OVERLAY */

.image-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.35)
        );

    z-index: 2;

    pointer-events: none;
}


/* PLACEHOLDER */

.hero-car-placeholder {
    position: relative;

    z-index: 0;

    color: #ffffff;

    font-size: 90px;

    font-weight: 900;

    letter-spacing: -8px;

    opacity: 0.9;
}


/*
   Si existe imagen, el placeholder queda oculto
   visualmente debajo de ella.
*/

.hero-image img:not([src=""]) + .hero-car-placeholder {
    z-index: 0;
}


/* =========================================================
   HOW IT WORKS
========================================================= */

.how-it-works {
    padding: 120px 8%;
}

.section-label {
    font-size: 11px;

    letter-spacing: 3px;

    font-weight: 700;

    color: #777777;

    margin-bottom: 20px;
}

.how-it-works h2,
.categories h2 {
    font-size: clamp(36px, 4vw, 55px);

    letter-spacing: -2px;

    line-height: 1;

    max-width: 700px;
}


/* =========================================================
   STEPS
========================================================= */

.steps {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 60px;

    margin-top: 70px;
}

.step-number {
    font-size: 14px;

    color: #999999;

    margin-bottom: 30px;
}

.step h3 {
    font-size: 22px;

    margin-bottom: 15px;
}

.step p {
    color: #666666;

    line-height: 1.7;

    max-width: 350px;
}


/* =========================================================
   CATEGORIES
========================================================= */

.categories {
    padding: 120px 8%;

    background: #111111;

    color: #ffffff;
}

.categories .section-label {
    color: #999999;
}

.category-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 15px;

    margin-top: 60px;
}

.category-card {
    min-height: 220px;

    padding: 30px;

    border: 1px solid #333333;

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    transition:
        background 0.3s ease,
        transform 0.3s ease,
        border-color 0.3s ease;

    cursor: pointer;
}

.category-card:hover {
    background: #1d1d1d;

    border-color: #444444;

    transform: translateY(-5px);
}

.category-card h3 {
    font-size: 25px;

    margin-bottom: 10px;
}

.category-card p {
    color: #999999;

    line-height: 1.5;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
    padding: 60px 8%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 30px;

    border-top: 1px solid #eeeeee;

    background: #ffffff;
}

footer .logo img {
    height: 30px;
}

footer p {
    color: #777777;

    font-size: 13px;
}


/* =========================================================
   FOCUS ACCESSIBILITY
========================================================= */

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
.category-card:focus-visible {
    outline: 2px solid #111111;

    outline-offset: 4px;
}


/* =========================================================
   QUIZ
========================================================= */

.quiz-page {
    background: #f7f7f5;

    min-height: 100vh;
}


/* =========================================================
   QUIZ HEADER
========================================================= */

.quiz-header {
    height: 80px;

    padding: 0 6%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;

    background: #ffffff;

    border-bottom: 1px solid #e8e8e8;
}

.quiz-logo {
    color: #111111;

    text-decoration: none;

    font-size: 22px;

    font-weight: 800;

    letter-spacing: -1px;
}

.quiz-logo span {
    font-weight: 400;
}


/* =========================================================
   EXIT
========================================================= */

.exit-button {
    border: none;

    background: transparent;

    font-size: 12px;

    font-weight: 700;

    color: #777777;

    cursor: pointer;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.exit-button:hover {
    color: #111111;
}


/* =========================================================
   QUIZ CONTAINER
========================================================= */

.quiz-container {
    width: min(900px, 90%);

    margin: 0 auto;

    padding: 70px 0 50px;
}


/* =========================================================
   PROGRESS
========================================================= */

.progress-section {
    margin-bottom: 70px;
}

.progress-top {
    display: flex;

    justify-content: space-between;

    margin-bottom: 12px;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 1.5px;

    color: #777777;
}

.progress-bar {
    height: 4px;

    background: #dddddd;

    border-radius: 10px;

    overflow: hidden;
}

.progress {
    height: 100%;

    width: 10%;

    background: #111111;

    transition: width 0.4s ease;
}


/* =========================================================
   QUESTION
========================================================= */

.question-section {
    max-width: 750px;

    margin: 0 auto;
}

.question-category {
    font-size: 11px;

    font-weight: 700;

    letter-spacing: 3px;

    color: #888888;

    margin-bottom: 20px;
}

.question-section h1 {
    font-size: clamp(38px, 5vw, 62px);

    line-height: 1;

    letter-spacing: -3px;

    margin-bottom: 25px;
}

.question-description {
    color: #666666;

    font-size: 16px;

    line-height: 1.7;

    max-width: 650px;

    margin-bottom: 45px;
}


/* =========================================================
   ANSWERS
========================================================= */

.answers {
    display: grid;

    gap: 12px;
}

.answer {
    position: relative;

    padding: 22px 25px;

    border: 1px solid #dddddd;

    background: #ffffff;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;

    border-radius: 8px;
}

.answer:hover {
    border-color: #111111;

    transform: translateY(-2px);
}

.answer.selected {
    background: #111111;

    color: #ffffff;

    border-color: #111111;
}

.answer-title {
    font-size: 16px;

    font-weight: 700;

    margin-bottom: 5px;
}

.answer-description {
    font-size: 13px;

    color: #777777;

    line-height: 1.5;
}

.answer.selected .answer-description {
    color: #bbbbbb;
}


/* =========================================================
   HELP BUTTON
========================================================= */

.help-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    margin-left: 8px;

    border: 1px solid #aaaaaa;

    border-radius: 50%;

    font-size: 12px;

    cursor: pointer;

    color: #555555;

    background: #ffffff;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.help-button:hover {
    background: #111111;

    color: #ffffff;
}


/* =========================================================
   QUIZ NAVIGATION
========================================================= */

.quiz-navigation {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-top: 70px;
}

.quiz-back {
    border: none;

    background: transparent;

    color: #666666;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;

    transition: color 0.2s ease;
}

.quiz-back:hover {
    color: #111111;
}

.quiz-next {
    border: none;

    background: #111111;

    color: #ffffff;

    padding: 17px 30px;

    border-radius: 30px;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.quiz-next:hover {
    transform: translateY(-2px);
}

.quiz-next:active {
    transform: translateY(0);
}


/* =========================================================
   HELP MODAL
========================================================= */

.help-modal {
    position: fixed;

    inset: 0;

    z-index: 9999;
}

.help-overlay {
    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(5px);
}

.help-box {
    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    width: min(500px, 90%);

    max-height: 90vh;

    overflow-y: auto;

    padding: 45px;

    background: #ffffff;

    border-radius: 14px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.25);
}

.help-icon {
    width: 35px;
    height: 35px;

    border-radius: 50%;

    background: #111111;

    color: #ffffff;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 700;

    margin-bottom: 25px;
}

.help-box h2 {
    font-size: 28px;

    letter-spacing: -1px;

    margin-bottom: 15px;
}

.help-box p {
    color: #666666;

    line-height: 1.7;
}

.help-close {
    position: absolute;

    top: 20px;
    right: 20px;

    width: 35px;
    height: 35px;

    border: none;

    background: transparent;

    font-size: 28px;

    cursor: pointer;

    color: #777777;

    border-radius: 50%;
}

.help-close:hover {
    background: #f2f2f2;

    color: #111111;
}

.help-understood {
    margin-top: 30px;

    border: none;

    background: #111111;

    color: #ffffff;

    padding: 14px 25px;

    border-radius: 30px;

    font-size: 11px;

    font-weight: 700;

    cursor: pointer;

    transition: transform 0.2s ease;
}

.help-understood:hover {
    transform: translateY(-2px);
}


/* =========================================================
   GENERAL MOBILE — TABLET
========================================================= */

@media (max-width: 900px) {

    /* NAVBAR */

    .navbar {
        padding: 0 5%;

        gap: 20px;
    }

    .navbar nav {
        display: none;
    }


    /* HERO */

    .hero {
        grid-template-columns: 1fr;

        min-height: auto;
    }

    .hero-content {
        padding: 80px 7%;
    }

    .hero-image {
        min-height: 400px;
    }


    /* STEPS */

    .steps {
        grid-template-columns: 1fr;

        gap: 50px;
    }


    /* CATEGORIES */

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }


    /* FOOTER */

    footer {
        padding: 50px 7%;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    /* =====================================================
       NAVBAR
    ====================================================== */

    .navbar {
        min-height: 70px;

        padding: 0 5%;

        gap: 15px;
    }

    .navbar .logo img {
        height: 28px;

        max-width: 150px;
    }

    .navbar > .primary-button {
        padding: 11px 16px;

        font-size: 10px;

        white-space: nowrap;
    }


    /* =====================================================
       HERO
    ====================================================== */

    .hero-content {
        padding: 65px 7%;
    }

    .eyebrow {
        font-size: 10px;

        letter-spacing: 2.5px;

        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: clamp(42px, 12vw, 58px);

        letter-spacing: -2.5px;

        line-height: 0.98;
    }

    .hero-description {
        font-size: 15px;

        line-height: 1.65;

        margin-top: 25px;
    }

    .hero-buttons {
        flex-direction: column;

        gap: 10px;

        margin-top: 30px;
    }

    .primary-button,
    .secondary-button {
        width: 100%;

        min-height: 50px;
    }

    .hero-image {
        min-height: 320px;
    }

    .hero-car-placeholder {
        font-size: 60px;

        letter-spacing: -5px;
    }


    /* =====================================================
       HOW IT WORKS
    ====================================================== */

    .how-it-works {
        padding: 80px 7%;
    }

    .section-label {
        font-size: 10px;

        letter-spacing: 2.5px;
    }

    .how-it-works h2,
    .categories h2 {
        font-size: clamp(34px, 9vw, 46px);

        letter-spacing: -1.8px;
    }

    .steps {
        margin-top: 50px;

        gap: 45px;
    }

    .step-number {
        margin-bottom: 20px;
    }

    .step h3 {
        font-size: 20px;
    }

    .step p {
        font-size: 14px;
    }


    /* =====================================================
       CATEGORIES
    ====================================================== */

    .categories {
        padding: 80px 7%;
    }

    .category-grid {
        grid-template-columns: 1fr;

        gap: 10px;

        margin-top: 45px;
    }

    .category-card {
        min-height: 180px;

        padding: 25px;
    }


    /* =====================================================
       FOOTER
    ====================================================== */

    footer {
        padding: 45px 7%;

        flex-direction: column;

        align-items: flex-start;

        gap: 20px;
    }

    footer .logo img {
        height: 28px;
    }

    footer p {
        font-size: 12px;
    }


    /* =====================================================
       QUIZ
    ====================================================== */

    .quiz-header {
        height: 70px;

        padding: 0 5%;
    }

    .quiz-logo {
        font-size: 20px;
    }

    .quiz-container {
        width: 90%;

        padding-top: 45px;

        padding-bottom: 40px;
    }

    .progress-section {
        margin-bottom: 50px;
    }

    .question-category {
        font-size: 10px;

        letter-spacing: 2.5px;
    }

    .question-section h1 {
        font-size: clamp(38px, 10vw, 52px);

        letter-spacing: -2px;
    }

    .question-description {
        font-size: 15px;

        margin-bottom: 35px;
    }

    .answer {
        padding: 20px;
    }

    .answer-title {
        font-size: 15px;
    }

    .answer-description {
        font-size: 12px;
    }

    .quiz-navigation {
        margin-top: 50px;
    }

    .quiz-next {
        padding: 15px 23px;
    }


    /* =====================================================
       HELP MODAL
    ====================================================== */

    .help-box {
        width: 92%;

        padding: 35px 25px;
    }

    .help-box h2 {
        font-size: 25px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 450px) {

    .navbar {
        padding: 0 4%;
    }

    .navbar .logo img {
        height: 25px;

        max-width: 125px;
    }

    .navbar > .primary-button {
        padding: 10px 12px;

        font-size: 9px;
    }


    .hero-content {
        padding: 55px 6%;
    }

    .hero h1 {
        font-size: 40px;

        letter-spacing: -2px;
    }

    .hero-image {
        min-height: 270px;
    }


    .how-it-works,
    .categories {
        padding-left: 6%;
        padding-right: 6%;
    }


    .category-card {
        min-height: 160px;
    }


    .quiz-container {
        width: 92%;
    }

    .quiz-navigation {
        gap: 10px;
    }

    .quiz-back {
        font-size: 11px;
    }

    .quiz-next {
        font-size: 11px;

        padding: 14px 18px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@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;
    }

}