/* ─── QUIZ PAGE ─── */

.quiz-wrap {
    min-height: calc(100vh - 56px);
    background: var(--white);
    color: var(--black);
    padding-bottom: 100px;
    position: relative;
}

/* Steps */
.quiz-step {
    display: none;
    padding-top: 60px;
    padding-bottom: 40px;
}

.quiz-step.is-active {
    display: block;
}

/* Step header */
.quiz-step__head {
    text-align: center;
    margin-bottom: 48px;
}

.quiz-step__title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 400;
    color: var(--black);
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.quiz-step__subtitle {
    font-family: var(--font-outfit);
    font-size: 15px;
    font-weight: 400;
    color: #555;
}

/* Cards grid */
.quiz-cards {
    display: flex;
    gap: 18px;
    justify-content: center;
}

.quiz-cards--3 {
    max-width: 960px;
    margin-inline: auto;
}

/* Individual card */
.quiz-card {
    flex: 1;
    border: 1.5px solid rgba(20, 20, 20, 0.14);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: var(--white);
    display: flex;
    flex-direction: column;
    transition: border-color 200ms ease, border-width 200ms ease;
    user-select: none;
}

.quiz-cards--5 .quiz-card {
    min-width: 0;
}

.quiz-cards--3 .quiz-card {
    max-width: 380px;
}

.quiz-card.is-selected {
    border: 2px solid var(--black);
}

.quiz-card__img {
    overflow: hidden;
    line-height: 0;
    flex: 1;
}

.quiz-card__img img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    display: block;
    transition: transform 350ms ease;
}

.quiz-cards--3 .quiz-card__img img {
    height: 300px;
}

.quiz-card:hover .quiz-card__img img {
    transform: scale(1.03);
}

.quiz-card__img--empty {
    height: 270px;
    background: #f0eeeb;
}

.quiz-cards--3 .quiz-card__img--empty {
    height: 300px;
}

.quiz-card__label {
    padding: 20px 12px 24px;
    font-family: var(--font-outfit);
    font-size: 15px;
    font-weight: 400;
    color: var(--black);
    text-align: center;
    line-height: 1.3;
}

/* Progress bar */
.quiz-progress {
    width: 100%;
    height: 2px;
    background: rgba(20, 20, 20, 0.1);
    position: relative;
}

.quiz-progress__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--black);
    width: 0;
    transition: width 450ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bottom navigation */
.quiz-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    z-index: 100;
    border-top: 1px solid rgba(20, 20, 20, 0.08);
}

.quiz-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.quiz-nav__btn {
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    padding: 18px 64px;
    border-radius: 4px;
    transition: opacity 200ms ease;
}

.quiz-nav__btn--back {
    background: #8c8c8c;
    color: var(--white);
}

.quiz-nav__btn--back:hover:not(:disabled) {
    opacity: 0.85;
}

.quiz-nav__btn--back:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-nav__btn--next {
    background: var(--black);
    color: var(--white);
}

.quiz-nav__btn--next:hover {
    opacity: 0.8;
}

.quiz-nav__btn--next.is-inactive {
    opacity: 0.4;
}

/* Loading screen */
.quiz-loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.quiz-loading.is-visible {
    display: flex;
}

.quiz-loading__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    animation: quizFadeIn 400ms ease forwards;
}

@keyframes quizFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.quiz-loading__icon {
    width: 62px;
    height: 62px;
}

.quiz-loading__icon svg {
    width: 100%;
    height: 100%;
}

.quiz-loading__text {
    font-family: var(--font-outfit);
    font-size: 17px;
    font-weight: 300;
    color: var(--white);
    letter-spacing: 0.02em;
}

/* Mobile */
@media (max-width: 767px) {
    .quiz-wrap {
        padding-bottom: 90px;
    }

    .quiz-step {
        padding-top: 40px;
    }

    .quiz-step__head {
        margin-bottom: 32px;
    }

    .quiz-cards {
        overflow-x: auto;
        overflow-y: visible;
        justify-content: flex-start;
        padding-inline: 16px;
        gap: 12px;
        -ms-overflow-style: none;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .quiz-cards::-webkit-scrollbar {
        display: none;
    }

    .quiz-cards--5 .quiz-card {
        flex: 0 0 220px;
    }

    .quiz-cards--3 .quiz-card {
        flex: 0 0 260px;
        max-width: 260px;
    }

    .quiz-card__img img,
    .quiz-cards--3 .quiz-card__img img {
        height: 220px;
    }

    .quiz-nav__btn {
        padding: 16px 40px;
        font-size: 12px;
    }
}

/* ─── QUIZ RESULT BANNER (on product page) ─── */

.quiz-result-banner {
    background: #141414;
    padding: 52px 0 44px;
}

.quiz-result-banner__inner {
    display: flex;
    align-items: flex-start;
    gap: 60px;
}

.quiz-result-banner__left {
    flex: 1;
}

.quiz-result-banner__right {
    flex: 0 0 380px;
    align-self: stretch;
    overflow: hidden;
    border-radius: 6px;
    display: none; /* shown via product page if banner image exists */
}

.quiz-result-banner__right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quiz-result-banner__title {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 44px);
    font-weight: 400;
    color: var(--white);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.quiz-result-banner__desc {
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 480px;
}

.quiz-result-banner__row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quiz-result-banner__label {
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    flex-shrink: 0;
}

.quiz-result-banner__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-result-banner__tag {
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 400;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 100px;
    padding: 5px 14px;
    letter-spacing: 0.02em;
}

/* Quiz result banner loading overlay (shown on product page initial load) */
.quiz-page-loading {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 500ms ease;
}

.quiz-page-loading.is-hiding {
    opacity: 0;
    pointer-events: none;
}

.quiz-page-loading__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.quiz-page-loading__icon {
    width: 62px;
    height: 62px;
}

.quiz-page-loading__icon svg {
    width: 100%;
    height: 100%;
}

.quiz-page-loading__text {
    font-family: var(--font-outfit);
    font-size: 17px;
    font-weight: 300;
    color: var(--white);
    letter-spacing: 0.02em;
}

@media (max-width: 767px) {
    .quiz-result-banner {
        padding: 40px 16px 36px;
    }

    .quiz-result-banner__inner {
        flex-direction: column;
        gap: 0;
    }

    .quiz-result-banner__right {
        display: none;
    }
}
