/* ===================================================================
   Offer badge
   ===================================================================
   The "25% OFF" flash on a car photo, plus the was/now prices that go
   with it. Rendered by includes/offer-badge.php.

   Plain CSS, not Tailwind classes, so it looks identical whether the
   page is running on the Tailwind CDN or the built stylesheet, and a
   rebuild can't quietly drop a class it didn't see used.

   The look: a brass gradient tile with the brand's ink text on it, a
   soft shadow to lift it off the photo, and a slow shine that sweeps
   across every few seconds so it catches the eye without flashing.
   =================================================================== */

.offer-badge {
    position: absolute;
    z-index: 3;
    top: 14px;
    inset-inline-end: 14px;

    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;

    padding: 7px 11px;
    border-radius: 12px;

    background: linear-gradient(140deg, #dd8a8c 0%, #a3282c 46%, #a3282c 100%);
    color: #17130A;

    font-family: Archivo, Inter, system-ui, sans-serif;
    line-height: 1;
    text-align: center;
    white-space: nowrap;

    box-shadow:
        0 2px 4px rgba(15, 17, 19, .18),
        0 8px 18px rgba(15, 17, 19, .22),
        inset 0 1px 0 rgba(255, 255, 255, .45);

    /* Clips the shine sweep below. */
    overflow: hidden;
    pointer-events: none;
}

/* The sweep. */
.offer-badge::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    background: linear-gradient(100deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, .55) 50%,
        rgba(255, 255, 255, 0) 100%);
    transform: skewX(-18deg);
    animation: offer-badge-shine 4.5s ease-in-out infinite;
}

@keyframes offer-badge-shine {
    0%        { inset-inline-start: -60%; }
    45%, 100% { inset-inline-start: 130%; }
}

/* Anyone who has asked their device to cut down on motion gets a still badge. */
@media (prefers-reduced-motion: reduce) {
    .offer-badge::after {
        animation: none;
        opacity: 0;
    }
}

.offer-badge__pct {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.offer-badge__word {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .82;
}

/* A custom label with no percentage in it, e.g. "SUMMER DEAL". */
.offer-badge__word--solo {
    font-size: 11px;
    letter-spacing: .1em;
    opacity: 1;
    max-width: 12ch;
    white-space: normal;
    line-height: 1.25;
}

/* ---- Large: the main photo on a car page ---- */
.offer-badge--lg {
    top: 18px;
    inset-inline-end: 18px;
    padding: 11px 16px;
    border-radius: 16px;
}

.offer-badge--lg .offer-badge__pct {
    font-size: 26px;
}

.offer-badge--lg .offer-badge__word {
    font-size: 11px;
    letter-spacing: .16em;
}

.offer-badge--lg .offer-badge__word--solo {
    font-size: 14px;
    max-width: 14ch;
}

/* Arabic sets no wider than the Latin default; the badge already mirrors
   to the other corner via inset-inline-end. */
[dir="rtl"] .offer-badge__word {
    letter-spacing: 0;
}

/* ---- Was / now prices ---- */
.offer-was {
    text-decoration: line-through;
    opacity: .5;
    font-weight: 600;
    font-size: .82em;
    margin-inline-end: 6px;
}

.offer-now {
    font-weight: 800;
    color: #7d1214;
}

.offer-suffix {
    font-size: .78em;
    opacity: .6;
    margin-inline-start: 2px;
}

/* A small "Offer ends 30 Aug" note. */
.offer-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(163, 40, 44, .14);
    color: #6d0b0d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

/* ---- Phones ---- */
@media (max-width: 480px) {
    .offer-badge {
        top: 10px;
        inset-inline-end: 10px;
        padding: 6px 9px;
    }

    .offer-badge__pct {
        font-size: 15px;
    }

    .offer-badge--lg {
        top: 12px;
        inset-inline-end: 12px;
        padding: 9px 13px;
    }

    .offer-badge--lg .offer-badge__pct {
        font-size: 21px;
    }
}
