/*
 * Ruckgaber Adventskalender – eingebunden im Webshop und auf ruckgaber.de.
 * Alle Klassen mit Präfix rbac-, damit Seiten-CSS (Bootstrap 4/5, rb.css) nicht hineinwirkt.
 */
.rbac,
.rbac-overlay {
    --rbac-night: #2e7a4c;
    --rbac-night-deep: #1d5735;
    --rbac-green: #2e7a4c;
    --rbac-orange: #ec6607;
    --rbac-red: #a3262a;
    --rbac-cream: #f7f0e3;
    --rbac-gold: #e6b65c;
    --rbac-ink: #2b2f31;
    --rbac-muted: #6b7478;
    --rbac-radius: 10px;
}

.rbac {
    position: relative;
    box-sizing: border-box;
    padding: clamp(12px, 3vw, 28px);
    border-radius: 16px;
    color: var(--rbac-cream);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .55) 0 1.5px, transparent 2px),
        radial-gradient(circle at 72% 8%, rgba(255, 255, 255, .45) 0 1px, transparent 1.5px),
        radial-gradient(circle at 38% 62%, rgba(255, 255, 255, .35) 0 1px, transparent 1.5px),
        radial-gradient(circle at 88% 74%, rgba(255, 255, 255, .5) 0 1.5px, transparent 2px),
        radial-gradient(circle at 55% 92%, rgba(255, 255, 255, .3) 0 1px, transparent 1.5px),
        linear-gradient(160deg, var(--rbac-night), var(--rbac-night-deep));
    background-size: 180px 180px, 230px 230px, 150px 150px, 260px 260px, 200px 200px, 100% 100%;
    font-family: inherit;
    line-height: 1.4;
}

.rbac *, .rbac *::before, .rbac *::after,
.rbac-overlay *, .rbac-overlay *::before, .rbac-overlay *::after {
    box-sizing: border-box;
}

.rbac-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-bottom: clamp(12px, 2vw, 20px);
}

.rbac-title {
    margin: 0;
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    font-weight: 700;
    color: var(--rbac-cream);
    letter-spacing: .01em;
}

.rbac-title span {
    color: var(--rbac-gold);
}

.rbac-hint {
    margin: 0;
    font-size: .95rem;
    color: rgba(247, 240, 227, .8);
}

.rbac-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: clamp(70px, 8.6vw, 94.6px);
    grid-auto-flow: dense;
    gap: clamp(8px, 1.2vw, 14px);
}

@media (max-width: 767px) {
    .rbac-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 479px) {
    .rbac-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 88px;
    }
}

.rbac-door--wide { grid-column: span 2; }
.rbac-door--tall { grid-row: span 2; }
.rbac-door--big { grid-column: span 2; grid-row: span 2; }

/* Tür: Rahmen (Nische) + Flügel, der an der linken Kante aufschwingt */
.rbac-door {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--rbac-radius);
    background: rgba(0, 0, 0, .35);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .55);
    perspective: 900px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.rbac-door:focus-visible {
    outline: 3px solid var(--rbac-gold);
    outline-offset: 3px;
}

.rbac-niche {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--rbac-radius);
    font-size: .8rem;
    font-weight: 600;
    text-align: center;
    color: rgba(247, 240, 227, .55);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.rbac-leaf {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 8px 12px;
    border-radius: var(--rbac-radius);
    transform-origin: left center;
    transition: transform .9s cubic-bezier(.2, .7, .2, 1), box-shadow .9s;
    backface-visibility: hidden;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .18), 0 6px 14px rgba(0, 0, 0, .3);
}

/* Papierstruktur und Zierrahmen auf dem Flügel */
.rbac-leaf::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed currentColor;
    border-radius: calc(var(--rbac-radius) - 4px);
    opacity: .35;
    pointer-events: none;
}

/* Weihnachtsmotiv oben links auf dem Flügel */
.rbac-motif {
    position: absolute;
    top: 9px;
    left: 11px;
    width: clamp(24px, 3.6vw, 40px);
    height: auto;
    color: var(--rbac-motif, currentColor);
    opacity: .9;
    pointer-events: none;
}

.rbac-door--tall .rbac-motif {
    width: clamp(30px, 4.6vw, 50px);
}

.rbac-door--big .rbac-motif {
    top: 50%;
    left: 30%;
    width: clamp(54px, 9vw, 110px);
    transform: translate(-50%, -50%);
}

.rbac-num {
    position: relative;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    font-weight: 800;
    line-height: 1;
}

.rbac-door--big .rbac-num {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
}

