/* =========================================================
   MARVALET GALLERY
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.gallery-page {
    padding: 35px 0 50px;

    background: #080808;
}


.gallery-container {
    width: min(1450px, 94%);

    margin: 0 auto;
}



/* =========================================================
   HEADING
========================================================= */

.gallery-heading {
    max-width: 720px;

    margin: 0 auto 45px;

    text-align: center;
}


.gallery-eyebrow {
    margin-bottom: 10px;

    color: #888888;

    font-size: 0.72rem;

    font-weight: 700;

    letter-spacing: 3px;

    text-transform: uppercase;
}


.gallery-heading h1 {
    margin: 0;

    color: #ffffff;

    font-size: clamp(
        2.7rem,
        5vw,
        4.7rem
    );

    line-height: 0.95;

    letter-spacing: 1px;

    text-transform: uppercase;
}


.gallery-heading-text {
    margin: 15px 0 0;

    color: #999999;

    font-size: 0.95rem;
}



/* =========================================================
   BEFORE / AFTER GRID
========================================================= */

.comparison-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;
}



/* =========================================================
   CARD
========================================================= */

.comparison-card {
    overflow: hidden;

    background: #0c0c0c;

    border: 1px solid #303030;

    border-radius: 4px;
}



/* =========================================================
   BEFORE / AFTER CONTAINER
========================================================= */

.before-after {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 10;

    overflow: hidden;

    background: #111111;

    cursor: ew-resize;

    user-select: none;

    touch-action: pan-y;
}



/* =========================================================
   IMAGES
========================================================= */

.comparison-image {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    object-position: center;

    user-select: none;

    pointer-events: none;
}


.comparison-after {
    z-index: 1;
}



/* =========================================================
   BEFORE WRAPPER
========================================================= */

.comparison-before-wrapper {
    position: absolute;

    top: 0;
    left: 0;

    z-index: 2;

    width: 50%;
    height: 100%;

    overflow: hidden;
}


.comparison-before {
    width: var(--comparison-width, 100%);

    max-width: none;
}



/* =========================================================
   DARK IMAGE GRADIENT
========================================================= */

.before-after::after {
    content: "";

    position: absolute;

    inset: 0;

    z-index: 3;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.22) 0%,
            transparent 25%,
            transparent 70%,
            rgba(0, 0, 0, 0.18) 100%
        );
}



/* =========================================================
   BEFORE / AFTER LABELS
========================================================= */

.comparison-label {
    position: absolute;

    top: 16px;

    z-index: 5;

    padding: 7px 11px;

    background:
        rgba(5, 5, 5, 0.80);

    border:
        1px solid
        rgba(255, 255, 255, 0.20);

    border-radius: 2px;

    color: #ffffff;

    font-size: 0.65rem;

    font-weight: 700;

    letter-spacing: 1.2px;

    text-transform: uppercase;

    pointer-events: none;

    backdrop-filter: blur(3px);
}


.comparison-label-before {
    left: 16px;
}


.comparison-label-after {
    right: 16px;
}



/* =========================================================
   SLIDER DIVIDER
========================================================= */

.comparison-divider {
    position: absolute;

    top: 0;
    left: 50%;

    z-index: 6;

    width: 2px;
    height: 100%;

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

    transform:
        translateX(-50%);

    pointer-events: none;
}



/* =========================================================
   SLIDER HANDLE
========================================================= */

.comparison-handle {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 50px;
    height: 50px;

    display: flex;

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

    gap: 3px;

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

    background:
        linear-gradient(
            135deg,
            #eeeeee,
            #a7a7a7
        );

    border:
        2px solid #ffffff;

    border-radius: 50%;

    color: #080808;

    box-shadow:
        0 4px 18px
        rgba(0, 0, 0, 0.45);
}


.comparison-handle i {
    font-size: 0.8rem;
}



/* =========================================================
   INVISIBLE RANGE INPUT
========================================================= */

