/* ==========================================================================
   Data Bundle Cards for WooCommerce — bundle-cards.css
   Matches the MTN (yellow/dark), AirtelTigo (blue/red), Telecel (red) designs
   ========================================================================== */

/* ── Reset & Base ────────────────────────────────────────────────────────── */
.dbc-wrapper *,
.dbc-wrapper *::before,
.dbc-wrapper *::after {
    box-sizing: border-box;
}

.dbc-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.dbc-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.dbc-tab {
    padding: 10px 28px;
    border-radius: 999px;
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
    color: #555;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.dbc-tab:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Active tab per network */
.dbc-tab--mtn.dbc-tab--active {
    background: #FFCC00;
    border-color: #FFCC00;
    color: #1a1a2e;
}

.dbc-tab--telecel.dbc-tab--active {
    background: #DC2626;
    border-color: #DC2626;
    color: #ffffff;
}

.dbc-tab--at-ishare.dbc-tab--active {
    background: #2563EB;
    border-color: #2563EB;
    color: #ffffff;
}

.dbc-tab--at-bigtime.dbc-tab--active {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
}

/* ── Panel visibility ────────────────────────────────────────────────────── */
.dbc-panel[hidden] {
    display: none;
}

.dbc-panel {
    display: block;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.dbc-grid {
    display: grid;
    gap: 20px;
}

.dbc-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dbc-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ── Card Shell ──────────────────────────────────────────────────────────── */
.dbc-card {
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}

.dbc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.15);
}

