/*
 * Banner system shared by every store theme (hero slides, promo tiles, offer
 * banners). Built on banner-design rules:
 *  - one clear reading order: eyebrow -> headline -> one line of copy -> one CTA
 *  - headline at least 26-32px, body at least 15-16px
 *  - one call-to-action per banner, a real button, at least 44px tall, action verb
 *  - text kept inside a safe zone and on a shade so contrast stays >= 4.5:1
 *    on any photo
 * Colours come from the active theme (primary + its readable text colour).
 */

:root {
    --sf-cta-bg: var(--theme-color-primary, #0077c0);
    --sf-cta-fg: var(--theme-color-text-inverse, #fff);
    --sf-banner-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- The one CTA button ---------- */

html[data-theme] .sf-banner-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--sf-cta-bg);
    color: var(--sf-cta-fg);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s var(--sf-banner-ease), box-shadow 0.25s var(--sf-banner-ease), filter 0.2s;
}

html[data-theme] .sf-banner-cta:hover,
html[data-theme] .sf-banner-cta:focus-visible {
    color: var(--sf-cta-fg);
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 14px 26px -12px rgba(0, 0, 0, 0.6);
}

html[data-theme] .sf-banner-cta:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

html[data-theme] .sf-banner-cta .bi {
    font-size: 1.05em;
    transition: transform 0.25s var(--sf-banner-ease);
}

html[dir="ltr"] .sf-banner-cta .bi { transform: scaleX(-1); }
html[dir="rtl"] .sf-banner-cta:hover .bi { transform: translateX(-3px); }
html[dir="ltr"] .sf-banner-cta:hover .bi { transform: scaleX(-1) translateX(-3px); }

/* Light variant for dark / coloured banners */
html[data-theme] .sf-banner-cta.is-light {
    background: #fff;
    color: #111827;
}

/* ---------- Hero slide with its own text ---------- */

html[data-theme] .sf-copy-slide {
    position: relative;
    display: block !important;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    padding: 0 !important;
}

html[data-theme] .sf-slide-shade {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    /* Safe zone: keep copy away from the rounded edges and the dots */
    padding: clamp(22px, 5%, 64px) clamp(22px, 6%, 80px);
    background: linear-gradient(to right, rgba(10, 14, 24, 0.78) 0%, rgba(10, 14, 24, 0.5) 42%, rgba(10, 14, 24, 0) 72%);
}

html[dir="rtl"] .sf-slide-shade {
    background: linear-gradient(to left, rgba(10, 14, 24, 0.78) 0%, rgba(10, 14, 24, 0.5) 42%, rgba(10, 14, 24, 0) 72%);
}

html[data-theme] .sf-slide-copy {
    max-width: min(560px, 62%);
    color: #fff;
    text-align: start;
}

html[data-theme] .sf-slide-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--sf-cta-bg);
    color: var(--sf-cta-fg);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

html[data-theme] .sf-slide-title {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(26px, 3.3vw, 50px);
    font-weight: 800;
    line-height: 1.18;
    text-wrap: balance;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

html[data-theme] .sf-slide-text {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(15px, 1.25vw, 18px);
    line-height: 1.6;
    max-width: 440px;
}

/* Copy rises in when its slide becomes active */
@media (prefers-reduced-motion: no-preference) {
    .swiper-slide-active .sf-slide-copy > * {
        animation: sf-banner-rise 0.7s var(--sf-banner-ease) both;
    }
    .swiper-slide-active .sf-slide-copy > :nth-child(2) { animation-delay: 0.08s; }
    .swiper-slide-active .sf-slide-copy > :nth-child(3) { animation-delay: 0.16s; }
    .swiper-slide-active .sf-slide-copy > :nth-child(4) { animation-delay: 0.24s; }
}

@keyframes sf-banner-rise {
    from { opacity: 0; transform: translateY(16px); }
}

/* Slides with copy need room for it on small screens */
@media (max-width: 767.98px) {
    html[data-theme] .sf-copy-slide { min-height: 300px; aspect-ratio: auto !important; }
    html[data-theme] .sf-slide-shade,
    html[dir="rtl"] .sf-slide-shade {
        align-items: flex-end;
        padding: 20px 20px 34px;
        background: linear-gradient(to top, rgba(10, 14, 24, 0.85) 0%, rgba(10, 14, 24, 0.55) 50%, rgba(10, 14, 24, 0.05) 100%);
    }
    html[data-theme] .sf-slide-copy { max-width: 100%; }
    html[data-theme] .sf-slide-eyebrow { margin-bottom: 10px; font-size: 12px; }
    html[data-theme] .sf-slide-text { margin-bottom: 16px; }
    html[data-theme] .sf-banner-cta { min-height: 44px; padding: 0 20px; font-size: 14px; }
}

/* ---------- Promo tiles & offer banners: CTA as a real button ---------- */

/* Shared look for the "Shop now" line inside a card banner (the whole card is the link) */
html[data-theme] .sf-promo-cta,
html[data-theme="tekno"] .tk-mini-banner em,
html[data-theme="tekno"] .tk-banner-text em,
html[data-theme="glow"] .gl-promo em {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    margin-top: 12px;
    padding: 0 18px;
    border-radius: 999px;
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-decoration: none !important;
    transition: transform 0.25s var(--sf-banner-ease), box-shadow 0.25s var(--sf-banner-ease);
}

html[data-theme] a:hover .sf-promo-cta,
html[data-theme="tekno"] a:hover em,
html[data-theme="glow"] .gl-promo:hover em {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.55);
}

