/*
 * Boni.tv – Ergänzungen nur für Shopseiten (templates/cashback.tpl).
 * Baut auf css/site-2026.css auf (Farben, Titelband, Boxen, Buttons).
 */

/* ---------- Textbereich mit Seitenleiste ----------
   Schrift, Überschriften und Listen kommen aus css/site-2026.css (.bt-text) */

body .main.shop .description-text .bt-text > :first-child {
    margin-top: 8px;
}

/* Gutschein- und Cashback-Box im Text (Markup aus libs/locale/de.xml); das Raster .bt-textboxen steht in css/site-2026.css */
body .main.shop .bt-textbox {
    border-radius: var(--bt-radius);
    padding: 24px;
    background: var(--bt-flaeche);
    border: 1px solid var(--bt-linie);
}

body .bt-text .bt-textbox h2,
body .bt-text .bt-textbox h3 {
    margin: 0 0 10px;
    font-size: 20px;
}

body .bt-text .bt-textbox > :last-child {
    margin-bottom: 0;
}

body .bt-text .bt-textbox p {
    font-size: 16px;
}

/* Seitenleiste: feste Breite. Sonst wird sie schmaler, sobald das Inhaltsverzeichnis
   beim Scrollen auf position:fixed wechselt (js/cashback.js), und das Verzeichnis rutscht nach rechts. */
@media (min-width: 992px) {
    body .main.shop .description-text .thumbnail-container {
        width: 310px;
    }
}

/* Mobil: Shopbild und Inhaltsverzeichnis mittig statt links */
@media (max-width: 991px) {
    body .main.shop .description-text .thumbnail-container {
        float: none;
        width: 310px;
        max-width: 100%;
        margin: 0 auto 20px !important;
    }
}

/* ---------- Shop-Kopf (templates/cashback.tpl) ----------
   Cashback und Gutscheine rechts, die Box mit Screenshot und "auf einen Blick" (aside, im HTML danach) links.
   Ab 992 px nebeneinander, darunter eine Spalte: erst die Angebote, dann die Box. */
@media (min-width: 992px) {
    body .main.shop > .container > .row:has(> aside) {
        display: grid;
        grid-template-columns: 310px minmax(0, 1fr);
        gap: 24px;
        align-items: start;
        margin: 0;
    }

    body .main.shop > .container > .row:has(> aside) > div {
        grid-column: 2;
        grid-row: 1;
    }

    body .main.shop > .container > .row:has(> aside) > aside {
        grid-column: 1;
        grid-row: 1;
        position: sticky;
        top: 140px;
    }

    /* Sterne stehen am Desktop in der Box (rot), nicht im Titelband */
    body .main.shop .page-top .mobstars {
        display: none;
    }
}

/* Erste Box rechts beginnt auf derselben Höhe wie die Box links. Ohne Cashback steht vor der Gutschein-Box ein
   JSON-LD-Skript, die Box ist dann das zweite Kind und bekäme aus dem alten Theme (.featured-box-primary:nth-child(2)) 12 statt 20 px. */
body .main.shop > .container > .row:has(> aside) > div > .featured-box:first-of-type {
    margin-top: 20px;
}

/* ohne die negativen Ränder von Bootstraps .row, sonst ist die Zeile am Handy breiter als der Bildschirm */
body .main.shop > .container > .row:has(> aside) {
    margin-left: 0;
    margin-right: 0;
}

body .main.shop > .container > .row:has(> aside)::before,
body .main.shop > .container > .row:has(> aside)::after {
    display: none;
}

/* Bewertung: eine Sternreihe, die fünf Knöpfe liegen unsichtbar über den Sternen (templates/cashback.tpl, js/cashback.js).
   Steht in der Box unter dem Screenshot (#bewerten), auf allen Bildschirmgrößen. */
body .main.shop .mobstars > form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
}

