/* ================================================================
   WC Bonus Products — Frontend Styles
   Layout horizontal (referência: Woodmart)
   ================================================================ */

:root {
    --wcbp-primary: #6c2bd9;
    --wcbp-primary-light: #f3eefe;
    --wcbp-primary-dark: #5521b5;
    --wcbp-success: #16a34a;
    --wcbp-success-bg: #f0fdf4;
    --wcbp-danger: #ef4444;
    --wcbp-text: #1e293b;
    --wcbp-muted: #64748b;
    --wcbp-border: #e2e8f0;
    --wcbp-radius: 12px;
    --wcbp-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    --wcbp-shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
}

/* ── Container ───────────────────────────────────── */
.wcbp-section {
    margin: 24px 0;
    transition: opacity .5s ease;
}

.wcbp-section.wcbp-fade-out {
    opacity: 0 !important;
    pointer-events: none;
}

.wcbp-wrapper {
    border: 1px solid var(--wcbp-border);
    border-radius: var(--wcbp-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--wcbp-shadow);
}

/* ── Header ──────────────────────────────────────── */
.wcbp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--wcbp-border);
}

.wcbp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcbp-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--wcbp-primary);
    flex-shrink: 0;
}

.wcbp-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--wcbp-text);
}

/* ── Timer ────────────────────────────────────────── */
.wcbp-timer-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--wcbp-primary-light);
    padding: 8px 14px;
    border-radius: 8px;
}

.wcbp-timer-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wcbp-danger);
    animation: wcbp-pulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes wcbp-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: .5;
    }
}

.wcbp-timer-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--wcbp-primary);
    font-weight: 600;
}

.wcbp-timer-digits {
    display: flex;
    align-items: center;
    gap: 2px;
}

.wcbp-digit {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    min-width: 26px;
    text-align: center;
    background: var(--wcbp-primary);
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1.3;
}

.wcbp-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--wcbp-primary);
    animation: wcbp-blink 1s step-start infinite;
}

@keyframes wcbp-blink {
    50% {
        opacity: 0;
    }
}

.wcbp-timer-wrap.wcbp-urgent {
    background: #fef2f2;
}

.wcbp-timer-wrap.wcbp-urgent .wcbp-timer-label {
    color: var(--wcbp-danger);
}

.wcbp-timer-wrap.wcbp-urgent .wcbp-digit {
    background: var(--wcbp-danger);
}

.wcbp-timer-wrap.wcbp-urgent .wcbp-sep {
    color: var(--wcbp-danger);
}

/* ── Subtítulo Bar ────────────────────────────────── */
.wcbp-subtitle-bar {
    padding: 10px 20px;
    background: var(--wcbp-primary-light);
}

.wcbp-subtitle {
    margin: 0;
    font-size: 14px;
    font-style: italic;
    color: var(--wcbp-primary);
    font-weight: 500;
}

.wcbp-subtitle strong {
    font-weight: 800;
    color: var(--wcbp-primary-dark);
}

/* ── Lista de Bônus (horizontal rows) ─────────────── */
.wcbp-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Card Horizontal ──────────────────────────────── */
.wcbp-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--wcbp-border);
    background: #fff;
    transition: background .2s ease, border-color .2s ease;
}

.wcbp-card:last-child {
    border-bottom: none;
}

.wcbp-card:hover {
    background: #fafbfe;
}

.wcbp-card.wcbp-card-checked {
    background: var(--wcbp-primary-light);
    border-color: #e0d5f5;
}

/* ── Badge "1º GRÁTIS" ────────────────────────────── */
.wcbp-badge-free-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--wcbp-success);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    line-height: 1.3;
}

/* ── Card Image ───────────────────────────────────── */
.wcbp-card-img {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.wcbp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcbp-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #f1f5f9;
}

/* ── Card Body ────────────────────────────────────── */
.wcbp-card-body {
    flex: 1;
    min-width: 0;
}

.wcbp-card-title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: var(--wcbp-primary-dark);
    line-height: 1.3;
}

.wcbp-card-desc {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--wcbp-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Price Badge ──────────────────────────────────── */
.wcbp-price-badge {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--wcbp-text);
    transition: all .25s ease;
}

.wcbp-price-badge.wcbp-badge-free {
    color: var(--wcbp-success);
    font-weight: 800;
}

.wcbp-price-badge.wcbp-badge-paid {
    color: var(--wcbp-primary);
}

/* ── Card Action (checkbox) ───────────────────────── */
.wcbp-card-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ── Checkbox / Toggle ────────────────────────────── */
.wcbp-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.wcbp-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wcbp-toggle-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    color: transparent;
    background: #fff;
    transition: all .2s ease;
    flex-shrink: 0;
}

.wcbp-toggle input:checked+.wcbp-toggle-check {
    background: var(--wcbp-primary);
    border-color: var(--wcbp-primary);
    color: #fff;
}

.wcbp-toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--wcbp-muted);
    transition: color .2s ease;
    white-space: nowrap;
}

.wcbp-toggle input:checked~.wcbp-toggle-text {
    color: var(--wcbp-primary);
}

/* ── Summary Bar ──────────────────────────────────── */
.wcbp-summary {
    padding: 14px 20px;
    background: var(--wcbp-primary-light);
    border-top: 1px solid #e0d5f5;
    font-size: 14px;
    font-weight: 600;
    color: var(--wcbp-primary-dark);
    text-align: center;
    transition: all .3s ease;
}

.wcbp-summary-icon {
    margin-right: 6px;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
    .wcbp-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .wcbp-header-left {
        flex-direction: column;
        align-items: center;
    }

    .wcbp-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }

    .wcbp-card-img {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .wcbp-card-body {
        flex-basis: calc(100% - 76px);
    }

    .wcbp-card-action {
        width: 100%;
        justify-content: flex-end;
    }

    .wcbp-card-desc {
        white-space: normal;
    }
}