/*
 * Angebote-Leiste über der Speisekarte (application/views/promotions/menu_offers.php, Bedienung menu-offers.js) für die
 * Kundenseiten (alle Website-Vorlagen) und die Letzdine-Restaurantseite: waagerecht wischbare Kacheln wie bei
 * Lieferplattformen – je Aktion eine farbige Kachel, dazu die Gerichte der Aktionen mit Foto, Preis und Schild.
 * Farben: Bestellteil der Vorlage (--shop-*, assets/restaurant-templates/shop.css), auf Letzdine --ldm-* (hell/dunkel),
 * sonst feste Werte.
 */
body .ld-offers {
    --of-ac: var(--shop-ac, var(--ldm-ac, #169fdb));
    --of-ac-ink: var(--shop-ac-ink, var(--ldm-ac-ink, #ffffff));
    --of-sf: var(--shop-sf, var(--ldm-sf, #ffffff));
    --of-sf2: var(--shop-sf2, var(--ldm-s2, #f3f5f8));
    --of-ink: var(--shop-ink, var(--ldm-ink, #111827));
    --of-mu: var(--shop-mu, var(--ldm-mu, #5f6b7a));
    --of-ln: var(--shop-ln, var(--ldm-ln, rgba(15, 23, 42, 0.1)));
    --of-ln2: var(--shop-ln2, var(--ldm-ln2, rgba(15, 23, 42, 0.24)));
    --of-price: var(--shop-price, var(--ldm-ac-text, var(--of-ac)));
    --of-radius: var(--shop-radius, 22px);
}

body .ld-offers {
    --offers-gap: 14px;
    position: relative;
    margin: 6px 0 26px;
}

body .ld-offers__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

body .ld-offers__title {
    margin: 0;
    color: var(--of-ink);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

body .ld-offers__nav {
    display: flex;
    gap: 8px;
}

body .ld-offers__nav[hidden] {
    display: none;
}

body .ld-offers__arrow {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0 0 3px;
    border: 1px solid var(--of-ln2);
    border-radius: 999px;
    background: var(--of-sf);
    color: var(--of-ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
}

body .ld-offers__arrow:hover:not(:disabled) {
    background: var(--of-sf2);
}

body .ld-offers__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

body .ld-offers__track {
    display: flex;
    gap: var(--offers-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 2px 16px;
    scrollbar-width: none;
}

body .ld-offers__track::-webkit-scrollbar {
    display: none;
}

body .ld-offers__deal,
body .ld-offers__dish {
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: start;
    margin: 0;
    font: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

body .ld-offers__deal {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 224px;
    padding: 18px 18px 16px;
    overflow: hidden;
    border: 0;
    border-radius: var(--of-radius);
    background: var(--of-ac); /* flach, kein Verlauf (04.12.) */
    color: var(--of-ac-ink);
}

/* ruhiger Kreis als Muster rechts oben – seit 04.12. aus (flache Kacheln) */
body .ld-offers__deal::before {
    display: none;
    content: "";
    position: absolute;
    top: -46px;
    right: -46px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--of-ac-ink) 12%, transparent);
    pointer-events: none;
}

body .ld-offers__deal-badge {
    position: relative;
    margin-bottom: auto;
    padding-bottom: 14px;
    font-size: 1.7rem;
    text-wrap: balance;
    font-weight: 700; /* 04.12.: schlanker („zu fett“) */
    line-height: 1.05;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

body .ld-offers__deal-badge--long {
    font-size: 1.35rem;
}

body .ld-offers__deal-title {
    position: relative;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
}

body .ld-offers__deal-sub,
body .ld-offers__deal-time {
    position: relative;
    font-size: 0.82rem;
    line-height: 1.35;
    opacity: 0.86;
}

body .ld-offers__deal-time {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--of-ac-ink) 16%, transparent);
    opacity: 1;
    font-weight: 700;
}

body .ld-offers__dish {
    display: flex;
    flex-direction: column;
    width: 200px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--of-ln);
    border-radius: var(--of-radius);
    background: var(--of-sf);
    color: var(--of-ink);
    cursor: pointer;
}

body button.ld-offers__deal {
    cursor: pointer;
}

body .ld-offers__dish,
body button.ld-offers__deal {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
    body .ld-offers__dish:hover,
    body button.ld-offers__deal:hover {
        transform: translateY(-3px);
    }
}

body .ld-offers__dish:focus-visible,
body button.ld-offers__deal:focus-visible,
body .ld-offers__arrow:focus-visible {
    outline: 3px solid var(--of-ac);
    outline-offset: 3px;
}

body .ld-offers__dish-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--of-sf2);
}

/* ohne Foto (04.12.): kein Verlauf – flache ruhige Fläche, der Aktionspreis groß als „Bild“ */
body .ld-offers__dish-media--none {
    background: var(--of-sf2);
}

body .ld-offers__dish-big {
    position: absolute;
    inset: auto 14px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    color: var(--of-price);
    line-height: 1;
}

body .ld-offers__dish-big b {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

body .ld-offers__dish-big small {
    flex-basis: 100%;
    margin-bottom: 2px;
    color: var(--of-mu);
    font-size: 0.78rem;
    font-weight: 700;
}

body .ld-offers__dish-big del {
    color: var(--of-mu);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Preis steht schon groß oben: unten nur der Name */
body .ld-offers__dish--text .ld-offers__dish-price {
    display: none;
}

body .ld-offers__dish--text .ld-offers__dish-name {
    -webkit-line-clamp: 3;
    min-height: 3.75em;
}

body .ld-offers__dish-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body .ld-offers__dish-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--of-ac);
    color: var(--of-ac-ink);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

body .ld-offers__dish-example {
    position: absolute;
    right: 8px;
    bottom: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.82);
    color: #3b3b3b;
    font-size: 10px;
    font-style: italic;
}

body .ld-offers__dish-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    padding: 12px 56px 14px 14px;
}

body .ld-offers__dish-name {
    display: -webkit-box;
    min-height: 2.5em;
    overflow: hidden;
    color: var(--of-ink);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body .ld-offers__dish-price {
    color: var(--of-price);
    font-size: 0.98rem;
    font-weight: 800;
    white-space: nowrap;
}

body .ld-offers__dish-price small {
    color: var(--of-mu);
    font-size: 0.72rem;
    font-weight: 600;
}

/* Aktion Festpreis: alter Preis neben dem Aktionspreis (Promotions_checkout::offers old_price) */
body .ld-offers__dish-old {
    color: var(--of-mu);
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 4px;
}

body .ld-offers__dish-add {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding-bottom: 2px;
    border-radius: 999px;
    background: var(--of-ac);
    color: var(--of-ac-ink);
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
}

/* Handy: bis an den Rand wischen, etwas kleinere Kacheln */
@media (max-width: 767.98px) {
    body .ld-offers {
        margin: 2px -16px 22px;
    }

    body .ld-offers__head {
        padding: 0 16px;
    }

    body .ld-offers__title {
        font-size: 1.2rem;
    }

    body .ld-offers__track {
        --offers-gap: 12px;
        padding: 4px 16px 14px;
        scroll-padding-inline: 16px;
    }

    body .ld-offers__deal {
        width: 176px;
        padding: 16px 14px 14px;
    }

    body .ld-offers__deal-badge {
        font-size: 1.4rem;
    }

    body .ld-offers__dish {
        width: 164px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .ld-offers__track {
        scroll-behavior: auto;
    }

    body .ld-offers__dish,
    body button.ld-offers__deal {
        transition: none;
    }
}

/* Abendlicht/Morgenlicht: Überschrift in der Schrift der Vorlage, eckige ruhige Kacheln */
body.tpl-abendlicht .ld-offers__title {
    font-family: var(--ab-heading-font, Georgia, serif);
    font-size: 2rem;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0;
}

body.tpl-abendlicht .ld-offers__arrow {
    border-radius: 0;
}

body.tpl-abendlicht .ld-offers__dish {
    background: var(--of-sf2);
    box-shadow: none;
}

body.tpl-abendlicht .ld-offers__dish-name {
    font-family: var(--ab-heading-font, Georgia, serif);
    font-size: 1.08rem;
    font-weight: 400;
}

body.tpl-abendlicht .ld-offers__dish-badge,
body.tpl-abendlicht .ld-offers__dish-add {
    border-radius: 2px;
}

/* Standard Modern: Überschrift in der Anzeigeschrift */
body.tpl-modern .ld-offers__title {
    font-family: var(--md-disp, inherit);
}


@media (max-width: 767.98px) {
    body .ld-offers__deal-badge--long {
        font-size: 1.3rem;
    }
}

/* Letzdine dunkel: flache Akzentfarbe wie hell (04.12. ohne Verlauf) */
html[data-letzdine-theme="dark"] body .ld-offers__deal:not(.ld-offers__deal--photo) {
    background: var(--of-ac);
}

/*
 * Letzdine-Restaurantseite (body.ld-rm-modern, 24.11.2026): Leiste kleiner und ruhiger, damit sie nicht fetter wirkt als die
 * Speisen darunter (Karte 156 px hoch, Name 16 px halbfett). Kacheln ~190 statt 232 px, weniger Gewicht in Schrift und Knöpfen.
 * Kundenseiten bleiben wie oben.
 */
body.ld-rm-modern .ld-offers {
    --offers-gap: 12px;
    margin: 2px 0 22px;
}

body.ld-rm-modern .ld-offers__title {
    font-size: 1.25rem;
    font-weight: 700;
}

body.ld-rm-modern .ld-offers__deal {
    width: 184px;
    gap: 4px;
    padding: 14px 14px 13px;
    box-shadow: none;
}

body.ld-rm-modern .ld-offers__deal::before {
    top: -40px;
    right: -40px;
    width: 104px;
    height: 104px;
}

body.ld-rm-modern .ld-offers__deal-badge {
    padding-bottom: 10px;
    font-size: 1.35rem;
    font-weight: 700;
}

body.ld-rm-modern .ld-offers__deal-badge--long {
    font-size: 1.2rem;
}

body.ld-rm-modern .ld-offers__deal-title {
    font-size: 0.86rem;
    font-weight: 600;
}

body.ld-rm-modern .ld-offers__deal-sub,
body.ld-rm-modern .ld-offers__deal-time {
    font-size: 0.76rem;
}

body.ld-rm-modern .ld-offers__dish {
    width: 168px;
    box-shadow: none;
}

body.ld-rm-modern .ld-offers__dish-media {
    aspect-ratio: 16 / 10;
}

body.ld-rm-modern .ld-offers__dish-badge {
    top: 8px;
    left: 8px;
    padding: 3px 7px;
    font-size: 0.64rem;
    font-weight: 700;
    box-shadow: none;
}

body.ld-rm-modern .ld-offers__dish-body {
    gap: 4px;
    padding: 10px 46px 11px 12px;
}

body.ld-rm-modern .ld-offers__dish-name {
    font-size: 0.88rem;
    font-weight: 600;
}

body.ld-rm-modern .ld-offers__dish-price {
    font-size: 0.88rem;
    font-weight: 700;
}

body.ld-rm-modern .ld-offers__dish-add {
    right: 10px;
    bottom: 10px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    box-shadow: none;
}

@media (max-width: 767.98px) {
    body.ld-rm-modern .ld-offers {
        margin: 0 -16px 18px;
    }

    body.ld-rm-modern .ld-offers__deal {
        width: 160px;
    }

    body.ld-rm-modern .ld-offers__deal-badge {
        font-size: 1.3rem;
    }

    body.ld-rm-modern .ld-offers__dish {
        width: 148px;
    }
}

/* Knöpfe „Alle · Pizza · Pasta“ über der Reihe (04.12.): flache Pillen, gewählt = Akzentfarbe */
body .ld-offers__filters {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

body .ld-offers__filters::-webkit-scrollbar {
    display: none;
}

body .ld-offers__filter {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 15px;
    border: 1px solid var(--of-ln2);
    border-radius: 999px;
    background: transparent;
    color: var(--of-ink);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

body .ld-offers__filter[aria-pressed="true"] {
    border-color: var(--of-ac);
    background: var(--of-ac);
    color: var(--of-ac-ink);
}

body .ld-offers__filter:focus-visible {
    outline: 2px solid var(--of-ac);
    outline-offset: 2px;
}

body .ld-offers__track [hidden] {
    display: none !important;
}

/* Kachel einer Kategorie mit deren Bild (04.12.): Foto als Hintergrund, ruhige dunkle Fläche darüber für die Schrift */
body .ld-offers__deal--photo {
    background: #1b1b1b;
    color: #ffffff;
}

body .ld-offers__deal--photo::before {
    display: none;
}

body .ld-offers__deal-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body .ld-offers__deal--photo::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Lesbarkeit (04.12.): Foto leicht abgedunkelt, unten (wo die Schrift steht) kräftig dunkel – sonst verschwindet
       weiße Schrift auf hellen Tellern */
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.62) 34%, rgba(0, 0, 0, 0) 64%),
        rgba(0, 0, 0, 0.16);
    pointer-events: none;
}

body .ld-offers__deal--photo .ld-offers__deal-title,
body .ld-offers__deal--photo .ld-offers__deal-sub,
body .ld-offers__deal--photo .ld-offers__deal-time {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 0, 0, 0.45);
}

body .ld-offers__deal--photo .ld-offers__deal-title {
    font-size: 1.12rem;
    line-height: 1.2;
}

body .ld-offers__deal--photo > :not(.ld-offers__deal-img) {
    position: relative;
    z-index: 1;
}

body .ld-offers__deal--photo .ld-offers__deal-badge {
    align-self: flex-start;
    margin-bottom: auto;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--of-ac);
    color: var(--of-ac-ink);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0;
}

/* Startseite (04.12.): Leiste als eigener Abschnitt unter dem Startbild, Kacheln führen zur Bestellung */
body .restaurant-home-offers {
    padding: 32px 0 8px;
}

body .restaurant-home-offers .ld-offers {
    margin: 0;
}
