/* ==========================================================================
   premium.css — high-production interactive layer for Amerivet Clean.

   The conversion thesis: a buyer who drags a divider across a filthy house and
   reveals a clean one understands the value faster than any paragraph of copy.
   Everything here supports that moment; nothing competes with the quote form,
   the phone CTA, or the existing 3D layers.

   Contents:
     1. Before/after drag reveal (the centrepiece)
     2. Stat counters that count up on entry
     3. Premium section framing + gold/veteran accent
     4. Scroll-progress rail
     5. Mobile + reduced-motion parity
   ========================================================================== */

:root {
    --avp-gold: #d4a017;
    --avp-gold-soft: #f0c64b;
    --avp-ink: #0b1220;
    --avp-edge: rgba(255, 255, 255, 0.10);
}

/* ---------- 1. BEFORE / AFTER DRAG REVEAL ------------------------------ */

.avp-compare {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    /* Isolate so the clipping stays cheap and GPU-composited. */
    isolation: isolate;
    background: #0f172a;
    box-shadow:
        0 30px 80px rgba(11, 18, 32, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    cursor: ew-resize;
    touch-action: pan-y;   /* let the page scroll vertically; capture horizontal */
    -webkit-user-select: none;
    user-select: none;
}

/* Both layers fill the frame. The "after" is the base; "before" is clipped. */
.avp-compare__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Same object-position on both so the two photos align pixel-for-pixel. */
    object-position: center;
}

.avp-compare__after {
    z-index: 1;
}

.avp-compare__before {
    z-index: 2;
    /* --avp-split (0..1) is written by premium.js */
    clip-path: inset(0 calc((1 - var(--avp-split, 0.5)) * 100%) 0 0);
    will-change: clip-path;
}

/* The divider line + grab handle. */
.avp-compare__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--avp-split, 0.5) * 100%);
    width: 3px;
    margin-left: -1.5px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        var(--avp-gold-soft) 50%,
        rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 0 18px rgba(240, 198, 75, 0.75);
    z-index: 3;
    pointer-events: none;
    will-change: left;
}

.avp-compare__grip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(11, 18, 32, 0.72);
    border: 2px solid var(--avp-gold-soft);
    display: grid;
    place-items: center;
    gap: 0;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.avp-compare__grip span {
    display: block;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.avp-compare__grip span:first-child {
    border-right: 9px solid var(--avp-gold-soft);
    margin-right: 3px;
}

.avp-compare__grip span:last-child {
    border-left: 9px solid var(--avp-gold-soft);
    margin-left: 3px;
}

/* Corner tags. */
.avp-compare__tag {
    position: absolute;
    bottom: 18px;
    z-index: 4;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    pointer-events: none;
}

.avp-compare__tag--before {
    left: 18px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(239, 68, 68, 0.55);
    color: #fca5a5;
}

.avp-compare__tag--after {
    right: 18px;
    background: rgba(6, 78, 59, 0.78);
    border: 1px solid rgba(16, 185, 129, 0.55);
    color: #6ee7b7;
}

.avp-compare__hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #cbd5e1;
    background: rgba(11, 18, 32, 0.7);
    border: 1px solid var(--avp-edge);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.avp-compare.is-dragged .avp-compare__hint {
    opacity: 0;
}

/* ---------- 2. STAT COUNTERS ------------------------------------------ */

/* Own full-width band. Previously these were injected inside .trust-container
   (a flex row), which squeezed them into a single narrow column and clipped the
   last item off-screen. A dedicated section guarantees the grid has room. */
.avp-stats-band {
    padding: 3rem 1.25rem 3.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.avp-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1180px;
    margin: 0 auto;
}

.avp-stat {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.avp-stat__num {
    display: block;
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1.5px;
    /* Blue -> deep blue. The previous white->gold gradient rendered almost
       white on a white card and was effectively invisible. */
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #1d4ed8; /* fallback for browsers without background-clip:text */
    font-variant-numeric: tabular-nums;
}

.avp-stat__label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
}

/* ---------- 3. PREMIUM FRAMING ---------------------------------------- */

/* A gold hairline that signals craft, used sparingly. */
.avp-rule {
    height: 1px;
    border: 0;
    margin: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 160, 23, 0.55) 50%,
        transparent 100%);
}

/* Section eyebrow label above a heading. */
.avp-eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--avp-gold-soft);
    margin-bottom: 0.65rem;
}

/* ---------- 4. SCROLL PROGRESS RAIL ---------------------------------- */

.avp-rail {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(var(--avp-progress, 0));
    background: linear-gradient(90deg, #3b82f6, var(--avp-gold-soft));
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
}

/* ---------- 5. GALLERY CARDS: lift + gold hairline on hover ----------- */

.avp-premium .gallery-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--avp-edge);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
    will-change: transform;
}

.avp-premium .gallery-card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: rgba(212, 160, 23, 0.5);
    box-shadow: 0 26px 60px rgba(11, 18, 32, 0.5);
}

.avp-premium .gallery-card img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.avp-premium .gallery-card:hover img {
    transform: scale(1.06);
}

/* ---------- 6. TESTIMONIAL CARDS: premium quote treatment ------------- */

.avp-premium .testimonial {
    border-radius: 16px;
    border: 1px solid var(--avp-edge);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.4s ease;
}

.avp-premium .testimonial:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 160, 23, 0.42);
}

/* Oversized gold quote mark for a crafted feel. */
.avp-premium .testimonial-text::before {
    content: '\201C';
    display: block;
    font-size: 3.4rem;
    line-height: 0.72;
    font-weight: 900;
    color: var(--avp-gold);
    opacity: 0.5;
    margin-bottom: 0.35rem;
}

