/* Cave & Garden sidecart — compacte popup. Tokens: #ef7c00, Inter, radius 4px. */

/* Xoo sidecart-plugin visueel verbergen (plugin blijft actief). */
.xoo-wsc-basket,
.xoo-wsc-modal {
    display: none !important;
}

/* Root is alleen een klik-vanger buiten de box; hij dimt het scherm niet. */
.cg-sidecart {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear 0.25s;
}

.cg-sidecart__overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.cg-sidecart__panel {
    position: fixed;
    top: var(--cg-sc-top, 80px);
    right: var(--cg-sc-right, 24px);
    left: auto;
    bottom: auto;
    width: min(340px, calc(100vw - 16px));
    max-height: 480px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid hsl(0, 0%, 89%);
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-sizing: border-box;
    overflow: hidden;
}

body.cg-sidecart-open .cg-sidecart {
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

body.cg-sidecart-open .cg-sidecart__overlay {
    pointer-events: auto;
}

body.cg-sidecart-open .cg-sidecart__panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cg-sidecart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 4px 14px;
    border-bottom: 1px solid hsl(0, 0%, 89%);
    flex: 0 0 auto;
}

.cg-sidecart__title {
    margin: 0;
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.03em;
    color: #221c17;
    text-transform: uppercase;
}

.cg-sidecart__close {
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #221c17;
    cursor: pointer;
}

.cg-sidecart__close:focus-visible,
.cg-sidecart__checkout:focus-visible,
.cg-sidecart__cartlink:focus-visible,
.cg-sidecart__remove:focus-visible,
.cg-sidecart__qty-btn:focus-visible {
    outline: 2px solid #ef7c00;
    outline-offset: 2px;
}

/* Gratis-verzenden balk (hergebruikte markup, aangepast aan de popup). */
.cg-sidecart .cg-free-shipping-bar {
    max-width: none;
    margin: 10px 14px 0;
    text-align: left;
    flex: 0 0 auto;
}

.cg-sidecart .cg-free-shipping-bar__text {
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1.4;
    color: #221c17;
}

.cg-sidecart .cg-free-shipping-bar__track {
    height: 7px;
}

.cg-sidecart__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px;
}

.cg-sidecart__empty {
    margin: 32px 0;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.cg-sidecart__item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid hsl(0, 0%, 89%);
}

.cg-sidecart__item.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.cg-sidecart__item:last-child {
    border-bottom: 0;
}

.cg-sidecart__thumb {
    display: block;
    width: 56px;
    height: 56px;
    border: 1px solid hsl(0, 0%, 89%);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

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

.cg-sidecart__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.cg-sidecart__name {
    font-family: "Inter", Tahoma, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: #221c17;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cg-sidecart__name:hover {
    text-decoration: underline;
}

.cg-sidecart__meta {
    font-size: 11.5px;
    color: #666;
    line-height: 1.3;
}

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

.cg-sidecart__qty {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    height: 34px;
    box-sizing: border-box;
}

.cg-sidecart__qty-btn {
    width: 32px;
    border: 0;
    background: #fff;
    font-size: 15px;
    line-height: 1;
    color: #221c17;
    cursor: pointer;
    padding: 0;
}

.cg-sidecart__qty-btn:hover {
    background: #f6f6f6;
}

.cg-sidecart__qty-num {
    min-width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    color: #221c17;
}

.cg-sidecart__line {
    font-size: 13.5px;
    font-weight: 700;
    color: #221c17;
    white-space: nowrap;
}

.cg-sidecart__remove {
    align-self: flex-start;
    border: 0;
    background: none;
    padding: 4px 0 0;
    margin: 0;
    font-family: inherit;
    font-size: 11.5px;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    min-height: 24px;
}

.cg-sidecart__remove:hover {
    color: #221c17;
}

.cg-sidecart__foot {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid hsl(0, 0%, 89%);
    background: #fff;
}

.cg-sidecart__subtotal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    color: #221c17;
}

.cg-sidecart__subtotal span {
    color: #666;
}

.cg-sidecart__subtotal strong {
    font-size: 16px;
    font-weight: 700;
}

.cg-sidecart__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    background: #ef7c00;
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    border-radius: 4px;
    text-decoration: none;
}

.cg-sidecart__checkout:hover {
    background: #de6f00;
    color: #fff;
}

.cg-sidecart__cartlink {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    font-size: 12.5px;
    color: #221c17;
    text-decoration: underline;
}

/* Mobiel: sheet onderaan het scherm. */
@media screen and (max-width: 767px) {
    .cg-sidecart__panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 70vh;
        border: 0;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.cg-sidecart-open .cg-sidecart__panel {
        transform: translateY(0);
    }

    .cg-sidecart__checkout {
        height: 48px;
    }

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

    .cg-sidecart__body {
        padding: 0 16px;
    }

    .cg-sidecart .cg-free-shipping-bar {
        margin: 12px 16px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cg-sidecart,
    .cg-sidecart__overlay,
    .cg-sidecart__panel {
        transition: none;
    }
}
