/* ═══════════════════════════════════════════════════════════════
   WCPB Side Cart  —  v3.7.0
   ═══════════════════════════════════════════════════════════════ */

/* ── Sticky Mini-Bar — HIDDEN ────────────────────────────────── */
.wcpb-mini-bar {
    display: none !important;
}

/* ── Bundle Tier Picker (inline dropdown) ────────────────────── */
.wcpb-bundle-picker {
    margin-top: 10px !important;
    background: #f9fbfd !important;
    border: 1px solid #c5ddef !important;
    border-radius: 8px !important;
    padding: 10px !important;
    animation: wcpb-fadein .15s ease !important;
}
@keyframes wcpb-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wcpb-bundle-picker-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #888 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    margin-bottom: 8px !important;
}
.wcpb-picker-option {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    background: #fff !important;
    border: 1px solid #c5ddef !important;
    border-radius: 6px !important;
    padding: 7px 10px !important;
    margin-bottom: 5px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #3a6ea8 !important;
    cursor: pointer !important;
    transition: background .15s, border-color .15s !important;
}
.wcpb-picker-option:last-child { margin-bottom: 0 !important; }
.wcpb-picker-option:hover {
    background: #edf4fb !important;
    border-color: #5792C2 !important;
}
.wcpb-picker-option em {
    font-style: normal !important;
    color: #e67e22 !important;
    font-weight: 700 !important;
    margin-left: 6px !important;
}
.wcpb-rtl-page .wcpb-picker-option { text-align: right !important; }
.wcpb-rtl-page .wcpb-picker-option em { margin-left: 0 !important; margin-right: 6px !important; }

/* ── One-click Upgrade Button (in upgrade bar) ───────────────── */
.wcpb-upgrade-btn {
    display: block !important;
    width: 100% !important;
    margin-top: 10px !important;
    padding: 8px !important;
    background: #5792C2 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background .15s !important;
    letter-spacing: .01em !important;
}
.wcpb-upgrade-btn:hover { background: #3a6ea8 !important; }
.wcpb-upgrade-btn:disabled { opacity: .6 !important; cursor: default !important; }

/* ── Switch Bundle Button ─────────────────────────────────────── */
.wcpb-sc-item-switch {
    display: inline-block !important;
    margin-top: 8px !important;
    background: none !important;
    border: 1px solid #5792C2 !important;
    color: #5792C2 !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background .15s, color .15s !important;
    letter-spacing: .01em !important;
}
.wcpb-sc-item-switch:hover {
    background: #5792C2 !important;
    color: #fff !important;
}

/* ── Cart trigger clears mini-bar height on mobile ───────────── */
@media (max-width: 480px) {
    .wcpb-mini-bar-label { font-size: 12px !important; }
    .wcpb-mini-bar-btn { padding: 7px 12px !important; font-size: 12px !important; }
}

/* ── Cart Icon Button — always bottom LEFT ───────────────────── */
.wcpb-cart-trigger {
    position: fixed !important;
    bottom: 28px !important;
    left: 28px !important;
    right: auto !important;
    z-index: 99990 !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    background: #3a6ea8 !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform .2s, background .2s !important;
    padding: 0 !important;
}
.wcpb-cart-trigger:hover {
    background: #5792C2 !important;
    transform: scale(1.08) !important;
}
/* RTL page: still bottom-left */
.wcpb-rtl-page .wcpb-cart-trigger {
    left: 28px !important;
    right: auto !important;
}
.wcpb-cart-trigger svg {
    width: 26px !important;
    height: 26px !important;
    fill: none !important;
    stroke: #fff !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}
.wcpb-cart-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    min-width: 20px !important;
    height: 20px !important;
    border-radius: 10px !important;
    background: #e74c3c !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    border: 2px solid #fff !important;
    line-height: 1 !important;
    display: none !important;
}
.wcpb-cart-badge.visible { display: flex !important; }

/* ── Overlay ─────────────────────────────────────────────────── */
.wcpb-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.5) !important;
    z-index: 99991 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .3s !important;
}
.wcpb-overlay.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* ── Side Drawer — always on LEFT ────────────────────────────── */
.wcpb-sidecart {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 380px !important;
    max-width: 100vw !important;
    height: 100% !important;
    background: #fff !important;
    z-index: 99992 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(-100%) !important;
    transition: transform .32s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: 6px 0 40px rgba(0,0,0,.18) !important;
    font-family: inherit !important;
}
.wcpb-sidecart.open {
    transform: translateX(0) !important;
}
/* RTL page: still on left, text aligned right */
.wcpb-rtl-page .wcpb-sidecart {
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    box-shadow: 6px 0 40px rgba(0,0,0,.18) !important;
}
.wcpb-rtl-page .wcpb-sidecart.open {
    transform: translateX(0) !important;
}

/* ── Header ──────────────────────────────────────────────────── */
.wcpb-sc-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 18px 20px !important;
    border-bottom: 1px solid #eee !important;
    background: #3a6ea8 !important;
    color: #fff !important;
    flex-shrink: 0 !important;
}
.wcpb-sc-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #fff !important;
}
.wcpb-sc-close {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #fff !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    opacity: .8 !important;
    transition: opacity .15s !important;
    font-size: 22px !important;
    line-height: 1 !important;
}
.wcpb-sc-close:hover { opacity: 1 !important; }

