/* ==========================================================================
   Brita Header Angebote – Frontend
   Variablen: --bha-accent, --bha-text werden inline vom Widget gesetzt.
   ========================================================================== */

.bha-stage {
    --bha-accent: #f2d9a0;
    --bha-text: #ffffff;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 16px 26px;
    box-sizing: border-box;
    width: 100%;
}

/* Inner-Container: nur im Scattered-Stil ein zentriertes Band, sonst wirkungslos */
.bha-inner { display: contents; }

/* ---- Motto / Schlagzeile ---- */
.bha-motto {
    position: relative;
    z-index: 4;
    text-align: center;
    max-width: 640px;
    margin-bottom: 16px;
    transform-origin: center;
}
.bha-motto__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--bha-accent);
}
.bha-motto__eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--bha-accent);
    display: inline-block;
}
.bha-motto__head {
    display: inline-block;
    position: relative;
    margin: 10px 0 0;
    color: var(--bha-text);
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}
.bha-accent-word { color: var(--bha-accent); }
.bha-swoosh {
    display: block;
    width: min(70%, 240px);
    height: 14px;
    margin: 4px auto 0;
    color: var(--bha-accent);
    overflow: visible;
}
.bha-motto__sub {
    margin: 12px 0 0;
    color: var(--bha-text);
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.5;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.22);
}