/* ---------- 7. CTA EMPHASIS ------------------------------------------- */

.avp-premium .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #b8860b 190%);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.4);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s ease;
}

.avp-premium .btn-primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 20px 46px rgba(37, 99, 235, 0.52);
}

/* ---------- 8. SCROLL PROGRESS RAIL / REDUCED MOTION / MOBILE -------- */

@media (prefers-reduced-motion: reduce) {
    .avp-compare__hint {
        transition: none;
    }

    .avp-premium .gallery-card,
    .avp-premium .gallery-card img,
    .avp-premium .testimonial,
    .avp-premium .btn-primary {
        transition: none;
        transform: none;
    }

    .avp-premium .gallery-card:hover,
    .avp-premium .testimonial:hover,
    .avp-premium .btn-primary:hover {
        transform: none;
    }

    .avp-rail {
        display: none;
    }
}

@media (max-width: 768px) {
    .avp-compare {
        aspect-ratio: 4 / 3;
    }

    .avp-compare__grip {
        width: 46px;
        height: 46px;
    }

    .avp-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
    }

    .avp-stat {
        padding: 1.15rem 0.6rem;
    }

    .avp-stats-band {
        padding: 2.25rem 1rem 2.5rem;
    }

    .avp-stat__label {
        font-size: 0.7rem;
        letter-spacing: 0.06em;
    }

    /* No hover lift on touch. */
    .avp-premium .gallery-card:hover,
    .avp-premium .testimonial:hover,
    .avp-premium .gallery-card:hover img {
        transform: none;
    }
}


/* ---------- 9. GOOGLE REVIEW PRESENTATION ---------------------------- */

/* Per-review star row inside each testimonial card. */
.avp-review-stars {
    display: block;
    color: #f0c64b;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.65rem;
    line-height: 1;
}

/* The testimonial is now a <figure>, so the default margins must go. */
.avp-premium figure.testimonial {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.avp-premium figure.testimonial figcaption {
    margin-top: auto;
    padding-top: 0.9rem;
}

/* Author and location are separate lines, not one wrapping blob. */
.avp-premium figure.testimonial .testimonial-author,
.avp-premium figure.testimonial .testimonial-location {
    display: block;
}

.avp-premium figure.testimonial .testimonial-text {
    margin: 0;
    flex: 1 1 auto;
}

/* Header badge: the 61-review proof point, placed above the cards. */
.avp-review-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.9rem;
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.avp-review-badge__stars {
    color: #f0c64b;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    line-height: 1;
}

.avp-review-badge__count {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.01em;
}

.avp-review-badge__count strong {
    color: #0f172a;
    font-weight: 800;
}

/* ---------- 10. FIRST-SERVICE UPGRADE STRIP --------------------------- */

/* Replaces the old fire-engine red "$75 OFF" banner. Same offer value,
   repositioned as generosity rather than discount, so it supports the premium
   positioning the rest of the page builds instead of undercutting it. */

#promo-banner {
    position: sticky;
    top: 0;
    z-index: 9999;
    font-family: inherit;
}

.avp-promo {
    background:
        linear-gradient(135deg, #0b1220 0%, #132033 55%, #1d3049 100%);
    border-bottom: 1px solid rgba(212, 160, 23, 0.38);
    box-shadow: 0 2px 18px rgba(11, 18, 32, 0.28);
}

.avp-promo__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.avp-promo__lead {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.avp-promo__eyebrow {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #c9a227;
}

.avp-promo__headline {
    font-size: 1.06rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* The dollar figure is the one bright moment in the strip. */
.avp-promo__amount {
    color: #f0c64b;
    font-weight: 900;
    font-size: 1.15em;
    padding: 0 0.06em;
}

.avp-promo__tail {
    font-weight: 600;
    color: #cbd5e1;
    font-size: 0.9em;
}

.avp-promo__actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.avp-promo__cap {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    white-space: nowrap;
}

.avp-promo__cap strong {
    color: #f0c64b;
    font-weight: 900;
}

.avp-promo__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    background: linear-gradient(135deg, #f0c64b 0%, #d4a017 100%);
    color: #0b1220;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    padding: 0.6rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(212, 160, 23, 0.32);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease,
                filter 0.25s ease;
}

.avp-promo__cta:hover,
.avp-promo__cta:focus-visible {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 8px 22px rgba(212, 160, 23, 0.45);
    filter: brightness(1.06);
}

.avp-promo__cta:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.avp-promo__phone {
    font-size: 0.95em;
}

/* Slimmer than the old 87px red bar, so less vertical real estate is taken. */
@media (max-width: 768px) {
    .avp-promo__inner {
        padding: 0.55rem 1rem;
        gap: 0.5rem;
        justify-content: center;
        text-align: center;
    }

    .avp-promo__lead {
        align-items: center;
    }

    .avp-promo__headline {
        font-size: 0.95rem;
    }

    .avp-promo__actions {
        gap: 0.6rem;
        justify-content: center;
    }

    .avp-promo__cta {
        font-size: 0.85rem;
        padding: 0.55rem 1rem;
    }

    .avp-promo__cap {
        font-size: 0.66rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .avp-promo__cta {
        transition: none;
    }

    .avp-promo__cta:hover,
    .avp-promo__cta:focus-visible {
        transform: none;
    }
}


/* ---------- 11. CLICKABILITY GUARD ------------------------------------ */

/* Belt-and-braces: the service link must always win the hit test inside its
   card, whatever the 3D layers are doing to the container. */
.avp-premium .service-card {
    position: relative;
    isolation: isolate;
}

.avp-premium .service-link {
    position: relative;
    z-index: 3;
}

.avp-premium .service-card > * {
    position: relative;
    z-index: 1;
}