.comparison-range {
    position: absolute;

    inset: 0;

    z-index: 10;

    width: 100%;
    height: 100%;

    margin: 0;

    cursor: ew-resize;

    opacity: 0;

    appearance: none;

    -webkit-appearance: none;
}



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

.before-after:focus-within
.comparison-handle {
    outline:
        2px solid #ffffff;

    outline-offset: 4px;
}



/* =========================================================
   CARD INFORMATION
========================================================= */

.comparison-content {
    padding: 22px;
}


.comparison-heading-row {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}


.comparison-number {
    margin:
        0
        0
        6px;

    color: #666666;

    font-size: 0.65rem;

    font-weight: 700;

    letter-spacing: 1.5px;

    text-transform: uppercase;
}


.comparison-content h2 {
    margin: 0;

    color: #ffffff;

    font-size: 1.35rem;

    font-weight: 600;
}



/* =========================================================
   SERVICE LABEL
========================================================= */

.comparison-service {
    flex-shrink: 0;

    padding: 7px 9px;

    border:
        1px solid #383838;

    border-radius: 2px;

    color: #bcbcbc;

    font-size: 0.63rem;

    letter-spacing: 0.7px;

    text-transform: uppercase;
}



/* =========================================================
   VEHICLE
========================================================= */

.comparison-vehicle {
    margin:
        14px
        0
        0;

    display: flex;

    align-items: center;

    gap: 8px;

    color: #b3b3b3;

    font-size: 0.78rem;
}


.comparison-vehicle i {
    color: #ffffff;
}



/* =========================================================
   DESCRIPTION
========================================================= */

.comparison-description {
    margin:
        12px
        0
        0;

    color: #838383;

    font-size: 0.82rem;

    line-height: 1.65;
}



/* =========================================================
   EMPTY GALLERY
========================================================= */

.gallery-empty {
    padding: 100px 20px;

    border:
        1px solid #292929;

    text-align: center;
}


.gallery-empty i {
    display: block;

    margin-bottom: 18px;

    color: #777777;

    font-size: 2.5rem;
}


.gallery-empty h2 {
    margin-bottom: 7px;

    color: #ffffff;

    text-transform: uppercase;
}


.gallery-empty p {
    color: #888888;
}



/* =========================================================
   SECTION SPLITTER

   Separates Before / After from the carousels.
========================================================= */

.gallery-section-divider {
    width: 100%;

    height: 1px;

    margin: 55px 0;

    background: #242424;
}



/* =========================================================
   CAROUSEL GRID

   Same two-column layout and same 22px gap.
========================================================= */

.gallery-carousel-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;
}



/* =========================================================
   CAROUSEL CARD

   Same styling as original comparison card.
========================================================= */

.gallery-carousel-card {
    overflow: hidden;

    background: #0c0c0c;

    border: 1px solid #303030;

    border-radius: 4px;
}



/* =========================================================
   CAROUSEL IMAGE AREA

   Exact same 16 / 10 ratio.
========================================================= */

.gallery-carousel-stage {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 10;

    overflow: hidden;

    background: #111111;

    user-select: none;
}



/* =========================================================
   CAROUSEL SLIDES
========================================================= */

.gallery-carousel-slide {
    position: absolute;

    inset: 0;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.45s ease,
        visibility 0.45s ease;
}


.gallery-carousel-slide.gallery-carousel-active {
    opacity: 1;

    visibility: visible;
}



/* =========================================================
   CAROUSEL IMAGE
========================================================= */

.gallery-carousel-slide img {
    width: 100%;

    height: 100%;

    display: block;

    object-fit: cover;

    object-position: center;

    user-select: none;

    pointer-events: none;
}



/* =========================================================
   SAME DARK OVERLAY
========================================================= */

.gallery-carousel-stage::after {
    content: "";

    position: absolute;

    inset: 0;

    z-index: 2;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.22) 0%,
            transparent 25%,
            transparent 70%,
            rgba(0, 0, 0, 0.18) 100%
        );
}



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

   Same silver design as slider handle.
