/*
 * Warenkorb-Panel (inc/kasse-v2.php): helle Box unter dem
 * Warenkorb-Symbol, mobil ein Blatt von unten. Nur im Testmodus geladen.
 */
/* Root is alleen een klik-vanger buiten de box; hij dimt het scherm niet. */
.cgk2-panel {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear 0.25s;
}

.cgk2-panel__overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.cgk2-panel__box {
    position: fixed;
    top: var(--cgk2-p-top, 80px);
    right: var(--cgk2-p-right, 24px);
    left: auto;
    bottom: auto;
    width: min(356px, calc(100vw - 16px));
    max-height: 480px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(20, 14, 8, 0.16), 0 2px 8px rgba(20, 14, 8, 0.08);
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
    box-sizing: border-box;
    overflow: hidden;
    font-family: "Inter", Tahoma, sans-serif;
}

body.cgk2-panel-offen .cgk2-panel {
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

body.cgk2-panel-offen .cgk2-panel__overlay {
    pointer-events: auto;
}

body.cgk2-panel-offen .cgk2-panel__box {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cgk2-panel__kop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px 10px 16px;
    border-bottom: 1px solid #f0ece8;
    flex: 0 0 auto;
    background: #fff;
}

.cgk2-panel__titel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: "Oswald", "Inter", sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #221c17;
    text-transform: uppercase;
}

.cgk2-panel__anzahl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 100vw;
    background: #ef7c00;
    color: #fff;
    font-family: "Inter", Tahoma, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

.cgk2-panel__zu {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 6px;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #8a8178;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.cgk2-panel__zu:hover {
    color: #221c17;
    background: #f6f2ee;
}

.cgk2-panel__zu:focus-visible,
.cgk2-panel__link:focus-visible,
.cgk2-panel__weg:focus-visible,
.cgk2-panel__btn:focus-visible {
    outline: 2px solid #ef7c00;
    outline-offset: 2px;
}

/* Gratis-verzenden balk (hergebruikte markup, aangepast aan de popup). */
.cgk2-panel .cgk2-balken {
    max-width: none;
    margin: 12px 16px 0;
    text-align: left;
    flex: 0 0 auto;
}

.cgk2-panel .cgk2-balken__text {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.45;
    color: #4a443e;
}

.cgk2-panel .cgk2-balken__spur {
    height: 7px;
    border: 0;
    border-radius: 100vw;
    background: #f3efeb;
    overflow: hidden;
}

.cgk2-panel .cgk2-balken__fuell {
    display: block; /* het is een <span>: zonder block geen breedte/hoogte, dan bleef de balk leeg */
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f79021, #ef7c00);
    transition: width 0.3s ease;
}

.cgk2-panel__inhalt {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
    overscroll-behavior: contain;
}

.cgk2-panel__leer {
    margin: 36px 0;
    text-align: center;
    font-size: 13.5px;
    color: #8a8178;
}

.cgk2-panel__item {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0ece8;
}

.cgk2-panel__item.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.cgk2-panel__item:last-child {
    border-bottom: 0;
}

.cgk2-panel__bild {
    display: block;
    width: 60px;
    height: 60px;
    border: 1px solid #f0ece8;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s ease;
}

.cgk2-panel__bild:hover {
    border-color: #ef7c00;
}

.cgk2-panel__bild img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cgk2-panel__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cgk2-panel__name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #221c17;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cgk2-panel__name:hover {
    color: #ef7c00;
    text-decoration: none;
}

.cgk2-panel__meta {
    font-size: 11.5px;
    color: #8a8178;
    line-height: 1.35;
}

.cgk2-panel__zeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}

.cgk2-panel__menge {
    display: inline-flex;
    align-items: stretch;
    border: 0;
    border-radius: 6px;
    background: #f6f2ee;
    overflow: hidden;
    height: 34px;
    box-sizing: border-box;
}

.cgk2-panel__btn {
    width: 30px;
    border: 0;
    background: transparent;
    font-size: 15px;
    line-height: 1;
    color: #4a443e;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
}

