#sidepromo-root[hidden],
#sidepromo-menu-dim[hidden] {
    display: none !important;
}

#sidepromo-root {
    --sp-width: 250px;
    --sp-gap: 24px;
    --sp-max-height: 75vh;
    --sp-mobile-shadow: 0 0 28px 3px rgba(0, 0, 0, .3);
    position: static;
    font-family: inherit;
}

body.sidepromo-layout-active {
    min-width: 0;
}

#sidepromo-root .sp-slot {
    position: fixed;
    width: var(--sp-width);
    height: auto;
    z-index: 1025;
    font-family: inherit;
}

#sidepromo-root .sp-left {
    left: var(--sp-gap);
}

#sidepromo-root .sp-right {
    right: var(--sp-gap);
}

#sidepromo-root .sp-v-top {
    top: var(--sp-gap);
}

#sidepromo-root .sp-v-center {
    top: 50%;
    transform: translateY(-50%);
}

#sidepromo-root .sp-v-bottom {
    bottom: var(--sp-gap);
}

#sidepromo-root .sp-card {
    --sp-card-scale: 1;
    position: relative;
    display: block;
    width: 100%;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(31, 35, 40, .22);
    overflow: visible;
    transform: scale(var(--sp-card-scale));
    transform-origin: top center;
}

#sidepromo-root .sp-media-link,
#sidepromo-root .sp-media-static {
    display: block;
    width: 100%;
    border-radius: 16px;
    outline: 0;
    overflow: hidden;
}

#sidepromo-root .sp-media-link:focus-visible,
#sidepromo-root .sp-cta:focus-visible {
    outline: 3px solid rgba(244, 124, 0, .45);
    outline-offset: 2px;
}

#sidepromo-root .sp-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: var(--sp-max-height);
    object-fit: contain;
    border-radius: 16px;
}

#sidepromo-root .sp-card.sp-has-offer .sp-image {
    max-height: var(--sp-max-height);
    border-radius: 16px 16px 0 0;
}

#sidepromo-root .sp-card.sp-has-offer
.sp-media-link,
#sidepromo-root .sp-card.sp-has-offer
.sp-media-static {
    border-radius: 16px 16px 0 0;
}

#sidepromo-root .sp-offer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    border-radius: 0 0 16px 16px;
    background: #fff;
    text-align: center;
}

#sidepromo-root .sp-price-old {
    color: var(--gray, #707070);
    font-size: .82rem;
    line-height: 1.1;
}

#sidepromo-root .sp-price-current {
    color: var(--dark, #343a40);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

#sidepromo-root .sp-cta {
    display: block;
    width: 100%;
    margin-top: 3px;
    padding: 9px 10px;
    border: 1px solid var(--primary, #f8bf00);
    border-radius: 12px;
    background: var(--primary, #f8bf00);
    color: var(--dark, #343a40);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

#sidepromo-root .sp-cta:hover {
    filter: brightness(.94);
    color: var(--dark, #343a40);
    text-decoration: none;
}

#sidepromo-root .sp-offer-template {
    text-align: center;
}

#sidepromo-root .sp-template-offer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    text-align: center;
}

#sidepromo-root .sp-template-price {
    min-width: 0;
    width: 100%;
    text-align: center !important;
}

#sidepromo-root .sp-template-price *,
#sidepromo-root .sp-template-price .productbox-price,
#sidepromo-root .sp-template-price .price_wrapper,
#sidepromo-root .sp-template-price .price,
#sidepromo-root .sp-template-price .old-price,
#sidepromo-root .sp-template-price del,
#sidepromo-root .sp-template-price small {
    text-align: center !important;
}

#sidepromo-root .sp-template-price
.d-flex,
#sidepromo-root .sp-template-price
.row {
    justify-content: center !important;
}

#sidepromo-root .sp-template-price
[class*="justify-content-"] {
    justify-content: center !important;
}

/*
 * Die eigentliche Preisgestaltung stammt aus productdetails/price.tpl.
 * SidePromo begrenzt hier nur übergroße Abstände innerhalb der schmalen
 * Bannerfläche, ohne die Templatefarben oder Preislogik zu ersetzen.
 */
#sidepromo-root .sp-template-price
.productbox-price,
#sidepromo-root .sp-template-price
.price_wrapper {
    margin-bottom: 0;
}

#sidepromo-root .sp-template-cta {
    display: block;
    width: 100%;
    border-radius: 12px !important;
    text-align: center;
    text-decoration: none;
}

#sidepromo-root .sp-template-cta:hover {
    text-decoration: none;
}

#sidepromo-root .sp-close {
    position: absolute;
    top: -11px;
    right: -11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1f2328;
    color: #fff;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(31, 35, 40, .28);
}

#sidepromo-root .sp-close:hover,
#sidepromo-root .sp-close:focus-visible {
    background: #f47c00;
}

#sidepromo-root .sp-mobile-bottom {
    position: fixed;
    top: auto;
    right: auto;
    bottom: 14px;
    left: 50%;
    width: min(calc(100vw - 28px), 750px);
    transform: translateX(-50%);
}

#sidepromo-root .sp-mobile-bottom .sp-image {
    max-height: min(250px, 30vh);
    object-fit: contain;
}

#sidepromo-root .sp-mobile-bottom
.sp-card.sp-has-offer .sp-image {
    max-height: min(165px, 21vh);
}

#sidepromo-root .sp-mobile-bottom .sp-offer {
    padding: 8px 12px 10px;
}