========================================================= */

.gallery-carousel-button {
    position: absolute;

    top: 50%;

    z-index: 5;

    width: 50px;
    height: 50px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0;

    background:
        linear-gradient(
            135deg,
            #eeeeee,
            #a7a7a7
        );

    border:
        2px solid #ffffff;

    border-radius: 50%;

    color: #080808;

    cursor: pointer;

    transform:
        translateY(-50%);

    box-shadow:
        0 4px 18px
        rgba(0, 0, 0, 0.45);
}


.gallery-carousel-button i {
    font-size: 0.8rem;
}


.gallery-carousel-prev {
    left: 16px;
}


.gallery-carousel-next {
    right: 16px;
}



/* =========================================================
   CAROUSEL PLACEHOLDER
========================================================= */

.gallery-carousel-placeholder {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #777777;

    font-size: 2.5rem;
}



/* =========================================================
   BOTTOM CTA
========================================================= */

.gallery-cta {
    margin-top: 28px;

    padding: 35px;

    display: flex;

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

    gap: 35px;

    background:
        linear-gradient(
            110deg,
            #0d0d0d,
            #151515
        );

    border:
        1px solid #333333;

    border-radius: 4px;
}


.gallery-cta-eyebrow {
    margin:
        0
        0
        7px;

    color: #737373;

    font-size: 0.65rem;

    font-weight: 700;

    letter-spacing: 2px;

    text-transform: uppercase;
}


.gallery-cta-content h2 {
    margin:
        0
        0
        5px;

    color: #ffffff;

    font-size:
        clamp(
            1.4rem,
            2.5vw,
            2.2rem
        );

    text-transform: uppercase;
}


.gallery-cta-content p {
    margin: 0;

    color: #929292;
}



/* =========================================================
   SILVER QUOTE BUTTON
========================================================= */

.gallery-quote-button {
    min-width: 225px;

    padding: 16px 22px;

    display: flex;

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

    gap: 30px;

     background: #ffffff;

    border: 1px solid #ffffff;

    border-radius: 2px;

    color: #080808;

    font-size: 1rem;

    font-weight: 700;

    letter-spacing: 1px;

    text-decoration: none;

    text-transform: uppercase;

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


.gallery-quote-button:hover {
    transform:
        translateY(-2px);

    filter:
        brightness(1.08);
}



/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

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


    .gallery-carousel-grid {
        grid-template-columns: 1fr;
    }


    .gallery-cta {
        align-items: flex-start;

        flex-direction: column;
    }


    .gallery-quote-button {
        width: 100%;
    }

}



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

@media (max-width: 600px) {

    .gallery-page {
        padding-top: 25px;
    }


    .gallery-container {
        width: 92%;
    }


    .gallery-heading {
        margin-bottom: 30px;
    }


    .gallery-heading h1 {
        font-size: 2.6rem;
    }


    .before-after {
        aspect-ratio: 4 / 3;
    }


    .gallery-carousel-stage {
        aspect-ratio: 4 / 3;
    }


    .comparison-label {
        top: 10px;

        padding: 6px 8px;

        font-size: 0.58rem;
    }


    .comparison-label-before {
        left: 10px;
    }


    .comparison-label-after {
        right: 10px;
    }


    .comparison-handle {
        width: 44px;

        height: 44px;
    }


    .gallery-carousel-button {
        width: 44px;

        height: 44px;
    }


    .gallery-carousel-prev {
        left: 10px;
    }


    .gallery-carousel-next {
        right: 10px;
    }


    .comparison-content {
        padding: 18px;
    }


    .comparison-heading-row {
        flex-direction: column;

        gap: 12px;
    }


    .gallery-section-divider {
        margin: 40px 0;
    }


    .gallery-cta {
        padding: 25px;
    }

}