/* ============================================================
sale_hero.css — Sale Offers Hero Carousel
Drop this file alongside style.css.
Uses ONLY CSS variables defined in style.css — no new colours.
============================================================ */
/* ---- Ticker Bar ---- */
.sale-ticker {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-dark));
    background-size: 200% 100%;
    animation: saleTickerShift 8s linear infinite;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    overflow: hidden;
    height: 36px;
    display: flex;
    align-items: center;
}
@keyframes saleTickerShift { 0%{background-position:0%} 100%{background-position:200%} }
.sale-ticker-track {
    display: flex;
    white-space: nowrap;
    animation: saleTickerScroll 28s linear infinite;
}
.sale-ticker-track span {
    padding: 0 40px;
    flex-shrink: 0;
}
.sale-ticker-track span::before { content: "🔥 "; }
@keyframes saleTickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
/* ---- Hero Wrapper ---- */
.sale-hero {
    position: relative;
    width: 100%;
    height: calc(120vh - 90px);
    min-height: 520px;
    max-height: 820px;
    overflow: hidden;
    background: var(--text-primary);
}
/* ---- Slides ---- */
.sale-track {
    position: relative;
    width: 100%;
    height: 100%;
}
.sale-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
    overflow: hidden;
}
.sale-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}
/* Background image with Ken Burns */
.sale-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover; /* Default for desktop */
    background-position: center;
    transform: scale(1.06);
    transition: transform 7.5s ease;
}
.sale-slide.is-active .sale-slide-bg {
    transform: scale(1);
}
/* Overlay gradient */
.sale-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        108deg,
        rgba(17,24,39,0.88) 0%,
        rgba(17,24,39,0.56) 48%,
        rgba(17,24,39,0.08) 100%
    );
}
/* ---- Content Panel ---- */
.sale-content {
    position: relative;
    z-index: 10;
    padding: 0 80px;
    max-width: 620px;
    display: flex;
    flex-direction: column;
}
/* Eyebrow */
.sale-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37,99,235,0.18);
    border: 1px solid rgba(37,99,235,0.4);
    color: rgba(255,255,255,0.85);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
    width: fit-content;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease 0.05s, transform 0.5s ease 0.05s;
}
.sale-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: salePulse 1.6s ease infinite;
    flex-shrink: 0;
}
@keyframes salePulse {
    0%,100%{ opacity:1; transform:scale(1); }
    50%{ opacity:0.4; transform:scale(0.65); }
}
.sale-slide.is-active .sale-eyebrow {
    opacity: 1;
    transform: translateY(0);
}
/* Discount badge */
.sale-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 14px;
    width: fit-content;
    box-shadow: 0 4px 18px rgba(239,68,68,0.42);
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.5s ease 0.18s, transform 0.5s ease 0.18s;
}
.sale-badge-pill.hidden { display: none; }
.sale-slide.is-active .sale-badge-pill {
    opacity: 1;
    transform: translateX(0);
}
/* Headline */
.sale-headline {
    font-size: clamp(1.9rem, 4.2vw, 3.5rem);
    font-weight: 900;
    line-height: 1.08;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease 0.28s, transform 0.55s ease 0.28s;
}
.sale-slide.is-active .sale-headline {
    opacity: 1;
    transform: translateY(0);
}
/* Subtitle */
.sale-subtitle {
    font-size: clamp(0.88rem, 1.5vw, 1.02rem);
    color: rgba(255,255,255,0.76);
    line-height: 1.68;
    margin-bottom: 32px;
    max-width: 460px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease 0.38s, transform 0.5s ease 0.38s;
}
.sale-slide.is-active .sale-subtitle {
    opacity: 1;
    transform: translateY(0);
}
/* CTA buttons */
.sale-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease 0.48s, transform 0.5s ease 0.48s;
}
.sale-slide.is-active .sale-actions {
    opacity: 1;
    transform: translateY(0);
}
.sale-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.93rem;
    font-weight: 700;
    padding: 14px 30px;
    border-radius: var(--radius-full);
    text-decoration: none;
    border: 2px solid var(--primary);
    box-shadow: 0 6px 22px rgba(37,99,235,0.42);
    transition: background 0.2s, border-color 0.2s, transform 0.18s, box-shadow 0.18s;
}
.sale-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37,99,235,0.52);
}
.sale-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    font-size: 0.93rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    text-decoration: none;
    border: 2px solid rgba(255,255,255,0.38);
    transition: background 0.2s, border-color 0.2s, transform 0.18s;
}
.sale-btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.75);
    transform: translateY(-2px);
}
/* ---- Thumbnail strip ---- */
.sale-thumbs {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}
.sale-thumb {
    width: 68px;
    height: 90px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
    opacity: 0.44;
    transition: opacity 0.25s, border-color 0.25s, transform 0.25s;
    flex-shrink: 0;
}
.sale-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sale-thumb.is-active,
.sale-thumb:hover {
    opacity: 1;
    border-color: var(--primary);
    transform: scale(1.07);
}
/* ---- Navigation Controls ---- */
.sale-controls {
    position: absolute;
    bottom: 36px;
    left: 80px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 30;
}
.sale-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.sale-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.08);
}
/* Dot indicators */
.sale-dots { display: flex; gap: 7px; align-items: center; }
.sale-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.32);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, width 0.3s, border-radius 0.3s;
    flex-shrink: 0;
}
.sale-dot.is-active {
    background: var(--primary);
    width: 28px;
    border-radius: 4px;
}
/* Progress bar */
.sale-progress {
    position: absolute;
    top: 0; left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 100;
    width: 0%;
    transition: none;
}
.sale-progress.running {
    width: 100%;
    transition: width 7s linear;
}
/* Slide counter */
.sale-counter {
    position: absolute;
    bottom: 44px;
    right: 80px;
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    z-index: 30;
    font-variant-numeric: tabular-nums;
    user-select: none;
}
.sale-counter .cur {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}
/* ---- Stats strip ---- */
.sale-stats-strip {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 80px;
    display: flex;
    align-items: stretch;
}
.sale-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 32px 18px 0;
    flex: 1;
    border-right: 1px solid var(--border);
}
.sale-stat:last-child { border-right: none; padding-right: 0; }
.sale-stat:first-child { padding-left: 0; }
.sale-stat-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: var(--radius);
    background: rgba(37,99,235,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
}
.sale-stat-text strong {
    display: block;
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--text-primary);
}
.sale-stat-text span {
    font-size: 0.78rem;
    color: var(--text-muted);
}
/* ============================================================
RESPONSIVE
============================================================ */
@media (min-width: 1600px) {
    /* Lock hero height to the exact 3:2 aspect ratio of the 1536×1024 images
       so nothing is ever cropped from the top or bottom on wide screens. */
    .sale-hero {
        height: auto;
        aspect-ratio: 3 / 2;   /* 1536 ÷ 1024 = 1.5  →  3:2 */
        max-height: none;       /* lift the 820px cap that would re-crop the image */
    }

    .sale-slide-bg {
        background-size: cover;
        background-position: center center;
    }

    /* Give the content panel a bit more breathing room on ultra-wide viewports */
    .sale-content      { padding: 0 120px; max-width: 720px; }
    .sale-controls     { left: 120px; bottom: 48px; }
    .sale-counter      { right: 120px; bottom: 56px; }
    .sale-stats-strip  { padding: 0 120px; }
}

