/* ═══════════════════════════════════════════════════
   JetWoo Bump Offers — Frontend Styles
   ═══════════════════════════════════════════════════ */

/* ── Base ───────────────────────────────────────── */
.jwb-offer {
    position: relative;
    margin: 20px 0;
    font-family: inherit;
    transition: box-shadow .3s, transform .2s;
    overflow: hidden;
}
.jwb-offer * { box-sizing: border-box; }

/* ── Loading overlay ────────────────────────────── */
.jwb-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.75);
    z-index: 10;
    align-items: center;
    justify-content: center;
}
.jwb-offer.jwb-busy .jwb-loading { display: flex; }

.jwb-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--jwb-hl, #ff6b35);
    border-top-color: transparent;
    border-radius: 50%;
    animation: jwb-spin .6s linear infinite;
}
@keyframes jwb-spin { to { transform: rotate(360deg); } }

/* ═════════════════════════════════════════════════
   STYLE 1 — Classic Box  (CartFlows look)
   ═════════════════════════════════════════════════ */
.jwb-style1 {
    border: 2px dashed var(--jwb-hl);
    border-radius: 4px;
    background: var(--jwb-bg);
    color: var(--jwb-text);
}

/* Arrow pointer */
.jwb-style1 .jwb-arrow {
    width: 0; height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 14px solid var(--jwb-hl);
    margin: -2px auto 0;
    position: relative;
    top: -14px;
    margin-bottom: -14px;
}

.jwb-style1 .jwb-header {
    background: var(--jwb-title-bg);
    color: var(--jwb-title-text);
    padding: 10px 16px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    letter-spacing: .3px;
}

.jwb-style1 .jwb-body {
    display: flex;
    gap: 16px;
    padding: 16px;
    align-items: flex-start;
}
.jwb-style1.jwb-img-top .jwb-body  { flex-direction: column; }
.jwb-style1.jwb-img-right .jwb-body { flex-direction: row-reverse; }

/* ═════════════════════════════════════════════════
   STYLE 2 — Modern Card
   ═════════════════════════════════════════════════ */
.jwb-style2 {
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--jwb-hl);
    border-radius: 8px;
    background: var(--jwb-bg);
    color: var(--jwb-text);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.jwb-style2 .jwb-header {
    background: var(--jwb-title-bg);
    color: var(--jwb-title-text);
    padding: 10px 18px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 4px 8px 0 0;
}

.jwb-style2 .jwb-body {
    display: flex;
    gap: 18px;
    padding: 18px;
    align-items: center;
}
.jwb-style2.jwb-img-top .jwb-body  { flex-direction: column; }
.jwb-style2.jwb-img-right .jwb-body { flex-direction: row-reverse; }

.jwb-style2:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
}

/* ═════════════════════════════════════════════════
   STYLE 3 — Minimal
   ═════════════════════════════════════════════════ */
.jwb-style3 {
    border-top: 2px solid var(--jwb-hl);
    border-bottom: 2px solid var(--jwb-hl);
    padding: 14px 0;
    background: transparent;
    color: var(--jwb-text);
}

.jwb-style3 .jwb-body {
    display: flex;
    gap: 14px;
    align-items: center;
}
.jwb-style3.jwb-img-top .jwb-body  { flex-direction: column; align-items: flex-start; }
.jwb-style3.jwb-img-right .jwb-body { flex-direction: row-reverse; }

.jwb-style3 .jwb-mini-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--jwb-hl);
    display: block;
    margin-bottom: 4px;
}

/* ═════════════════════════════════════════════════
   SHARED ELEMENTS
   ═════════════════════════════════════════════════ */

/* Image */
.jwb-image-wrap {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    background: #fff;
}
.jwb-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content */
.jwb-content { flex: 1; min-width: 0; }

/* Custom checkbox */
.jwb-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.jwb-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.jwb-tick {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid var(--jwb-hl);
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s, transform .15s;
    background: #fff;
}
.jwb-tick::after {
    content: '';
    display: block;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s;
    margin-top: -2px;
}
.jwb-checkbox:checked ~ .jwb-tick {
    background: var(--jwb-hl);
    border-color: var(--jwb-hl);
    transform: scale(1.1);
}
.jwb-checkbox:checked ~ .jwb-tick::after {
    transform: rotate(45deg) scale(1);
}

.jwb-label-text {
    user-select: none;
}

/* Description */
.jwb-desc {
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 8px;
    opacity: .88;
}

/* Pricing */
.jwb-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
}
.jwb-old-price {
    color: #999;
    font-size: 13px;
}
.jwb-new-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--jwb-hl);
}
.jwb-save-badge {
    background: var(--jwb-hl);
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ── Selected state ─────────────────────────────── */
.jwb-selected.jwb-style1 {
    border-style: solid;
    box-shadow: 0 0 0 1px var(--jwb-hl);
}
.jwb-selected.jwb-style2 {
    border-color: var(--jwb-hl);
    box-shadow: 0 0 0 1px var(--jwb-hl), 0 4px 16px rgba(0,0,0,.08);
}
.jwb-selected.jwb-style3 {
    background: var(--jwb-bg);
    padding: 14px;
    border-radius: 4px;
    border: 2px solid var(--jwb-hl);
}

/* ── Pulse animation on check ───────────────────── */
@keyframes jwb-pulse {
    0%   { box-shadow: 0 0 0 0 var(--jwb-hl); }
    70%  { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.jwb-offer.jwb-just-checked {
    animation: jwb-pulse .5s ease-out;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
    .jwb-style1 .jwb-body,
    .jwb-style2 .jwb-body,
    .jwb-style3 .jwb-body {
        flex-direction: column !important;
        align-items: flex-start;
    }
    .jwb-image-wrap {
        width: 64px;
        height: 64px;
    }
    .jwb-label {
        font-size: 14px;
    }
    .jwb-header {
        font-size: 13px !important;
    }
}

/* ── Inside WC table ────────────────────────────── */
tr.jwb-table-row td {
    padding: 0 !important;
    border: none !important;
}