/*
 * Einlöse-Overlay im neuen Layout (template-parts/redemptionoverlay/redemption/_redemption_neu.php).
 * Bewusst außerhalb des Vite-Bundles: Das Overlay kommt per AJAX und bringt diese Datei als <link> mit;
 * die Einlöseseite lädt sie zusätzlich vor (functions/enqueue.php), damit beim ersten Öffnen nichts springt.
 * Die Formulare in #redemptionBox sind die bisherigen, hier nur neu eingekleidet.
 */

.bbe {
    --bbe-ink: var(--royal-blue, #001437);
    --bbe-muted: #5c6578;
    --bbe-line: rgba(var(--royal-blue-rgb, 0, 20, 55), .12);
    --bbe-accent: var(--aperol-sunset, #f06941);
    color: var(--bbe-ink);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

.bbe p {
    margin: 0;
}

/* ---------- Bilder: mobil ein Bild je Wisch, ab 768px nebeneinander ---------- */

.bbe__hero {
    position: relative;
    background: var(--creme, #f5f0f0);
}

.bbe__bilder {
    display: flex;
    gap: 3px;
    height: 210px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.bbe__bilder::-webkit-scrollbar {
    display: none;
}

.bbe__bilder:focus-visible {
    outline: 2px solid var(--aperol-sunset, #f06941);
    outline-offset: -2px;
}

.bbe__bild {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    background: rgba(var(--royal-blue-rgb, 0, 20, 55), .06);
}

/* picture ist sonst inline, dann greift die Höhe des Bildes nicht (schmale Bilder blieben unten leer) */
.bbe__bild picture {
    display: block;
    height: 100%;
}

.bbe__bild img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bbe__hero::after {
    content: "";
    position: absolute;
    inset: 60% 0 0;
    background: linear-gradient(to bottom, rgba(0, 20, 55, 0), rgba(0, 20, 55, .5));
    pointer-events: none;
}

.bbe__balken {
    position: absolute;
    z-index: 1;
    left: 16px;
    right: 16px;
    bottom: 10px;
    display: flex;
    gap: 4px;
    pointer-events: none;
}

.bbe__balken i {
    flex: 1 1 0;
    max-width: 44px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .45);
}

.bbe__balken i.ist-aktiv {
    background: #fff;
}

.bbe .bbe__balken ~ .bbe__herotags {
    bottom: 24px;
}

.bbe__pfeil {
    display: none;
}

.bbe .bbe__herotags {
    position: absolute;
    z-index: 1;
    left: 16px;
    right: 16px;
    pointer-events: none;
    bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bbe__herotags span {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* ---------- Raster: mobil Kopf, Einlösung, Infos; ab 992px Infos links, Einlösung rechts ---------- */

.bbe__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "side" "main";
    gap: 20px;
    padding: 20px 16px 32px;
}

.bbe__head {
    grid-area: head;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-right: 28px; /* Platz für das Schließen-Kreuz, wenn kein Bild darüber liegt */
}

.bbe__hero + .bbe__grid .bbe__head {
    padding-right: 0;
}

.bbe__side {
    grid-area: side;
    min-width: 0;
}

.bbe__main {
    grid-area: main;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ---------- Kopf ---------- */

.bbe .bbe__eyebrow {
    margin-bottom: 4px;
    color: var(--bbe-muted);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
}

.bbe .bbe__name {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    text-transform: none;
}

.bbe .bbe__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-top: 10px;
    color: var(--bbe-muted);
    font-size: 15px;
}

.bbe__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--bbe-ink);
}

.bbe__rating svg {
    color: var(--bbe-accent);
}

.bbe__logo {
    flex: 0 0 auto;
}

.bbe__logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 96px;
    max-height: 64px;
    object-fit: contain;
}

.bbe--shop .bbe__logo img {
    max-width: 140px;
    max-height: 80px;
}

/* ---------- Einlösung ---------- */

.bbe__box {
    padding: 18px 16px 16px;
    border-radius: 16px;
    background: var(--creme, #f5f0f0);
}

/* bisherige Formulare: Karte, Schatten und die Code-Zeile entfallen, die Angaben stehen unter der Box */
#partnerInfosForRedemption.genericPopup .bbe #redemptionBox {
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: none;
}

#partnerInfosForRedemption.genericPopup .bbe #redemptionBox .guthabenInfos {
    display: none;
}

#partnerInfosForRedemption.genericPopup .bbe #redemptionBox h5 {
    margin: 0 0 16px;
    font-size: 19px;
    line-height: 1.3;
}

/* „Du erhältst anschließend den Gutschein …“ steht ausführlicher unter der Box; die Rechenzeile bleibt */
#partnerInfosForRedemption.genericPopup .bbe #redemptionBox p.smaller:not(:has(#customBetragInfo)) {
    display: none;
}