/* Default / light themes: primary tile gets a white button, light tile a primary one */
html[data-theme] .sf-promo-tile .sf-promo-cta {
    background: #fff;
    color: #111827;
}

html[data-theme] .sf-promo-tile.is-alt .sf-promo-cta {
    background: var(--sf-cta-bg);
    color: var(--sf-cta-fg);
}

html[data-theme] .sf-promo-tile {
    position: relative;
    overflow: hidden;
    padding: 1.15rem 1.5rem;
    gap: 0.3rem;
    isolation: isolate;
}

/* Soft geometric accent in the free corner (no text there) */
html[data-theme] .sf-promo-tile::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset-inline-end: -60px;
    bottom: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
}

html[data-theme] .sf-promo-tile.is-alt::after {
    display: none;
}

/* Copy stays on one line so both tiles fit beside the slider */
html[data-theme] .sf-promo-tile .sf-promo-text {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html[data-theme] .sf-promo-tile .sf-promo-cta {
    margin-top: 8px;
}

html[data-theme] .sf-promo-tile .sf-promo-title {
    font-size: clamp(1.3rem, 1rem + 0.7vw, 1.6rem);
    font-weight: 800;
}

html[data-theme] .sf-promo-tile .sf-promo-tag {
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
}

/* Light tile: dark text keeps 4.5:1 on any primary colour */
html[data-theme] .sf-promo-tile.is-alt,
html[data-theme] .sf-promo-tile.is-alt:hover {
    color: var(--theme-color-text);
}

html[data-theme] .sf-promo-tile.is-alt .sf-promo-tag {
    color: color-mix(in srgb, var(--theme-color-primary) 70%, #000);
}

html[data-theme] .sf-promo-tile.is-alt .sf-promo-text {
    color: var(--theme-color-text-muted);
    opacity: 1;
}

/* Tekno: dark pill (yellow accent stays for the main CTA) */
html[data-theme="tekno"] .tk-mini-banner em,
html[data-theme="tekno"] .tk-banner-text em {
    background: var(--tk-dark);
    color: #fff;
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

html[data-theme="tekno"] .tk-mini-banner strong { font-size: 22px; font-weight: 700; }
html[data-theme="tekno"] .tk-banner-text strong { font-size: 26px; font-weight: 700; }

/* Glow: accent pill */
html[data-theme="glow"] .gl-promo em {
    background: var(--gl-accent);
    color: var(--gl-on-accent);
}

html[data-theme="glow"] .gl-promo small {
    letter-spacing: 0;
    font-weight: 700;
}

/* Hyper hero side tile: product keeps its real colours, darker base for white text */
html[data-theme="hyper"] .hy-hero-side {
    background:
        radial-gradient(circle at 75% 85%, rgba(255, 255, 255, 0.35), transparent 50%),
        linear-gradient(160deg, var(--hy-cyan) 0%, color-mix(in srgb, var(--hy-cyan) 55%, var(--hy-navy)) 100%);
}

html[data-theme="hyper"] .hy-hero-side img {
    mix-blend-mode: normal;
    filter: drop-shadow(0 22px 24px rgba(10, 20, 50, 0.35));
    border-radius: 0;
}

html[data-theme="hyper"] .hy-hero-side-title,
html[data-theme="hyper"] .hy-hero-side-big {
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

html[data-theme="hyper"] .hy-hero-side-cta {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    margin-top: auto;
}

@media (max-width: 991.98px) {
    /* Room for the button under the big number */
    html[data-theme="hyper"] .hy-hero-side:not(.is-image) { aspect-ratio: auto; min-height: 220px; }
    html[data-theme="hyper"] .hy-hero-side-cta { margin-top: 14px; }
}

/* ---------- Phones ---------- */
@media (max-width: 767.98px) {
    /* Hyper keeps a wide fixed ratio: let it grow when a slide carries text */
    html[data-theme="hyper"] .hy-hero-main:has(.sf-copy-slide) { aspect-ratio: auto; }
    html[data-theme="hyper"] .hy-hero-main:has(.sf-copy-slide) .swiper { height: auto; }
    html[data-theme="hyper"] .hy-hero-main .sf-copy-slide { height: 300px !important; min-height: 300px; }

    html[data-theme] .sf-slide-title { font-size: 24px; }

    html[data-theme] .sf-promo-tile { padding: 14px 14px 16px; }
    html[data-theme] .sf-promo-tile .sf-promo-title { font-size: 1.15rem; }
    html[data-theme] .sf-promo-tile .sf-promo-cta {
        min-height: 38px;
        padding: 0 14px;
        font-size: 13px;
        white-space: nowrap;
    }
}
