/*
 * DSB Kortingsblokken Widget – Stijlen v2
 * Visuele redesign: witte kaarten, paarse accenten, groene checkmarks,
 * prijskolommen, besparingssectie, USP's met tooltips.
 */

/* ─── Wrapper ────────────────────────────────────────────── */
.dsb-kb {
    width: 100%;
    font-family: var(--e-global-typography-primary-font-family, inherit);
}

/* ─── Koptekst ───────────────────────────────────────────── */
.dsb-kb__header-text {
    text-align: center;
    margin-bottom: 36px;
}

.dsb-kb__heading {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.25;
}

.dsb-kb__subheading {
    font-size: 15px;
    color: #777;
    margin: 0;
}

/* ─── Grid ───────────────────────────────────────────────── */
.dsb-kb__grid {
    display: grid;
    column-gap: 24px;
    row-gap: 0 !important; /* Voorkomt dat Elementor gap: 24px de subgrid-rijen uit elkaar trekt */
    align-items: stretch;
    /* 8 gedeelde rijen: badge-zone, header, pricing, extra-btn, extras, savings, usps, footer.
     * Subgrid zorgt dat elke sectie over alle kaarten op dezelfde hoogte begint. */
    grid-template-rows: auto auto auto auto auto auto auto auto;
}

.dsb-kb--cols-1 .dsb-kb__grid { grid-template-columns: minmax(0, 480px); justify-content: center; }
.dsb-kb--cols-2 .dsb-kb__grid { grid-template-columns: repeat(2, 1fr); }
.dsb-kb--cols-3 .dsb-kb__grid { grid-template-columns: repeat(3, 1fr); }

/* ─── Blok (kaart) ───────────────────────────────────────── */
.dsb-kb-block {
    position: relative;
    display: grid;
    grid-row: span 8;
    grid-template-rows: subgrid;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: visible;
    transition: box-shadow 0.2s ease;
}

.dsb-kb-block:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ─── Badge-zone (rij 1 – altijd aanwezig, klopt in op 0 zonder inhoud) ─ */
.dsb-kb-block__badge-zone {
    grid-row: 1;
}