#sidepromo-root .sp-mobile-bottom
.sp-price-current {
    font-size: 1.2rem;
}

#sidepromo-root .sp-mobile-bottom .sp-cta {
    display: none !important;
}

/*
 * Mobile Kompaktansicht:
 * Die Preisbestandteile aus productdetails/price.tpl werden in einer
 * gemeinsamen Zeile dargestellt. Der CTA entfällt vollständig.
 */
#sidepromo-root .sp-mobile-bottom
.sp-offer-template {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 6px 10px 8px;
    overflow: hidden;
}

#sidepromo-root .sp-mobile-bottom
.sp-template-offer {
    display: block;
    width: 100%;
}

#sidepromo-root .sp-mobile-bottom
.sp-template-cta {
    display: none !important;
}

#sidepromo-root .sp-mobile-bottom,
#sidepromo-root .sp-mobile-bottom .sp-card,
#sidepromo-root .sp-mobile-bottom .sp-offer,
#sidepromo-root .sp-mobile-bottom .sp-template-offer,
#sidepromo-root .sp-mobile-bottom .sp-template-price {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

#sidepromo-root .sp-mobile-bottom .sp-card {
    overflow: visible;
    box-shadow: var(--sp-mobile-shadow);
}

#sidepromo-root .sp-mobile-bottom .sp-offer,
#sidepromo-root .sp-mobile-bottom
.sp-template-price {
    overflow: hidden;
}

#sidepromo-root .sp-mobile-bottom
.sp-template-price,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-fallback-price {
    position: relative;
    left: auto !important;
    right: auto !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    transform: none !important;
    text-align: center !important;
}

#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-center {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: max-content;
    min-width: max-content;
    max-width: none;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
    transform-origin: top center;
}

#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit {
    --sp-mobile-price-scale: 1;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 6px;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    transform: scale(var(--sp-mobile-price-scale));
    transform-origin: top center;
}

#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit > *,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit .productbox-price,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit .price_wrapper,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit .d-flex,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit .row,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit [class*="justify-content-"],
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit [class*="col-"] {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 6px;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit .price,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit .old-price,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit del,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit small,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit span,
#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit p {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: baseline !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

#sidepromo-root .sp-mobile-bottom
.sp-mobile-price-fit br {
    display: none !important;
}

#sidepromo-root .sp-mobile-bottom
.sp-price-old,
#sidepromo-root .sp-mobile-bottom
.sp-price-current {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    margin: 0;
    white-space: nowrap;
}

#sidepromo-root .sp-mobile-bottom
.sp-offer:not(.sp-offer-template) {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    padding: 7px 10px 9px;
}

/*
 * Das NOVA-Menü dunkelt den normalen Shopbereich ab. Durch das vom Plugin
 * reservierte Body-Padding blieben die äußeren Seitenflächen sonst hell.
 * Diese beiden Streifen schließen nur diese Lücke. Die Banner liegen mit
 * z-index 1025 darüber und bleiben unverändert sichtbar.
 */
#sidepromo-menu-dim {
    --sp-reserved-width: 298px;
    position: fixed;
    inset: 0;
    z-index: 1019;
    pointer-events: none;
}

#sidepromo-menu-dim .sp-menu-dim-strip {
    position: absolute;
    top: 0;
    bottom: 0;
    display: none;
    width: var(--sp-reserved-width);
    background: rgba(0, 0, 0, .48);
}

#sidepromo-menu-dim .sp-menu-dim-left {
    left: 0;
}

#sidepromo-menu-dim .sp-menu-dim-right {
    right: 0;
}

#sidepromo-menu-dim.sp-menu-dim-left-active
.sp-menu-dim-left,
#sidepromo-menu-dim.sp-menu-dim-right-active
.sp-menu-dim-right {
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    #sidepromo-root:not([hidden]) .sp-slot {
        animation: sp-in .24s ease-out both;
    }

    @keyframes sp-in {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}


/*
 * Mobil liegt die Schließen-Schaltfläche vollständig innerhalb der Karte.
 * Dadurch kann sie weder vom Kartenradius noch vom Viewport abgeschnitten
 * werden. Desktop behält weiterhin die außenliegende Schaltfläche.
 */
#sidepromo-root .sp-mobile-bottom .sp-close {
    top: 7px;
    right: 7px;
    z-index: 20;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, .95);
    background: rgba(31, 35, 40, .9);
    box-shadow: 0 4px 12px rgba(31, 35, 40, .3);
}

#sidepromo-root .sp-mobile-bottom .sp-close:hover,
#sidepromo-root .sp-mobile-bottom .sp-close:focus-visible {
    background: var(--primary, #f47c00);
}

@media (max-width: 420px) {
    #sidepromo-root .sp-mobile-bottom
    .sp-mobile-price-fit {
        gap: 4px;
        font-size: clamp(.72rem, 3.2vw, .9rem);
        line-height: 1.2;
    }

    #sidepromo-root .sp-mobile-bottom
    .sp-mobile-price-fit .price,
    #sidepromo-root .sp-mobile-bottom
    .sp-mobile-price-fit .old-price,
    #sidepromo-root .sp-mobile-bottom
    .sp-mobile-price-fit del {
        font-size: inherit;
    }

    #sidepromo-root .sp-mobile-bottom
    .sp-offer-template {
        padding-left: 7px;
        padding-right: 7px;
    }
}

@media print {
    #sidepromo-root,
    #sidepromo-menu-dim {
        display: none !important;
    }

    body.sidepromo-layout-active {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