/* ── Card TOP section (coloured background) ──────────────────────────────── */
.dbc-card__top {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* ── Card BOTTOM section (dark / accent strip) ───────────────────────────── */
.dbc-card__bottom {
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Network badge ───────────────────────────────────────────────────────── */
.dbc-card__network-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Data size headline ──────────────────────────────────────────────────── */
.dbc-card__size {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

/* ── Meta row (Price / Rollover / Duration) ──────────────────────────────── */
.dbc-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
}

.dbc-card__meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.dbc-card__meta-item:nth-child(2) {
    align-items: flex-end;
}

.dbc-card__meta-value {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

/* Price specifically — extra bold */
.dbc-card__meta-item:first-child .dbc-card__meta-value {
    font-weight: 900;
}

.dbc-card__meta-label {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.75;
    margin-top: 2px;
}

/* ── Buy Now button ──────────────────────────────────────────────────────── */
.dbc-card__btn {
    display: block;
    text-align: center;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: 0.03em;
    transition: opacity 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    border: none;
}

.dbc-card__btn:hover {
    opacity: 0.88;
    transform: scale(1.02);
}

.dbc-card__btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   MTN THEME  (yellow top · dark bottom)
   ========================================================================== */
.dbc-card--mtn .dbc-card__top {
    background: #FFCC00;
}

.dbc-card--mtn .dbc-card__network-badge {
    background: rgba(255, 255, 255, 0.55);
    color: #1a1a2e;
}

.dbc-card--mtn .dbc-card__size {
    color: #1a1a2e;
}

.dbc-card--mtn .dbc-card__bottom {
    background: #1a1a2e;
}

.dbc-card--mtn .dbc-card__meta-value,
.dbc-card--mtn .dbc-card__meta-label {
    color: #ffffff;
}

.dbc-card--mtn .dbc-card__btn {
    background: #FFCC00;
    color: #1a1a2e;
}

/* ==========================================================================
   AT ISHARE THEME  (blue top · red bottom — same as original AirtelTigo)
   ========================================================================== */
.dbc-card--at-ishare .dbc-card__top { background: #2563EB; }
.dbc-card--at-ishare .dbc-card__network-badge { background: rgba(255,255,255,0.25); color: #ffffff; }
.dbc-card--at-ishare .dbc-card__size { color: #ffffff; }
.dbc-card--at-ishare .dbc-card__bottom { background: #DC2626; }
.dbc-card--at-ishare .dbc-card__meta-value,
.dbc-card--at-ishare .dbc-card__meta-label { color: #ffffff; }
.dbc-card--at-ishare .dbc-card__btn { background: #1D4ED8; color: #ffffff; }

/* ==========================================================================
   AT BIG TIME DATA THEME  (blue top · red bottom — same as original AirtelTigo)
   ========================================================================== */
.dbc-card--at-bigtime .dbc-card__top { background: #2563EB; }
.dbc-card--at-bigtime .dbc-card__network-badge { background: rgba(255,255,255,0.25); color: #ffffff; }
.dbc-card--at-bigtime .dbc-card__size { color: #ffffff; }
.dbc-card--at-bigtime .dbc-card__bottom { background: #DC2626; }
.dbc-card--at-bigtime .dbc-card__meta-value,
.dbc-card--at-bigtime .dbc-card__meta-label { color: #ffffff; }
.dbc-card--at-bigtime .dbc-card__btn { background: #1D4ED8; color: #ffffff; }

/* ==========================================================================
   TELECEL THEME  (dark-red top · slightly-darker-red bottom)
   ========================================================================== */
.dbc-card--telecel .dbc-card__top {
    background: #DC2626;
}

.dbc-card--telecel .dbc-card__network-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.dbc-card--telecel .dbc-card__size {
    color: #ffffff;
}

.dbc-card--telecel .dbc-card__bottom {
    background: #B91C1C;
}

.dbc-card--telecel .dbc-card__meta-value,
.dbc-card--telecel .dbc-card__meta-label {
    color: #ffffff;
}

.dbc-card--telecel .dbc-card__btn {
    background: rgba(255, 255, 255, 0.20);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.50);
}

.dbc-card--telecel .dbc-card__btn:hover {
    background: rgba(255, 255, 255, 0.30);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.dbc-no-products {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 40px 0;
    font-size: 15px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .dbc-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {

    /* Cards — 2 columns on mobile */
    .dbc-cols-3,
    .dbc-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Tabs — 2 per row, equal width, side by side */
    .dbc-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .dbc-tab {
        padding: 10px 6px;
        font-size: 12px;
        font-weight: 700;
        text-align: center;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Card top — tighter padding, smaller size text */
    .dbc-card__top {
        padding: 12px 10px 14px;
        gap: 6px;
    }

    .dbc-card__size {
        font-size: 26px;
    }

    .dbc-card__network-badge {
        font-size: 10px;
        padding: 3px 10px;
    }

    /* Card bottom — tighter padding */
    .dbc-card__bottom {
        padding: 10px 10px 12px;
        gap: 10px;
    }

    .dbc-card__meta {
        flex-direction: column;
        gap: 4px;
    }

    .dbc-card__meta-item {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        width: 100%;
    }

    .dbc-card__meta-value {
        font-size: 12px;
        font-weight: 700;
        white-space: normal;
        word-break: break-word;
    }

    /* Bold price specifically */
    .dbc-card__meta-item:first-child .dbc-card__meta-value {
        font-size: 13px;
        font-weight: 900;
    }

    .dbc-card__meta-label {
        font-size: 10px;
        opacity: 0.7;
    }

    /* Buy Now button — smaller */
    .dbc-card__btn {
        padding: 9px 8px;
        font-size: 12px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .dbc-card,
    .dbc-card__btn,
    .dbc-tab {
        transition: none;
    }
}


/* ==========================================================================
   MODAL
   ========================================================================== */

/* Full screen overlay — hidden until .dbc-is-open added */
.dbc-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.dbc-modal-overlay.dbc-is-open {
    display: flex !important;
}

/* White popup card */
.dbc-modal {
    position: relative;
    background: #fff;
    border-radius: 18px;
    width: calc(100% - 32px);
    max-width: 380px;
    padding: 28px 24px 24px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.22);
}

/* Close button */
.dbc-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    font-size: 16px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    color: #444;
    padding: 0;
    display: block;
}

.dbc-modal__close:hover { background: #e0e0e0; }

/* Heading */
.dbc-modal__heading {
    font-size: 22px;
    font-weight: 800;
    color: #111;
    margin: 0 0 6px;
    padding-right: 36px;
}

.dbc-modal__subheading {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px;
}

/* Package summary card */
.dbc-modal__package {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.dbc-pkg--mtn        { background: linear-gradient(135deg,#FFCC00,#FFB300); }
.dbc-pkg--airteltigo { background: linear-gradient(135deg,#2563EB,#1D4ED8); }
.dbc-pkg--telecel    { background: linear-gradient(135deg,#DC2626,#B91C1C); }

.dbc-modal__pkg-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.dbc-modal__pkg-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.7;
}

.dbc-pkg--mtn .dbc-modal__pkg-label { color: #1a1a2e; }
.dbc-pkg--airteltigo .dbc-modal__pkg-label,
.dbc-pkg--telecel .dbc-modal__pkg-label { color: #fff; }

.dbc-modal__pkg-size {
    font-size: 26px;
    font-weight: 900;
}

.dbc-modal__pkg-price {
    font-size: 22px;
    font-weight: 800;
}

.dbc-pkg--mtn .dbc-modal__pkg-size,
.dbc-pkg--mtn .dbc-modal__pkg-price { color: #1a1a2e; }

.dbc-pkg--airteltigo .dbc-modal__pkg-size,
.dbc-pkg--airteltigo .dbc-modal__pkg-price,
.dbc-pkg--telecel .dbc-modal__pkg-size,
.dbc-pkg--telecel .dbc-modal__pkg-price { color: #fff; }

.dbc-modal__pkg-divider {
    height: 1px;
    margin: 10px 0 8px;
}

.dbc-pkg--mtn .dbc-modal__pkg-divider        { background: rgba(0,0,0,0.12); }
.dbc-pkg--airteltigo .dbc-modal__pkg-divider,
.dbc-pkg--telecel .dbc-modal__pkg-divider    { background: rgba(255,255,255,0.25); }

.dbc-modal__pkg-badge {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dbc-pkg--mtn .dbc-modal__pkg-badge        { color: #1a1a2e; }
.dbc-pkg--airteltigo .dbc-modal__pkg-badge,
.dbc-pkg--telecel .dbc-modal__pkg-badge    { color: #fff; }

/* Phone number field */
.dbc-modal__label {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    display: block;
    margin-bottom: 8px;
}

.dbc-modal__input {
    display: block;
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    color: #111;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

.dbc-modal__input:focus        { border-color: #888; }
.dbc-modal__input.dbc-input--error { border-color: #ef4444; }

.dbc-modal__input-error {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 5px;
    min-height: 14px;
}

/* Proceed button */
.dbc-modal__proceed {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
}

.dbc-modal__proceed:hover   { opacity: 0.88; }
.dbc-modal__proceed.dbc-loading { opacity: 0.6; cursor: not-allowed; }

.dbc-btn--mtn        { background: #FFCC00; color: #1a1a2e; }
.dbc-btn--airteltigo { background: #2563EB; color: #fff; }
.dbc-btn--telecel    { background: #DC2626; color: #fff; }

@media (max-width: 440px) {
    .dbc-modal { padding: 24px 18px 20px; }
}
