/*
 * STIERS Warenkorb — Desktop-Drawer
 *
 * Nur auf der Warenkorbseite und erst ab 1100 px geladen. Der mobile
 * 402-px-Warenkorb in rework.css bleibt dadurch vollständig unverändert.
 */

body.woocommerce-cart {
    --stiers-cart-panel: clamp(560px, 44vw, 650px);
    min-height: 100svh;
    background: #090302;
}

/* Ruhige Markenfläche links. Das Produktmotiv bleibt rein dekorativ; der
 * eigentliche Warenkorb bildet rechts eine klar getrennte Bedienebene. */
body.woocommerce-cart::before {
    content: "";
    position: fixed;
    inset: 0 var(--stiers-cart-panel) 0 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(1,1,1,.28), rgba(1,1,1,.02) 58%, rgba(1,1,1,.7)),
        linear-gradient(0deg, rgba(1,1,1,.62), rgba(1,1,1,0) 48%),
        url("../img/v9-hero-desktop.webp") 62% center / cover no-repeat;
}

body.woocommerce-cart .wp-site-blocks {
    position: relative;
    min-height: 100svh;
    background: transparent;
}

/* Der Footer gehört nicht in den Drawer. Warenkorb, Zahlung und Schließen
 * bleiben vollständig innerhalb des rechten Panels erreichbar. */
body.woocommerce-cart .wp-block-template-part:has(.rw-footer),
body.woocommerce-cart footer.wp-block-group {
    display: none;
}

body.woocommerce-cart main.rw-cartpage {
    position: relative;
    z-index: 2;
    width: var(--stiers-cart-panel);
    max-width: none;
    min-height: 100svh;
    height: auto;
    margin: 0 0 0 auto !important;
    padding: 0;
    overflow: visible;
    background: rgba(7,7,7,.985);
    border-left: 1px solid rgba(255,255,255,.1);
    box-shadow: -24px 0 70px rgba(0,0,0,.46);
    box-sizing: border-box;
    animation: rw-slide-in .34s ease;
}

body.woocommerce-cart.stiers-cart-updated main.rw-cartpage {
    animation: none;
}

body.woocommerce-cart main.rw-cartpage > .wp-block-post-content,
body.woocommerce-cart main.rw-cartpage > .wp-block-post-content > .woocommerce,
body.woocommerce-cart main.rw-cartpage .woocommerce {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.woocommerce-cart .rw-cart-close {
    top: 24px;
    right: 28px;
    z-index: 60;
}

body.woocommerce-cart .stiers-cartpage {
    width: 100%;
    min-height: 100svh;
    background: transparent;
}

body.woocommerce-cart .stiers-cartpage-inner {
    width: 100%;
    max-width: none;
    padding: 82px clamp(42px, 4vw, 62px) 84px;
    box-sizing: border-box;
}

body.woocommerce-cart .stiers-cart-hd {
    width: 100%;
    height: auto;
    margin: 0 0 34px;
}

body.woocommerce-cart .stiers-cart-title {
    height: auto;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: .035em;
}

/* Produktzeilen nutzen die Breite des Drawers, nicht die mobilen Fixspalten. */
body.woocommerce-cart .stiers-cart-items {
    width: 100%;
    gap: 0;
}

body.woocommerce-cart .stiers-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 72px 28px;
    align-items: center;
    column-gap: 10px;
    width: 100%;
    min-height: 112px;
    height: auto;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,.11);
    box-sizing: border-box;
}

body.woocommerce-cart .stiers-cart-item-left {
    width: auto;
    min-width: 0;
    flex: none;
    gap: 14px;
}

body.woocommerce-cart .stiers-cart-item-img,
body.woocommerce-cart .stiers-cart-item-img a,
body.woocommerce-cart .stiers-cart-item-img img {
    width: 82px;
    height: 82px;
    border-radius: 0;
}

body.woocommerce-cart .stiers-cart-item-name {
    font-size: 15px;
    line-height: 1.35;
}

body.woocommerce-cart .stiers-cart-item-size {
    margin-top: 3px;
    color: rgba(255,255,255,.48);
}

body.woocommerce-cart .stiers-cart-item-qty,
body.woocommerce-cart .stiers-cart-qty-control {
    width: 96px;
}

body.woocommerce-cart .stiers-cart-qty-control {
    height: 42px;
    padding: 6px;
    gap: 9px;
    box-sizing: border-box;
}

body.woocommerce-cart .stiers-cart-item-price {
    width: 72px;
}

body.woocommerce-cart .stiers-cart-item-remove {
    width: 28px;
    height: 28px;
}

body.woocommerce-cart .stiers-cart-remove {
    width: 28px;
    height: 28px;
}

/* Gutschein und Versandfortschritt bilden im Drawer eine volle Zeile. */
body.woocommerce-cart .stiers-coupon-row {
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    height: 52px;
    margin: 24px 0 18px;
    gap: 18px;
}

body.woocommerce-cart .stiers-coupon-field,
body.woocommerce-cart .stiers-coupon-input {
    width: 100%;
}

body.woocommerce-cart .stiers-coupon-input {
    padding-right: 54px;
}

body.woocommerce-cart .stiers-free-shipping-bar,
body.woocommerce-cart .stiers-free-shipping-bar--active,
body.woocommerce-cart .stiers-free-shipping-progress {
    width: 100%;
}