@media (max-width: 1100px) {
    .sale-content { padding: 0 56px; }
    .sale-controls { left: 56px; }
    .sale-counter  { right: 56px; }
    .sale-stats-strip { padding: 0 56px; }
}

/* ---- MOBILE & TABLET FIXES ---- */
@media (max-width: 900px) {
    /* 1. Adjust Hero Height to match image aspect ratio (1536/1024 = 1.5) */
    /* This ensures the full image fits without being cut off by the container height */
    .sale-hero {
        height: auto;
        aspect-ratio: 1.5; /* 3:2 ratio for 1536x1024 images */
        min-height: 320px; /* Minimum height for usability */
        max-height: none;
    }

    /* 2. Show Full Image */
    .sale-slide-bg {
        background-size: contain;
        background-position: center center;
        background-repeat: no-repeat;
        background-color: var(--surface); /* Fills empty space if any */
    }

    .sale-thumbs { display: none; }
    .sale-content { padding: 0 28px; max-width: 100%; }

    /* 3. Hide Navigation Arrows */
    .sale-arrow {
        display: none;
    }

    /* 4. Center Dots and Adjust Spacing */
    .sale-controls {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        gap: 10px;
    }

    .sale-counter {
        position: absolute;
        bottom: 20px;
        right: 20px; /* Counter stays on the right */
        font-size: 0.72rem;
    }
    
    .sale-stats-strip { padding: 0 20px; flex-wrap: wrap; }
    .sale-stat {
        flex: 1 0 45%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 14px 10px;
    }
    .sale-stat:nth-child(3),
    .sale-stat:nth-child(4) { border-bottom: none; }
}

@media (max-width: 600px) {
    /* Consistent fixes for smaller mobile screens */
    .sale-hero {
        height: auto;
        aspect-ratio: 1.5;
        min-height: 280px;
    }
    .sale-eyebrow {font-size: 0.45rem;
    font-weight: 900;}
    
    .sale-badge-pill { font-size: 0.5rem;
    font-weight: 800;}

    .sale-slide-bg {
        background-size: contain;
        background-position: center center;
    }

    .sale-headline { font-size: .75rem; }
    .sale-subtitle { font-size: 0.50rem; margin-bottom: 22px; }
    .sale-actions { gap: 10px; }
    .sale-btn-primary,
    .sale-btn-secondary { padding: 8px 12px; font-size: 0.50rem; }
    .sale-stats-strip { display: none; }
    .sale-content  { padding: 0 16px; }

    /* Ensure arrows are hidden and dots centered */
    .sale-arrow { display: none; }
    
    .sale-controls {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .sale-counter {
        bottom: 15px;
        right: 15px;
        font-size: 0.68rem;
    }
}