/* ---- Produktkarte (gemeinsam) ---- */
.bha-card {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px;
    background: var(--bha-card-bg, rgba(255, 255, 255, 0.95));
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}
.bha--glass .bha-card {
    background: rgba(255, 255, 255, 0.13);
    background: color-mix(in srgb, var(--bha-card-bg, #ffffff) 16%, transparent);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.bha-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}
.bha-card__media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: rgba(0, 0, 0, 0.15);
}
.bha-card__img,
.bha-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bha-card__name {
    display: block;
    margin-top: 7px;
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--bha-card-text, #2c2c2a);
}
.bha--glass .bha-card__name { color: var(--bha-card-text, var(--bha-text)); }
.bha-card__price {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bha-card-price, #a23a86);
}
.bha--glass .bha-card__price { color: var(--bha-card-price, var(--bha-accent)); }
.bha-card__price del { opacity: 0.6; font-weight: 400; font-size: 0.75rem; margin-right: 4px; }
.bha-card__price ins { text-decoration: none; }

/* ---- Badges ---- */
.bha-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.4;
}
.bha-badge--sale { background: #d85a30; color: #fff; }
.bha-badge--pin { background: var(--bha-accent); color: #1a1710; right: auto; left: 7px; }

/* ==========================================================================
   STIL 1 – COVERFLOW
   ========================================================================== */
.bha--coverflow .bha-track {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    perspective: 1100px;
    min-height: 230px;
}
.bha--coverflow .bha-card {
    position: absolute;
    width: 168px;
    transition: transform 0.5s ease, opacity 0.5s ease;
    will-change: transform;
}
.bha--coverflow .bha-card[data-pos="0"]  { transform: translateX(0) scale(1) rotateY(0); z-index: 5; opacity: 1; }
.bha--coverflow .bha-card[data-pos="1"]  { transform: translateX(120px) scale(0.86) rotateY(-24deg); z-index: 4; opacity: 0.85; }
.bha--coverflow .bha-card[data-pos="-1"] { transform: translateX(-120px) scale(0.86) rotateY(24deg); z-index: 4; opacity: 0.85; }
.bha--coverflow .bha-card[data-pos="2"]  { transform: translateX(220px) scale(0.72) rotateY(-34deg); z-index: 3; opacity: 0.5; }
.bha--coverflow .bha-card[data-pos="-2"] { transform: translateX(-220px) scale(0.72) rotateY(34deg); z-index: 3; opacity: 0.5; }
.bha--coverflow .bha-card[data-pos="hidden"] { transform: translateX(0) scale(0.5); opacity: 0; pointer-events: none; }

.bha-dots {
    position: relative;
    z-index: 4;
    display: flex;
    gap: 6px;
    margin-top: 14px;
}
.bha-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.3s ease, background 0.3s ease;
}
.bha-dot.is-active { width: 18px; border-radius: 999px; background: var(--bha-accent); }

.bha-nav {
    position: absolute;
    z-index: 6;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.bha-nav:hover { background: rgba(0, 0, 0, 0.6); }
.bha-nav--prev { left: 12px; }
.bha-nav--next { right: 12px; }

/* ==========================================================================
   STIL 2 – MARQUEE-TICKER
   ========================================================================== */
.bha--marquee {
    padding-left: 0;
    padding-right: 0;
}
.bha--marquee .bha-track {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 14px;
    width: max-content;
    animation: bha-scroll var(--bha-duration, 26s) linear infinite;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.bha--marquee:hover .bha-track,
.bha--marquee .bha-track.is-paused { animation-play-state: paused; }
.bha--marquee .bha-card { width: 160px; flex: none; }
@keyframes bha-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ==========================================================================
   STIL 3 – SCATTERED COLLAGE
   ========================================================================== */
.bha--scattered { overflow: visible; }

/* Zentriertes Band: Inhalt mittig mit Maximalbreite, Hintergrund bleibt voll breit */
.bha--scattered .bha-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 1500px;
    margin-inline: auto;
}
.bha--scattered .bha-motto { transform-origin: left center; }
.bha--scattered .bha-swoosh { margin-left: 0; margin-right: auto; }

.bha--scattered .bha-track {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobil: 2 */
    justify-items: center;
    align-items: center;
    gap: 16px 18px;
}
.bha--scattered .bha-card {
    width: 100%;
    max-width: 180px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}
.bha--scattered .bha-card:nth-child(5n + 1) { transform: rotate(-6deg); }
.bha--scattered .bha-card:nth-child(5n + 2) { transform: rotate(5deg) translateY(-10px); }
.bha--scattered .bha-card:nth-child(5n + 3) { transform: rotate(-3deg) translateY(8px); }
.bha--scattered .bha-card:nth-child(5n + 4) { transform: rotate(7deg); }
.bha--scattered .bha-card:nth-child(5n + 5) { transform: rotate(-9deg) translateY(-6px); }
.bha--scattered .bha-card:hover { transform: rotate(0) translateY(-6px) scale(1.04); z-index: 6; }

/* Mobil (Basis): nur 2 Karten zeigen */
.bha--scattered .bha-track .bha-card:nth-child(n + 3) { display: none; }

/* Tablet: Teaser links, 3 Karten */
@media (min-width: 781px) {
    .bha--scattered { padding-left: clamp(16px, 3vw, 36px); padding-right: clamp(16px, 3vw, 36px); }
    .bha--scattered .bha-inner { flex-direction: row; align-items: center; gap: 20px; }
    .bha--scattered .bha-motto { text-align: left; flex: 0 0 clamp(160px, 18vw, 230px); margin-bottom: 0; padding-right: 4px; }
    .bha--scattered .bha-track { flex: 1; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; }
    /* Reset base hide rule (specificity match via :nth-child(n+1) = all cards) */
    .bha--scattered .bha-track .bha-card:nth-child(n + 1) { display: block; }
    .bha--scattered .bha-track .bha-card:nth-child(n + 4) { display: none; }
}

/* HD/Desktop: 5 Karten */
@media (min-width: 1025px) {
    .bha--scattered .bha-track { grid-template-columns: repeat(5, 1fr); gap: 20px 26px; }
    .bha--scattered .bha-track .bha-card:nth-child(n + 1) { display: block; }
    .bha--scattered .bha-track .bha-card:nth-child(n + 6) { display: none; }
}

/* 4K: bis zu 8 Karten, Gruppe bleibt zentriertes Band */
@media (min-width: 1800px) {
    .bha--scattered .bha-track { grid-template-columns: repeat(8, 1fr); gap: 22px 28px; }
    .bha--scattered .bha-track .bha-card:nth-child(n + 1) { display: block; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 780px) {
    /* Auf dem Handy keine Teaser-Drehung (sonst ragt der Text aus dem Banner) */
    .bha-motto { transform: none !important; text-align: center; }
    .bha--scattered { overflow: hidden; }
    .bha--coverflow .bha-card { width: 130px; }
    .bha--coverflow .bha-card[data-pos="1"]  { transform: translateX(92px) scale(0.82) rotateY(-22deg); }
    .bha--coverflow .bha-card[data-pos="-1"] { transform: translateX(-92px) scale(0.82) rotateY(22deg); }
    .bha--coverflow .bha-card[data-pos="2"],
    .bha--coverflow .bha-card[data-pos="-2"] { opacity: 0; pointer-events: none; }
    .bha--marquee .bha-card { width: 140px; }
}
@media (max-width: 480px) {
    .bha--coverflow .bha-card { width: 104px; }
    .bha-nav { width: 32px; height: 32px; font-size: 18px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bha--marquee .bha-track { animation: none; }
    .bha-card { transition: none; }
}
