/* ─── Overlay + wrapper ─────────────────────────────────────────────────── */
.ccp-popup-wrapper {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}
.ccp-popup-wrapper.is-visible {
    display: flex;
}
.ccp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

/* ─── Container ─────────────────────────────────────────────────────────── */
.ccp-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--ccp-popup-max-width, 1210px);
    background: var(--ccp-popup-bg, #fff);
    border-radius: var(--ccp-popup-radius, 6px);
    overflow: hidden;
    font-family: "museo-sans", sans-serif;
}

/* ─── Sluitknop ─────────────────────────────────────────────────────────── */
.ccp-close-x {
    position: absolute;
    top: 12px;
    right: 14px;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    line-height: 1;
    z-index: 10;
    background: none;
    border: none;
    padding: 4px;
}
.ccp-close-x:hover { color: #333; }

/* ─── Header ────────────────────────────────────────────────────────────── */
.ccp-header {
    padding: 14px 20px 10px;
    border-bottom: 1px solid #eee;
}
.ccp-header h2 {
    font-size: var(--ccp-heading-size, 20px);
    font-weight: 700;
    color: var(--ccp-heading-color, #333333);
    margin: 0;
    line-height: 1.2;
}

/* ─── Product rij ───────────────────────────────────────────────────────── */
.ccp-product-row {
    display: flex;
    align-items: center;
    padding: var(--ccp-row-padding-v, 14px) var(--ccp-row-padding-h, 20px);
    min-height: 138px;
}

/* #ccp-product-slot laat zijn children direct in de flex-rij verschijnen */
#ccp-product-slot {
    display: contents;
}

/* Afbeelding */
.ccp-image-col {
    flex: 0 0 120px;
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ccp-image-col img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    display: block;
}

/* Productinfo */
.ccp-details-col {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.ccp-details-col h3 {
    font-size: var(--ccp-name-size, 19px);
    font-weight: var(--ccp-name-weight, 600);
    color: var(--ccp-name-color, #333333);
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.ccp-levertijd-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--ccp-levertijd-color, #333333);
    line-height: 1.4;
}
.ccp-stock-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ccp-stock-color, #47cfac);
    font-weight: 500;
}
.ccp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ccp-stock-color, #47cfac);
    flex-shrink: 0;
}

/* Prijs */
.ccp-price-col {
    flex: 0 0 130px;
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}
.ccp-price-col .ccp-price {
    font-size: var(--ccp-price-size, 22px);
    font-weight: 700;
    color: var(--ccp-price-color, #333333);
    white-space: nowrap;
}

/* Knoppen */
.ccp-buttons-col {
    flex: 0 0 220px;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 20px 10px 10px;
}
.ccp-btn-bestellen {
    background: var(--ccp-btn-order-bg, #47cfac);
    color: var(--ccp-btn-order-color, #fff);
    border: none;
    border-radius: var(--ccp-btn-order-radius, 5px);
    height: var(--ccp-btn-height, 46px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.ccp-btn-bestellen:hover { filter: brightness(0.9); color: var(--ccp-btn-order-color, #fff); text-decoration: none; }

.ccp-btn-winkelen {
    background: var(--ccp-btn-cont-bg, #f5f7fa);
    color: var(--ccp-btn-cont-color, #f7642a);
    border: 1px solid #dadada;
    border-radius: var(--ccp-btn-cont-radius, 5px);
    height: var(--ccp-btn-height, 46px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.ccp-btn-winkelen:hover { background: #edf0f4; }

/* ─── Divider ────────────────────────────────────────────────────────────── */
.ccp-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 0;
}

/* ─── InnerBlocks zone ──────────────────────────────────────────────────── */
.ccp-innerblocks {
    padding: 14px 20px 18px;
}

/* ─── Loading spinner ───────────────────────────────────────────────────── */
.ccp-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ─── Afbeelding placeholder in editor canvas ───────────────────────────── */
.ccp-placeholder-img {
    width: 110px;
    height: 110px;
    background: #f0f0f0;
    border-radius: 4px;
}

/* ─── Editor canvas ─────────────────────────────────────────────────────── */
.wp-block-custom-cart-popup-cart-popup {
    font-family: "museo-sans", sans-serif;
}
.wp-block-custom-cart-popup-cart-popup .ccp-container {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* ─── Body scroll lock — JS zet position:fixed + top, CSS hoeft alleen mee te liften ── */
body.ccp-open { overflow: hidden; touch-action: none; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBIEL  (< 576px)
   Gestapelde layout: afbeelding → details → prijs → knoppen, vol breed.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 575px) {
    .ccp-popup-wrapper {
        padding: 16px;
        align-items: center;
    }
    .ccp-container {
        border-radius: 12px;
        max-height: 92vh;
        overflow-y: auto;
    }
    .ccp-header {
        padding: 16px 16px 12px;
    }
    .ccp-header h2 {
        font-size: 18px;
        padding-right: 28px;
    }

    .ccp-product-row {
        flex-direction: column;
        align-items: stretch;
        padding: 0 16px;
        min-height: 0;
    }

    #ccp-product-slot {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .ccp-image-col {
        flex: none;
        width: 100%;
        justify-content: center;
        padding: 16px 0 12px;
    }
    .ccp-image-col img {
        width: 140px;
        height: 140px;
    }

    .ccp-details-col {
        flex: none;
        width: 100%;
        padding: 0 0 12px;
        border-bottom: 1px solid #eee;
    }
    .ccp-details-col h3 {
        font-size: 15px;
        font-weight: 700;
        color: #333;
        -webkit-line-clamp: unset;
    }
    .ccp-levertijd-row,
    .ccp-stock-row {
        font-size: 12px;
    }

    .ccp-price-col {
        flex: none;
        width: 100%;
        justify-content: flex-start;
        padding: 12px 0;
        border-bottom: 1px solid #eee;
    }
    .ccp-price-col .ccp-price {
        font-size: 24px;
    }

    .ccp-buttons-col {
        flex: none;
        width: 100%;
        padding: 13px 0 16px;
        gap: 9px;
    }
    .ccp-btn-bestellen,
    .ccp-btn-winkelen {
        height: 50px;
        font-size: 14px;
        border-radius: 8px;
        white-space: normal;
        text-align: center;
    }

    .ccp-innerblocks {
        padding: 12px 16px 16px;
    }
    .ccp-close-x {
        top: 14px;
        right: 14px;
        font-size: 20px;
    }
}