body .main.shop .mobstars fieldset {
    position: relative;
    display: inline-block;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

body .main.shop .mobstars fieldset > .star-rating-shop {
    display: block;
    pointer-events: none;
}

body .main.shop .mobstars fieldset > .star-rating-shop + div {
    position: absolute;
    inset: 0;
    display: flex;
}

body .main.shop .mobstars fieldset > .star-rating-shop + div > .btn-link {
    flex: 1;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
}

body .main.shop .mobstars fieldset[disabled] > .star-rating-shop + div > .btn-link {
    cursor: default;
}

body .main.shop .mobstars fieldset > .star-rating-shop + div > .btn-link:focus:not(:focus-visible) {
    outline: 0;
}

body .main.shop .mobstars fieldset > .star-rating-shop + div > .btn-link:focus-visible {
    outline: 2px solid var(--bt-rot);
    outline-offset: -2px;
}

body .main.shop .mobstars form > div,
body .main.shop .mobstars form > p {
    flex: 0 0 100%;
    margin: 4px 0 0;
    text-align: center;
}

body .main.shop .mobstars form > p {
    color: #3c763d;
}

body .main.shop .mobstars form > div > .btn-link,
body .main.shop .mobstars form > p > .btn-link {
    padding: 0 4px;
    color: var(--bt-rot);
    font-size: inherit;
    vertical-align: baseline;
}

/* .btn setzt display, deshalb hidden hier ausdrücklich */
body .main.shop .mobstars [hidden] {
    display: none !important;
}

/* Titelband (nur Handy/Tablet): Sterne zeigen den Durchschnitt und springen zur Bewertung in der Box */
body .main.shop .page-top .mobstars > a.star-rating-shop {
    text-decoration: none;
}

body .main.shop aside .box-content > .mobstars {
    margin: 4px 0 16px;
    font-size: 14px;
    color: var(--bt-text-leise);
}

body .main.shop aside .mobstars .star-rating-shop {
    margin: 0 !important;
    top: 0;
    font-size: 26px !important;
}

body .main.shop aside .box-content h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

body .main.shop aside .list-unstyled {
    margin: 0;
}

body .main.shop aside .list-unstyled li {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid var(--bt-linie);
    font-size: 14px;
    line-height: 1.4;
}

body .main.shop aside .list-unstyled li:first-child {
    border-top: 0;
}

body .main.shop aside .list-unstyled li .fa {
    flex: 0 0 16px;
    margin-top: 3px;
}

body .main.shop aside .well {
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: var(--bt-flaeche);
    box-shadow: none;
    font-size: 14px;
    line-height: 1.45;
}

body .main.shop aside .well strong {
    display: block;
    margin-bottom: 2px;
}

body .main.shop aside .box-content > p.small {
    margin: 10px 0 0;
}

/* Trennlinie zwischen Stand und Teilen */
body .main.shop aside .box-content > p.small.text-muted {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bt-linie);
}


/* Großer Screenshot: 5 px weißer Rand rundum, Rahmenradius 18 px */
body .main.shop aside .thumbnail {
    position: relative;
    margin: 0 0 10px;
    padding: 4px;
    border: 1px solid var(--bt-linie);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

body .main.shop aside .thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 13px;
}

/* Hinweis-Symbole für Eingeloggte über dem Screenshot (Inline-Style width:100%): an der Box ausrichten, sonst ragen sie über den Rand */
body .main.shop aside .box-content {
    position: relative;
}

body .main.shop aside .cashback_thumb_icons {
    left: 0;
    width: 100% !important;
}

/* Wert-Block statt Screenshot in den Kacheln: der vorhandene Rahmen ohne Bild */
body .main.shop .row.coupon .coupon-bild .thumbnail:not(:has(img)) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    min-height: 85px;
    margin: 0;
    text-align: center;
    line-height: 1.15;
    color: var(--bt-text);
}

body .main.shop .row.coupon .coupon-bild .thumbnail:not(:has(img)) > strong {
    font-size: 26px;
    font-weight: 700;
    white-space: nowrap;
}

body .main.shop .row.coupon .coupon-bild .thumbnail:not(:has(img)) > small {
    font-size: 12px;
    color: var(--bt-text-leise);
}

body .main.shop .row.coupon .coupon-bild .thumbnail:not(:has(img)) > .fa {
    margin-bottom: 4px;
    font-size: 26px;
}

/* Titel immer mittig, egal ob ein- oder zweizeilig */
body .main.shop .row.coupon .coupon-text {
    justify-content: center;
}

/* Fußleiste mit fester Höhe: links Pillen, rechts Gültigkeit bzw. "Alle Cashback-Stufen".
   Am Handy eine Zeile, seitlich wischbar, damit jede Kachel gleich aufgebaut bleibt. */
body .main.shop .row.coupon:has(> footer) {
    padding-bottom: 0 !important;
}

body .main.shop .row.coupon > footer {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    margin: 12px 0 0;
    padding: 0 18px;
    border-top: 1px solid var(--bt-linie);
    overflow-x: auto;
    scrollbar-width: none;
    line-height: 22px;
}