body.woocommerce-cart .stiers-cart-continue {
    width: max-content;
    height: auto;
    margin: 32px auto 42px;
}

/* Zusammenfassung bleibt ein Block, wächst aber mit echten Plugin-Inhalten. */
body.woocommerce-cart .stiers-cart-summary-box {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 30px 32px 32px;
    border-radius: 28px;
    box-sizing: border-box;
}

body.woocommerce-cart .stiers-cart-summary-heading {
    width: 100%;
    height: auto;
    margin: 0 0 28px;
}

body.woocommerce-cart .stiers-cart-summary-rows {
    width: 100%;
    gap: 12px;
}

body.woocommerce-cart .stiers-cart-summary-row,
body.woocommerce-cart .stiers-cart-summary-row--total,
body.woocommerce-cart .stiers-cart-summary-row--tax {
    width: 100%;
    height: auto;
    min-height: 18px;
    margin: 0;
    padding: 0;
}

body.woocommerce-cart .stiers-cart-summary-row--total {
    min-height: 27px;
    margin-top: 4px;
}

body.woocommerce-cart .stiers-cart-checkout-btn,
body.woocommerce-cart .stiers-cart-express,
body.woocommerce-cart .stiers-cart-paypal-preview,
body.woocommerce-cart .stiers-cart-wallet {
    width: 100%;
    max-width: none;
}

body.woocommerce-cart .stiers-cart-checkout-btn {
    margin-top: 30px;
}

body.woocommerce-cart .stiers-cart-express .ppc-button-wrapper,
body.woocommerce-cart .stiers-cart-express .ppc-button-container,
body.woocommerce-cart .stiers-cart-express [id^="ppc-button-"],
body.woocommerce-cart .stiers-cart-express .paypal-buttons,
body.woocommerce-cart .stiers-cart-express iframe {
    width: 100% !important;
    max-width: none !important;
}

/* Leerer Warenkorb: Empfehlungen bleiben innerhalb desselben rechten Drawers. */
body.woocommerce-cart:has(.rw-emptycart) main.rw-cartpage {
    height: auto;
    min-height: 100svh;
    padding: 0;
    overflow: visible;
}

body.woocommerce-cart:has(.rw-emptycart) .rw-cart-close {
    display: flex;
}

/* Das Empty-Cart-Override rendert historisch zusätzlich den mobilen Header.
 * Im Desktop-Drawer würde dessen Hamburger direkt unter dem Schließen liegen. */
body.woocommerce-cart .rw-cartpage .site-header.sx-header {
    display: none;
}

body.woocommerce-cart .rw-emptycart {
    position: relative;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100svh;
    margin: 0;
    padding: 104px 42px 72px;
    box-sizing: border-box;
}

body.woocommerce-cart .rw-emptycart > .rw-h1,
body.woocommerce-cart .rw-emptycart > .rw-pp-copy {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    text-align: left;
}

body.woocommerce-cart .rw-emptycart > .rw-h1 {
    font-size: 36px;
    line-height: 1.15;
}

body.woocommerce-cart .rw-emptycart > .rw-pp-copy {
    max-width: 420px;
    margin-top: 16px;
    line-height: 1.65;
}

body.woocommerce-cart .rw-emptycart-carousel {
    position: static;
    display: flex;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 40px 0 0;
    padding: 0 0 14px;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    box-sizing: border-box;
}

body.woocommerce-cart .rw-emptycart-card {
    position: relative;
    flex: 0 0 228px;
    width: 228px;
    max-width: 228px;
    height: 424px;
    padding: 18px 14px;
}

body.woocommerce-cart .rw-emptycart-card > img {
    width: 228px;
    height: 424px;
}

body.woocommerce-cart .rw-emptycart-card .rw-btn {
    left: 14px;
    width: 200px;
}

@media (min-width: 1500px) {
    body.woocommerce-cart {
        --stiers-cart-panel: 650px;
    }
}

/* Im eigentlichen Popup-Frame füllt der Warenkorb die Panelbreite. Die
 * Markenfläche gehört zur darunterliegenden Seite und wird hier entfernt. */
body.woocommerce-cart.stiers-cart-overlay-frame {
    --stiers-cart-panel: 100vw;
    min-width: 0;
    background: #070707;
    overflow-x: hidden;
}

body.woocommerce-cart.stiers-cart-overlay-frame::before {
    display: none;
}

body.woocommerce-cart.stiers-cart-overlay-frame .wp-site-blocks {
    min-height: 100%;
    background: #070707;
}

body.woocommerce-cart.stiers-cart-overlay-frame main.rw-cartpage {
    width: 100%;
    min-height: 100%;
    margin: 0 !important;
    border-left: 0;
    box-shadow: none;
    animation: none;
}

body.woocommerce-cart.stiers-cart-overlay-frame .rw-cart-close {
    display: none !important;
}

body.woocommerce-cart.stiers-cart-overlay-frame .stiers-cartpage-inner {
    padding-top: 82px;
    padding-bottom: 64px;
}

body.woocommerce-cart.stiers-cart-overlay-frame .rw-emptycart {
    min-height: 100%;
    padding-top: 90px;
}

body.woocommerce-cart.stiers-cart-overlay-frame::-webkit-scrollbar {
    width: 8px;
}

body.woocommerce-cart.stiers-cart-overlay-frame::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: rgba(255,255,255,.18);
}
