/* ═══════════════════════════════════════════════════════════════
   WBC Frontend Styles — Bundle & Campaign Widget
   All colors driven by CSS custom properties (set by PHP inline_css)
   ═══════════════════════════════════════════════════════════════ */

/* ── Variable fallbacks ──────────────────────────────────────── */
:root {
    --wbc-font:           'Poppins', sans-serif;
    --wbc-font-size:      14px;
    --wbc-primary:        #ff6b35;
    --wbc-primary-light:  #fff0eb;
    --wbc-accent:         #a855f7;
    --wbc-success:        #16a34a;
    --wbc-danger:         #dc2626;
    --wbc-bg:             #fdf9f0;
    --wbc-border:         #f0e8d5;
    --wbc-radius:         14px;
    --wbc-radius-badge:   20px;
    --wbc-radius-btn:     8px;
    --wbc-border-sel:     2px;
    --wbc-padding:        22px;
    --wbc-max-width:      540px;
    --wbc-badge-font:     11.5px;
    --wbc-shadow:         0 2px 12px rgba(0,0,0,.08);
    --wbc-transition:     all .22s cubic-bezier(.4,0,.2,1);
}

/* ── Wrapper ─────────────────────────────────────────────────── */
.wbc-wrap {
    font-family: var(--wbc-font);
    font-size: var(--wbc-font-size);
    background: var(--wbc-bg);
    border: 1.5px solid var(--wbc-border);
    border-radius: var(--wbc-radius);
    padding: var(--wbc-padding);
    max-width: var(--wbc-max-width);
    margin: 24px 0;
    box-shadow: var(--wbc-shadow);
    position: relative;
}

/* ── Header ──────────────────────────────────────────────────── */
.wbc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wbc-title {
    font-size: calc(var(--wbc-font-size) + 3px);
    font-weight: 700;
    color: #111827;
    letter-spacing: -.3px;
}

.wbc-scarcity {
    font-size: calc(var(--wbc-font-size) - 1px);
    font-weight: 600;
    color: var(--wbc-danger);
}

/* ── Options list ────────────────────────────────────────────── */
.wbc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Single option ───────────────────────────────────────────── */
.wbc-option {
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e5e5e5;
    border-radius: var(--wbc-radius);
    cursor: pointer;
    transition: var(--wbc-transition);
    overflow: visible;
}

.wbc-option:hover {
    border-color: color-mix(in srgb, var(--wbc-primary) 40%, #e5e5e5);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.wbc-option--selected {
    border-color: var(--wbc-primary) !important;
    border-width: var(--wbc-border-sel) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wbc-primary) 15%, transparent), var(--wbc-shadow);
}

/* ── Badge ───────────────────────────────────────────────────── */
.wbc-badge {
    position: absolute;
    top: -13px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: var(--wbc-radius-badge);
    font-size: var(--wbc-badge-font);
    font-weight: 700;
    color: #fff;
    letter-spacing: .2px;
    white-space: nowrap;
    pointer-events: none;
    font-family: var(--wbc-font);
    line-height: 1.6;
}

/* ── Option inner layout ─────────────────────────────────────── */
.wbc-option-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

/* ── Radio indicator ─────────────────────────────────────────── */
.wbc-radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wbc-transition);
    background: transparent;
}

.wbc-option--selected .wbc-radio,
.wbc-radio--checked {
    background: var(--wbc-primary) !important;
    border-color: var(--wbc-primary) !important;
    color: #fff;
}

/* ── Info text ───────────────────────────────────────────────── */
.wbc-option-info { flex: 1; min-width: 0; }

.wbc-option-label {
    display: block;
    font-size: calc(var(--wbc-font-size) + 0.5px);
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.wbc-option-meta {
    display: block;
    font-size: calc(var(--wbc-font-size) - 1.5px);
    font-weight: 400;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Prices ──────────────────────────────────────────────────── */
.wbc-option-price { text-align: right; flex-shrink: 0; }

.wbc-price-sale {
    display: block;
    font-size: calc(var(--wbc-font-size) + 4px);
    font-weight: 700;
    color: var(--wbc-primary);
    line-height: 1.2;
}

.wbc-price-original {
    display: block;
    font-size: calc(var(--wbc-font-size) - 1.5px);
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
}

/* ── Gift picker (bogo_list) ─────────────────────────────────── */
.wbc-gift-picker {
    padding: 12px 16px 14px;
    border-top: 1px solid #f3f4f6;
}

.wbc-gift-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--wbc-success);
    margin: 0 0 10px;
}

.wbc-gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.wbc-gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--wbc-transition);
    font-family: var(--wbc-font);
    text-align: center;
}

.wbc-gift-item:has(.wbc-gift-check:checked) {
    border-color: var(--wbc-success);
    background: #f0fdf4;
}

.wbc-gift-check { display: none; }
.wbc-gift-img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.wbc-gift-name { font-size: 11px; font-weight: 500; color: #374151; line-height: 1.3; }
.wbc-gift-price { font-size: 11px; font-weight: 700; color: var(--wbc-success); }

/* ── Upsell bar ──────────────────────────────────────────────── */
.wbc-upsell {
    margin-top: 12px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: calc(var(--wbc-radius) - 4px);
    padding: 10px 14px;
    font-size: calc(var(--wbc-font-size) - 1px);
    font-weight: 600;
    color: var(--wbc-success);
    transition: var(--wbc-transition);
}

.wbc-upsell.wbc-hidden { display: none !important; }

/* ── CTA Buttons ─────────────────────────────────────────────── */
.wbc-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.wbc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 18px;
    border: none;
    border-radius: var(--wbc-radius-btn);
    font-family: var(--wbc-font);
    font-size: var(--wbc-font-size);
    font-weight: 700;
    cursor: pointer;
    transition: var(--wbc-transition);
    outline: none;
    letter-spacing: .1px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.wbc-btn:active { transform: scale(.97); }
.wbc-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.wbc-btn--cart {
    background: #fff;
    color: var(--wbc-primary);
    border: 2px solid var(--wbc-primary);
}

.wbc-btn--cart:hover { background: var(--wbc-primary-light); }

.wbc-btn--checkout {
    background: var(--wbc-primary);
    color: #fff;
    border: 2px solid var(--wbc-primary);
}

.wbc-btn--checkout:hover {
    filter: brightness(.9);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--wbc-primary) 35%, transparent);
}

/* ── Message bar ─────────────────────────────────────────────── */
.wbc-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: calc(var(--wbc-radius) - 4px);
    font-size: calc(var(--wbc-font-size) - 1px);
    font-weight: 500;
}

.wbc-message--success {
    background: #f0fdf4;
    color: var(--wbc-success);
    border: 1px solid #bbf7d0;
}

.wbc-message--error {
    background: #fef2f2;
    color: var(--wbc-danger);
    border: 1px solid #fecaca;
}

/* ── Ripple ──────────────────────────────────────────────────── */
@keyframes wbc-ripple {
    from { transform: scale(0); opacity: .4; }
    to   { transform: scale(4); opacity: 0; }
}

.wbc-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    width: 40px;
    height: 40px;
    pointer-events: none;
    transform: scale(0);
    animation: wbc-ripple .55s linear;
}

/* ── No campaign notice ──────────────────────────────────────── */
.wbc-no-campaign {
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .wbc-wrap { padding: 16px 14px; }
    .wbc-actions { flex-direction: column; }
    .wbc-price-sale { font-size: 16px; }
    .wbc-option-label { font-size: 13px; }
    .wbc-gift-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
}