.rbac-tone-0 .rbac-leaf { background: var(--rbac-cream); color: var(--rbac-red); --rbac-motif: var(--rbac-green); }
.rbac-tone-1 .rbac-leaf { background: var(--rbac-orange); color: #fff; --rbac-motif: var(--rbac-cream); }
.rbac-tone-2 .rbac-leaf { background: var(--rbac-red); color: var(--rbac-cream); --rbac-motif: var(--rbac-gold); }
.rbac-tone-3 .rbac-leaf { background: #fff; color: var(--rbac-night-deep); --rbac-motif: var(--rbac-red); }
.rbac-tone-4 .rbac-leaf { background: var(--rbac-gold); color: var(--rbac-night-deep); --rbac-motif: var(--rbac-red); }

.rbac-door--big .rbac-leaf {
    background: linear-gradient(145deg, var(--rbac-red), #7d1b1f);
    color: var(--rbac-gold);
    --rbac-motif: var(--rbac-gold);
}

/* Heute: Flügel leuchtet */
.rbac-door--today .rbac-leaf {
    animation: rbac-glow 2.2s ease-in-out infinite;
}

.rbac-door--today .rbac-niche {
    color: var(--rbac-gold);
}

@keyframes rbac-glow {
    0%, 100% { box-shadow: 0 0 0 2px var(--rbac-gold), 0 0 12px 2px rgba(230, 182, 92, .45); }
    50% { box-shadow: 0 0 0 2px var(--rbac-gold), 0 0 26px 8px rgba(230, 182, 92, .75); }
}

/* Offen: heute nach dem Klick, vergangene Tage dauerhaft angelehnt */
.rbac-door--open .rbac-leaf {
    transform: rotateY(-108deg);
    animation: none;
}

.rbac-door--past .rbac-niche {
    justify-content: flex-end;
    padding-right: 10px;
}

.rbac-door--past .rbac-leaf {
    transform: rotateY(-78deg);
    filter: saturate(.4) brightness(.8);
}

.rbac-door--past {
    cursor: default;
}

.rbac-door--future .rbac-niche {
    visibility: hidden;
}

.rbac-shake .rbac-leaf {
    animation: rbac-shake .45s;
}

@keyframes rbac-shake {
    0%, 100% { transform: rotateY(0); }
    25% { transform: rotateY(-9deg); }
    50% { transform: rotateY(-3deg); }
    75% { transform: rotateY(-7deg); }
}

.rbac-toast {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translate(-50%, 8px);
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--rbac-cream);
    color: var(--rbac-ink);
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    white-space: nowrap;
}

.rbac-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.rbac-status {
    padding: 32px 12px;
    text-align: center;
    color: rgba(247, 240, 227, .85);
}

/* Detailansicht */
.rbac-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 20, 16, .72);
    animation: rbac-fade .25s ease-out;
}

@keyframes rbac-fade {
    from { opacity: 0; }
}

.rbac-dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 16px;
    background: #fff;
    color: var(--rbac-ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    animation: rbac-pop .35s cubic-bezier(.2, .8, .3, 1.2);
    font-family: inherit;
    text-align: left;
}

@keyframes rbac-pop {
    from { transform: scale(.85); opacity: 0; }
}

.rbac-dialog-head {
    padding: 18px 56px 14px 22px;
    background: linear-gradient(135deg, var(--rbac-red), #7d1b1f);
    color: var(--rbac-cream);
    border-radius: 16px 16px 0 0;
}

.rbac-eyebrow {
    margin: 0 0 2px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--rbac-gold);
}

.rbac-dialog-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.rbac-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.rbac-close:hover,
.rbac-close:focus-visible {
    background: rgba(255, 255, 255, .3);
}

.rbac-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    padding: 20px 22px 8px;
}

@media (max-width: 559px) {
    .rbac-body {
        grid-template-columns: 1fr;
    }

    .rbac-image {
        width: min(160px, 100%);
        justify-self: center;
    }
}

.rbac-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 12px;
    background: #f4f1ec;
    overflow: hidden;
}

.rbac-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rbac-image--empty {
    font-size: 3.5rem;
}

.rbac-subtitle {
    margin: 0 0 6px;
    color: var(--rbac-muted);
}

.rbac-artnr {
    margin: 0 0 10px;
    font-size: .85rem;
    color: var(--rbac-muted);
}

.rbac-listprice {
    margin: 0 0 12px;
}

.rbac-listprice s {
    color: var(--rbac-muted);
}

.rbac-tiers {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.rbac-tiers th,
.rbac-tiers td {
    padding: 7px 8px;
    border-bottom: 1px solid #ece7df;
    text-align: left;
}

.rbac-tiers th {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--rbac-muted);
}

.rbac-tiers td:last-child,
.rbac-tiers th:last-child {
    text-align: right;
}

.rbac-discount {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: #fdeee2;
    color: #b54c00;
    font-weight: 700;
    white-space: nowrap;
}

.rbac-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--rbac-red);
    white-space: nowrap;
}

.rbac-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 14px 22px 20px;
}

.rbac-note {
    margin: 0;
    font-size: .82rem;
    color: var(--rbac-muted);
}

a.rbac-cta,
a.rbac-cta:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    background: var(--rbac-orange);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(236, 102, 7, .35);
    transition: background .15s, transform .15s;
}

a.rbac-cta:hover,
a.rbac-cta:focus-visible {
    background: #c95503;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

a.rbac-cta::before,
a.rbac-cta::after {
    content: none;
}

.rbac-greeting {
    padding: 36px 26px 34px;
    text-align: center;
}

.rbac-greeting-icon {
    font-size: 3.4rem;
    line-height: 1;
}

.rbac-greeting-text {
    margin: 14px 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--rbac-red);
}

@media (prefers-reduced-motion: reduce) {
    .rbac-leaf,
    .rbac-door--today .rbac-leaf,
    .rbac-shake .rbac-leaf,
    .rbac-overlay,
    .rbac-dialog {
        animation: none;
        transition: none;
    }
}