/* ─── Badge ──────────────────────────────────────── */
.dsb-kb-block__badge {
    display: inline-block;
    margin: 12px 0 0 12px;
    background-color: #7B2D8E;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ─── Header (titel + ondertitel) ────────────────────────── */
.dsb-kb-block__header {
    grid-row: 2;
    padding: 16px 24px 0;
    text-align: center;
}

.dsb-kb-block__title {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.25;
}

.dsb-kb-block__subtitle {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* ─── Prijskolommen ──────────────────────────────────────── */
.dsb-kb-block__pricing {
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 16px;
}

.dsb-kb-block__pricing--two-col {
    flex-direction: row;
    gap: 16px;
}

.dsb-kb-block__pricing--two-col .dsb-kb-block__pricing-col {
    flex: 1;
    min-width: 0;
}

.dsb-kb-block__pricing--two-col .dsb-kb-block__pricing-content {
    font-size: 12px;
    line-height: 1.6;
}

.dsb-kb-block__pricing-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.dsb-kb-block__pricing-content {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.7;
}

.dsb-kb-block__pricing-row {
    display: block;
}

.dsb-kb-block__pricing-content p {
    margin: 0 0 2px;
}

/* ─── Extra knoppen ("alle pakketten", "Alle extras") ──── */
.dsb-kb-block__extra-btn-wrap {
    grid-row: 4;
    padding: 0 24px;
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.dsb-kb-block__extra-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #7B2D8E;
    background: transparent;
    border: 1.5px solid #7B2D8E;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.dsb-kb-block__extra-btn:hover {
    background-color: #7B2D8E;
    color: #ffffff !important;
    text-decoration: none;
}

/* ─── Extras sectie ──────────────────────────────────────── */
.dsb-kb-block__extras {
    grid-row: 5;
    padding: 16px 24px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 12px;
}

.dsb-kb-block__extras-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.dsb-kb-block__extras-content {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
}

.dsb-kb-block__extras-content p {
    margin: 0 0 2px;
}

/* ─── Provider extra's: lijst links, knop rechts ─────────── */
.dsb-kb-block__extras--provider {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
}

.dsb-kb-block__extras--provider .dsb-kb-block__extras-title {
    flex: 0 0 100%;
}

.dsb-kb-block__provider-extras-list {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: 8px;
    row-gap: 4px;
    align-items: baseline;
    margin-bottom: 0;
}

.dsb-kb-block__provider-extra-row {
    display: contents; /* spans worden directe grid-kinderen → prijzen in één kolom */
}

.dsb-kb-block__provider-extra-naam {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.dsb-kb-block__provider-extra-prijs {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    line-height: 1.5;
}

/* Knop naast de lijst (niet eronder) */
.dsb-kb-block__extras--provider .dsb-kb-block__extra-btn-wrap {
    flex: 0 0 auto;
    grid-row: unset;
    padding: 0;
    margin-top: 0;
    align-self: center;
}

/* ─── Besparing ──────────────────────────────────────────── */
.dsb-kb-block__savings {
    grid-row: 6;
    text-align: center;
    padding: 20px 24px 4px;
    border-top: 1px solid #f0f0f0;
    margin-top: 12px;
}

.dsb-kb-block__savings-intro {
    font-size: 13px;
    color: #666;
    margin: 0 0 4px;
    line-height: 1.4;
}

.dsb-kb-block__savings-amount {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    color: #4A154B;
    margin: 0 0 2px;
    line-height: 1.15;
}

.dsb-kb-block__savings-period {
    font-size: 0.4em;
    font-weight: 500;
    color: #888;
    vertical-align: middle;
    margin-left: 2px;
}

.dsb-kb-block__savings-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ─── USP's ──────────────────────────────────────────────── */
.dsb-kb-block__usps {
    grid-row: 7;
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dsb-kb-block__usp {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dsb-kb-block__usp-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dsb-kb-block__usp-check svg {
    display: block;
    width: 22px;
    height: 22px;
}

.dsb-kb-block__usp-text {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

/* Info (i) icoon */
.dsb-kb-block__usp-info-btn {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    line-height: 1;
}

.dsb-kb-block__usp-info-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Tooltip */
.dsb-kb-block__usp-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: -8px;
    width: 220px;
    padding: 10px 14px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 100;
    text-align: left;
    pointer-events: none;
}

.dsb-kb-block__usp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 14px;
    border: 6px solid transparent;
    border-top-color: #333;
}

.dsb-kb-block__usp-info-btn:hover .dsb-kb-block__usp-tooltip {
    display: block;
}

/* ─── Footer (CTA knop) ─────────────────────────────────── */
.dsb-kb-block__footer {
    grid-row: 8;
    padding: 20px 24px 24px;
    align-self: end;
}

.dsb-kb-block__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    background-color: #4A154B;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.dsb-kb-block__btn:hover,
.dsb-kb-block__btn:focus-visible {
    background-color: #6B2A6C;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.dsb-kb-block__btn-arrow {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* ─── Editor lege toestand ───────────────────────────────── */
.dsb-kb__empty-notice {
    padding: 24px;
    text-align: center;
    background: #fff8e1;
    border: 2px dashed #f39c12;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .dsb-kb--cols-2 .dsb-kb__grid,
    .dsb-kb--cols-3 .dsb-kb__grid {
        grid-template-columns: 1fr;
    }

    .dsb-kb-block__pricing--two-col {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .dsb-kb-block__header {
        padding: 20px 16px 0;
    }

    .dsb-kb-block__badge ~ .dsb-kb-block__header {
        padding-top: 48px;
    }

    .dsb-kb-block__pricing,
    .dsb-kb-block__extras,
    .dsb-kb-block__savings,
    .dsb-kb-block__usps,
    .dsb-kb-block__footer,
    .dsb-kb-block__extra-btn-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }
}