#partnerInfosForRedemption.genericPopup .bbe #redemptionBox h5 br {
    display: none;
}

/* Padding: .button bringt 14px oben mit, bei line-height 58px saß der Text zu tief (nur bei Hover richtig) */
#partnerInfosForRedemption.genericPopup .bbe #redemptionBox .button-cta {
    margin-top: 4px;
    padding: 0 30px;
}

#partnerInfosForRedemption.genericPopup .bbe #redemptionBox .button-cta:hover {
    padding: 0 26px 0 34px;
}

#partnerInfosForRedemption.genericPopup .bbe #redemptionBox hr {
    margin: 14px 0;
    border-color: var(--bbe-line);
}

#partnerInfosForRedemption.genericPopup .bbe #redemptionBox p:last-child {
    margin-bottom: 0;
}

.bbe__box .infoBox {
    margin: 0;
    border-radius: 10px;
}

.bbe__box .infoBox p + p {
    margin-top: 8px;
}

.bbe .bbe__gut {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0 4px;
    list-style: none;
    font-size: 14px;
    line-height: 1.45;
}

.bbe__gut li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
}

.bbe__gut li::before {
    content: none;
}

.bbe__gut svg {
    margin-top: 2px;
    color: #2e7d4f;
}

.bbe__gut .bbe__gut--achtung svg {
    color: var(--bbe-accent);
}

.bbe__gut--achtung {
    font-weight: 600;
}

.bbe .bbe__code {
    margin-top: 14px;
    padding: 0 4px;
    color: var(--bbe-muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

/* ---------- Infos ---------- */

.bbe .bbe__sektion {
    margin: 0;
    padding: 0;
}

.bbe .bbe__lead {
    font-size: 19px;
    line-height: 1.4;
    font-weight: 600;
}

.bbe .bbe__beliebt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -10px;
    color: var(--bbe-muted);
    font-size: 14px;
}

.bbe__beliebt i {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e7d4f;
}

.bbe .bbe__warn {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff3d6;
    font-size: 15px;
    font-weight: 600;
}

.bbe__warn svg {
    margin-top: 2px;
}

.bbe .bbe__h {
    margin: 0 0 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bbe-muted);
}

.bbe .bbe__fakten {
    margin: 0;
    border-top: 1px solid var(--bbe-line);
}

.bbe__fakt {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bbe-line);
}

.bbe__fakt dt {
    margin: 0;
    padding-top: 2px;
    color: var(--bbe-muted);
    font-weight: 400;
}

.bbe__fakt dt svg {
    display: block;
}

.bbe__fakt dd {
    margin: 0;
    min-width: 0;
}

.bbe__fakt strong {
    font-weight: 600;
}