body .main.shop .row.coupon > footer > time {
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 10px;
    font-size: 12px;
    color: var(--bt-text-leise);
    white-space: nowrap;
}

body .main.shop .row.coupon > footer > time.text-danger {
    color: var(--bt-rot);
    font-weight: 600;
}

@media (max-width: 767px) {
    body .main.shop .row.coupon .coupon-bild .thumbnail:not(:has(img)) {
        width: 92px;
        min-height: 64px;
    }

    body .main.shop .row.coupon .coupon-bild .thumbnail:not(:has(img)) > strong {
        font-size: 21px;
    }

    body .main.shop .row.coupon > footer {
        padding: 0 12px;
    }
}

/* Teilen: am Ende der Box links (templates/cashback.tpl). Runde Knöpfe in den Markenfarben, Unterscheidung über das Linkziel */
body .main.shop aside .box-content > .list-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
}

body .main.shop aside .box-content > .list-inline > li {
    padding: 0;
}

body .main.shop aside .box-content > .list-inline > li > a,
body .main.shop aside .box-content > .list-inline > li > .btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #999;
    color: #fff;
    transition: transform .15s ease;
}

body .main.shop aside .box-content > .list-inline > li > a:hover,
body .main.shop aside .box-content > .list-inline > li > .btn-link:hover {
    transform: translateY(-2px);
    color: #fff;
}

body .main.shop aside .box-content > .list-inline > li > :focus:not(:focus-visible) {
    outline: 0;
    box-shadow: none;
}

body .main.shop aside .box-content > .list-inline > li > :focus-visible {
    outline: 2px solid var(--bt-rot);
    outline-offset: 2px;
}

body .main.shop aside .box-content > .list-inline a[href*="wa.me"] {
    background: #4ded6b;
}

body .main.shop aside .box-content > .list-inline a[href*="facebook"] {
    background: #3b5998;
}

body .main.shop aside .box-content > .list-inline a[href*="x.com"] {
    background: #000;
}

body .main.shop aside .box-content > .list-inline a[href*="pinterest"] {
    background: #e60023;
}

body .main.shop aside .box-content > .list-inline + p {
    margin: 6px 0 0;
    text-align: center;
}

/* Handy/Tablet mit Teilen-Menü des Geräts: ein Knopf "Teilen" und darunter "Link kopieren" statt der Icons (js/cashback.js) */
body .main.shop aside .box-content > [data-teilen] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

body .main.shop aside .box-content > [data-teilen] + [data-teilen] {
    margin-top: 4px;
    color: var(--bt-rot);
}

body .main.shop aside .box-content > [hidden],
body .main.shop aside .box-content > .list-inline [hidden] {
    display: none !important;
}

/* Inhaltsverzeichnis */
body .main.shop .tocmenu {
    box-sizing: border-box;
    width: 310px;
    max-width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 16px;
    padding: 20px;
    border-radius: var(--bt-radius);
    background: var(--bt-flaeche);
    text-align: left;
    font-size: 15px;
    color: var(--bt-text);
}

body .main.shop .tocmenu ol {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: bt-toc;
}

body .main.shop .tocmenu li {
    border-bottom: 0;
    padding: 0;
    margin: 2px 0;
}

body .main.shop .tocmenu li a {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--bt-text);
    text-decoration: none;
    transition: background-color .15s ease;
}

body .main.shop .tocmenu li a:hover,
body .main.shop .tocmenu li.active a {
    background: #fff;
    color: var(--bt-rot);
}

/* "Noch kein Konto?" unter dem Inhaltsverzeichnis (steht im sticky Verzeichnis, sonst als eigene Box) */
body .main.shop .bt-konto {
    box-sizing: border-box;
    width: 310px;
    max-width: 100%;
    margin-top: 16px;
    font-weight: 400;
    padding: 22px;
    border-radius: var(--bt-radius);
    background: var(--bt-dunkel);
    color: #fff;
    text-align: left;
}

body .main.shop .bt-konto-titel {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

body .main.shop .bt-konto-text {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #d8cfcf;
}

body .main.shop .bt-konto .bt-konto-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--bt-gelb);
    color: var(--bt-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

body .main.shop .tocmenu .bt-konto {
    width: auto;
    margin: 16px -4px -4px;
}

/* Auf schmalen Bildschirmen liegt das Verzeichnis eingeklappt über dem Text: Box dort weglassen */
@media (max-width: 991px) {
    body .main.shop .tocmenu .bt-konto {
        display: none;
    }
}