/* ── Upgrade Bar ─────────────────────────────────────────────── */
.wcpb-upgrade-bar {
    background: #edf4fb !important;
    border-bottom: 1px solid #c5ddef !important;
    padding: 12px 16px !important;
    flex-shrink: 0 !important;
}
.wcpb-upgrade-msg {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #3a6ea8 !important;
    margin-bottom: 8px !important;
    text-align: center !important;
}
.wcpb-upgrade-msg span {
    color: #e67e22 !important;
}
.wcpb-upgrade-track {
    position: relative !important;
    height: 8px !important;
    background: #c5ddef !important;
    border-radius: 4px !important;
    overflow: visible !important;
    margin-bottom: 6px !important;
}
.wcpb-upgrade-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #5792C2, #7aaed4) !important;
    border-radius: 4px !important;
    transition: width .4s ease !important;
    max-width: 100% !important;
}
.wcpb-upgrade-labels {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 10px !important;
    color: #888 !important;
    font-weight: 600 !important;
}
.wcpb-upgrade-bar.at-max .wcpb-upgrade-msg {
    color: #27ae60 !important;
}
.wcpb-upgrade-bar.at-max .wcpb-upgrade-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71) !important;
}

/* ── Body (scrollable items) ─────────────────────────────────── */
.wcpb-sc-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 0 !important;
}

/* Empty state */
.wcpb-sc-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    min-height: 200px !important;
    color: #aaa !important;
    font-size: 14px !important;
    gap: 10px !important;
    padding: 40px 20px !important;
    text-align: center !important;
}
.wcpb-sc-empty svg {
    width: 48px !important;
    height: 48px !important;
    stroke: #ccc !important;
    fill: none !important;
    stroke-width: 1.5 !important;
}

/* ── Cart Item Card ──────────────────────────────────────────── */
.wcpb-sc-item {
    padding: 14px 16px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    display: flex !important;
    gap: 12px !important;
    align-items: flex-start !important;
}
.wcpb-sc-item-img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    background: #f5f5f5 !important;
}
.wcpb-sc-item-body {
    flex: 1 !important;
    min-width: 0 !important;
}
.wcpb-sc-item-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 0 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.wcpb-sc-bundle-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #3a6ea8 !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 20px !important;
    margin-bottom: 6px !important;
}
.wcpb-sc-colors {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 4px !important;
}
.wcpb-sc-color-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 11px !important;
    color: #555 !important;
    background: #f7f7f7 !important;
    padding: 2px 7px !important;
    border-radius: 12px !important;
    border: 1px solid #e8e8e8 !important;
}
.wcpb-sc-color-dot {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    flex-shrink: 0 !important;
}
.wcpb-sc-item-price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #3a6ea8 !important;
    margin-top: 6px !important;
}
.wcpb-sc-item-remove {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #ccc !important;
    padding: 4px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    transition: color .15s !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
}
.wcpb-sc-item-remove:hover { color: #e74c3c !important; }

/* ── Footer ──────────────────────────────────────────────────── */
.wcpb-sc-footer {
    border-top: 1px solid #eee !important;
    padding: 16px !important;
    flex-shrink: 0 !important;
    background: #fff !important;
}
.wcpb-sc-subtotal {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}
.wcpb-sc-subtotal-amount { color: #3a6ea8 !important; }
.wcpb-sc-checkout-btn {
    display: block !important;
    width: 100% !important;
    padding: 14px !important;
    background: #3a6ea8 !important;
    color: #fff !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: background .2s !important;
    letter-spacing: .02em !important;
}
.wcpb-sc-checkout-btn:hover {
    background: #5792C2 !important;
    color: #fff !important;
    text-decoration: none !important;
}
.wcpb-sc-continue {
    display: block !important;
    text-align: center !important;
    margin-top: 10px !important;
    font-size: 12px !important;
    color: #888 !important;
    text-decoration: none !important;
    transition: color .15s !important;
}
.wcpb-sc-continue:hover { color: #3a6ea8 !important; }

/* ── RTL text alignment ──────────────────────────────────────── */
.wcpb-rtl-page .wcpb-sidecart { text-align: right !important; direction: rtl !important; }
.wcpb-rtl-page .wcpb-sc-header { flex-direction: row-reverse !important; }
.wcpb-rtl-page .wcpb-sc-item { flex-direction: row-reverse !important; }
.wcpb-rtl-page .wcpb-sc-subtotal { flex-direction: row-reverse !important; }
.wcpb-rtl-page .wcpb-sc-bundle-label { flex-direction: row-reverse !important; }
.wcpb-rtl-page .wcpb-upgrade-bar { direction: rtl !important; text-align: right !important; }

/* ── Tajawal font for Arabic ─────────────────────────────────── */
.wcpb-rtl-page .wcpb-sidecart,
.wcpb-rtl-page .wcpb-cart-trigger,
.wcpb-rtl-page .wcpb-upgrade-bar,
.wcpb-rtl-page .wcpb-mini-bar {
    font-family: 'Tajawal', sans-serif !important;
}

/* ── Poppins font for English ────────────────────────────────── */
body:not(.wcpb-rtl-page) .wcpb-sidecart,
body:not(.wcpb-rtl-page) .wcpb-cart-trigger,
body:not(.wcpb-rtl-page) .wcpb-upgrade-bar {
    font-family: 'Poppins', sans-serif !important;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .wcpb-sidecart { width: 100vw !important; }
    .wcpb-cart-trigger { bottom: 20px !important; left: 16px !important; right: auto !important; }
    .wcpb-rtl-page .wcpb-cart-trigger { left: 16px !important; right: auto !important; }
}