.bbe a.bbe__link {
    display: block;
    width: fit-content;
    margin: 2px 0 0;
    color: var(--bbe-ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bbe a.bbe__link:hover {
    color: var(--bbe-accent);
}

.bbe a.bbe__link--start {
    margin: 0;
    font-size: 16px;
}

.bbe__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

.bbe__gueltig {
    margin-top: 8px;
    font-size: 15px;
}

.bbe__gueltig p + p {
    margin-top: 6px;
}

.bbe__auf summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 12px;
    cursor: pointer;
    list-style: none;
}

.bbe__auf summary::-webkit-details-marker {
    display: none;
}

.bbe__auf summary em {
    color: var(--bbe-ink);
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bbe__auf[open] summary em {
    display: none;
}

.bbe__auf summary:focus-visible {
    outline: 2px solid var(--bbe-accent);
    outline-offset: 3px;
}

.bbe .bbe__zeiten {
    width: auto;
    margin: 10px 0 0;
    border: 0;
    border-collapse: collapse;
    font-size: 15px;
}

.bbe .bbe__zeiten th,
.bbe .bbe__zeiten td {
    padding: 2px 0;
    border: 0;
    background: none;
    font-weight: 400;
    text-align: left;
    vertical-align: top;
}

.bbe .bbe__zeiten th {
    padding-right: 20px;
    color: var(--bbe-muted);
}

.bbe .bbe__zeiten .ist-heute th,
.bbe .bbe__zeiten .ist-heute td {
    color: var(--bbe-ink);
    font-weight: 700;
}

.bbe .bbe__quelle {
    margin-top: 8px;
    color: var(--bbe-muted);
    font-size: 12px;
}

.bbe .bbe__standorte {
    max-height: 220px;
    margin: 10px 0 4px;
    padding: 4px 12px;
    overflow-y: auto;
    border-radius: 10px;
    background: var(--creme, #f5f0f0);
    list-style: none;
    font-size: 15px;
}

.bbe__standorte li {
    margin: 0;
    padding: 3px 0;
}

.bbe__standorte li::before {
    content: none;
}

.bbe .bbe__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.bbe__chips li {
    margin: 0;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--bbe-line);
    font-size: 13px;
    line-height: 1.3;
}

.bbe__chips li::before {
    content: none;
}

.bbe .bbe__sektion--gutschein {
    padding: 16px;
    border-radius: 12px;
    background: rgba(var(--soda-splash-rgb, 205, 225, 245), .45);
    font-size: 15px;
}

.bbe__sektion--gutschein .bbe__h {
    color: var(--bbe-ink);
}

.bbe__sektion--gutschein > * + * {
    margin-top: 8px;
}

.bbe__html p + p,
.bbe__html p + ul,
.bbe__html ul + p {
    margin-top: 10px;
}

.bbe__html ul {
    margin: 0;
    padding-left: 18px;
}

.bbe__html ul.checkIconList {
    padding-left: 0;
}

.bbe__ueber .bbe__html {
    font-size: 15px;
    line-height: 1.6;
}

.bbe .bbe__zitat {
    margin: 0;
    padding: 2px 0 2px 16px;
    border: 0;
    border-left: 3px solid var(--cherry-blossom, #ebc8f0);
    background: none;
    font-size: 16px;
}

.bbe__zitat p {
    font-style: italic;
}

.bbe__zitat cite {
    display: block;
    margin-top: 6px;
    color: var(--bbe-muted);
    font-size: 13px;
    font-style: normal;
}

/* ---------- ab Tablet quer ---------- */

@media (min-width: 768px) {
    .bbe__bilder {
        height: 270px;
    }

    /* ein Bild füllt die Breite, zwei teilen sie, ab drei: großes Bild und daneben die nächsten */
    .bbe__hero--2 .bbe__bild {
        flex-basis: calc(50% - 1.5px);
    }

    .bbe__hero--3 .bbe__bild {
        flex-basis: calc(27% - 2px);
    }

    .bbe__hero--3 .bbe__bild:first-child {
        flex-basis: calc(46% - 2px);
    }

    .bbe__balken {
        display: none;
    }

    .bbe .bbe__balken ~ .bbe__herotags {
        bottom: 18px;
    }

    .bbe__pfeil {
        position: absolute;
        z-index: 2;
        top: 50%;
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        margin-top: -19px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 2px 10px rgba(0, 20, 55, .25);
        color: var(--royal-blue, #001437);
        cursor: pointer;
    }

    .bbe__pfeil:hover {
        background: #fff;
    }

    .bbe__pfeil:focus-visible {
        outline: 2px solid var(--aperol-sunset, #f06941);
        outline-offset: 2px;
    }

    .bbe__pfeil--zurueck {
        left: 14px;
    }

    .bbe__pfeil--weiter {
        right: 14px;
    }

    .bbe .bbe__herotags {
        left: 32px;
        bottom: 18px;
    }

    .bbe__grid {
        padding: 26px 32px 40px;
    }

    .bbe .bbe__name {
        font-size: 34px;
    }
}

@media (min-width: 992px) {
    .bbe__grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        grid-template-areas: "head side" "main side";
        grid-template-rows: auto 1fr;
        gap: 24px 44px;
    }

    .bbe__side {
        position: sticky;
        top: 20px;
        align-self: start;
    }

    .bbe__box {
        padding: 22px 20px 20px;
    }
}

/* Rechenzeile unter dem Formular („verbleiben dir …“, „Differenz …“) lesbar */
#partnerInfosForRedemption.genericPopup .bbe #redemptionBox p.smaller {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
}