.cgk2-panel__btn:hover {
    background: #ebe4dd;
    color: #221c17;
}

.cgk2-panel__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: transparent;
}

/* Product dat maar één keer gekocht kan worden: geen +/−. */
.cgk2-panel__solo {
    font-size: 12.5px;
    color: #8a8178;
}

/* Melding als wijzigen niet lukt (bijv. niet genoeg voorraad). */
.cgk2-panel__msg {
    margin: 2px 0 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: #b3261e;
}

.cgk2-panel__zahl {
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #221c17;
}

.cgk2-panel__preis {
    font-size: 14px;
    font-weight: 700;
    color: #221c17;
    white-space: nowrap;
}

.cgk2-panel__weg {
    align-self: flex-start;
    border: 0;
    background: none;
    padding: 3px 0 0;
    margin: 0;
    font-family: inherit;
    font-size: 11.5px;
    color: #8a8178;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    min-height: 24px;
    transition: color 0.15s ease;
}

.cgk2-panel__weg:hover {
    color: #c0392b;
}

.cgk2-panel__fuss {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #f0ece8;
    background: #faf8f6;
}

.cgk2-panel__summe {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    color: #4a443e;
}

.cgk2-panel__summe span {
    color: #8a8178;
}

.cgk2-panel__summe strong {
    font-size: 17px;
    font-weight: 700;
    color: #221c17;
}

.cgk2-panel__link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    background: #12ad52;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.cgk2-panel__link:hover {
    background: #0f9246;
    color: #fff;
}

.cgk2-panel__link:active {
    transform: translateY(1px);
}

/* Mobiel: sheet onderaan het scherm. */
@media screen and (max-width: 767px) {

    .cgk2-panel__box {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 32px rgba(20, 14, 8, 0.2);
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .cgk2-panel__box::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 100vw;
        background: #e5dfd9;
    }

    body.cgk2-panel-offen .cgk2-panel__box {
        transform: translateY(0);
    }

    .cgk2-panel__kop {
        padding-top: 18px;
    }

    .cgk2-panel__link {
        height: 48px;
    }

    .cgk2-panel__fuss {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .cgk2-panel__inhalt {
        padding: 0 16px;
    }

    .cgk2-panel .cgk2-balken {
        margin: 12px 16px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cgk2-panel,
    .cgk2-panel__overlay,
    .cgk2-panel__box {
        transition: none;
    }
}

/* Ergänzungen DE */
.cgk2-panel__titel { font-weight: 600; letter-spacing: 0.02em; }
.cgk2-panel .cgk2-balken--leer { display: none; }
.cgk2-panel .cgk2-balken__text strong { color: #b35500; }
.cgk2-panel .cgk2-balken__text svg { vertical-align: -3px; color: #12ad52; }
.cgk2-panel .cgk2-balken.is-gratis .cgk2-balken__text strong { color: #0f7a3a; }
.cgk2-panel .cgk2-balken.is-gratis .cgk2-balken__fuell { background: #12ad52; }
.cgk2-panel .cgk2-balken--spedition .cgk2-balken__text strong { color: #221c17; }
.cgk2-panel__summe small { font-size: 11px; color: #8a8178; margin-left: 4px; }
.cgk2-panel__preis .woocommerce-Price-amount, .cgk2-panel__summe .woocommerce-Price-amount { color: inherit; }
.cgk2-panel__preis small, .cgk2-panel__preis .tax_label { display: none; }
.cgk2-panel__btn { color: #4a443e !important; }
.cgk2-panel__link, .cgk2-panel__link:visited { color: #fff !important; }
/* WooCommerce-Meldung nach normalem Absenden: das Panel zeigt es schon */
body .woocommerce-message.cgk2-ersetzt { display: none !important; }
/* Leiste unten auf der Produktseite nicht über dem offenen Panel */
body.cgk2-panel-offen #sticky-add-to-cart { display: none !important; }
