/* ═══════════════════════════════════════════════════════════════
   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; }
}
/* ── Milestone Progress Bar ─────────────────────────────────── */
#wcpb-sc-milestone-progress {
  padding: 0 16px 8px;
  flex-shrink: 0 !important;  /* prevent flex collapse in sidecart column */
}

.wcpb-sc-progress-wrap {
  padding: 12px 16px 16px;
  background: linear-gradient(135deg, #fff8f0 0%, #fff3e6 100%) !important;
  border-radius: 16px !important;
  border: 1.5px solid #f0dccb !important;
  margin-bottom: 4px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.04) !important;
}

.wcpb-sc-progress-message {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #2b2b2b !important;
  text-align: center !important;
  margin: 0 0 16px 0 !important;
  line-height: 1.4 !important;
}

.wcpb-sc-progress-saving {
  display: block !important;
  font-style: normal !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #e8832a !important;
  margin-top: 2px !important;
}

.wcpb-sc-progress-track {
  position: relative !important;
  height: 10px !important;
  background: #e8d8ca !important;
  border-radius: 999px !important;
  overflow: visible !important;
  margin: 0 8px !important; /* give milestone dots room to overflow */
}

.wcpb-sc-progress-fill {
  height: 100% !important;
  width: 0 !important;                      /* starts at 0, JS animates to real % */
  background: linear-gradient(90deg, #e8832a 0%, #f5a623 100%) !important;
  border-radius: 999px !important;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important; /* spring */
  box-shadow: 0 0 8px rgba(232,131,42,.4) !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Glowing tip on the fill bar */
.wcpb-sc-progress-fill::after {
  content: '' !important;
  position: absolute !important;
  right: 0 !important;
  top: 50% !important;
  transform: translate(50%, -50%) !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: #e8832a !important;
  border: 3px solid #fff !important;
  box-shadow: 0 0 0 3px rgba(232,131,42,.25) !important;
  transition: opacity 0.3s !important;
  opacity: 1 !important;
}

/* Hide tip when fully complete */
.wcpb-sc-progress-fill[style*="width:100"]::after,
.wcpb-sc-progress-fill[style*="width: 100"]::after {
  opacity: 0 !important;
}

/* ── Milestone dots ──────────────────────────────────────────── */
.wcpb-sc-milestone {
  position: absolute !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 4 !important;
  text-align: center !important;
}

.wcpb-sc-milestone-dot {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  background: #fff !important;
  border: 3px solid #d4b9a5 !important;
  border-radius: 50% !important;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Reached milestone */
.wcpb-sc-milestone-active .wcpb-sc-milestone-dot {
  background: #e8832a !important;
  border-color: #e8832a !important;
  box-shadow: 0 0 0 3px rgba(232,131,42,.2) !important;
  transform: scale(1.15) !important;
}

/* Next milestone to reach — pulsing ring */
.wcpb-sc-milestone-next .wcpb-sc-milestone-dot {
  border-color: #e8832a !important;
  animation: wcpb-milestone-pulse 1.6s ease-in-out infinite !important;
}

@keyframes wcpb-milestone-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,131,42,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(232,131,42,0); }
}

/* ── Labels: odd milestones above bar, even ones below ─────── */
.wcpb-sc-milestone-label {
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: max-content !important;
  max-width: 64px !important;
  white-space: normal !important;
  text-align: center !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #555 !important;
  line-height: 1.3 !important;
  /* default: below the bar */
  top: 20px !important;
}

/* Every other milestone label goes ABOVE the bar */
.wcpb-sc-milestone:nth-child(odd) .wcpb-sc-milestone-label {
  top: auto !important;
  bottom: 20px !important;
}

/* Connector tick line to bar */
.wcpb-sc-milestone-label::before {
  content: '' !important;
  display: block !important;
  width: 1px !important;
  height: 8px !important;
  background: #d4b9a5 !important;
  margin: 0 auto 2px !important;
}

.wcpb-sc-milestone:nth-child(odd) .wcpb-sc-milestone-label::before {
  margin: 2px auto 0 !important;
  order: 2 !important;
}

/* Flip tick direction for above-bar labels */
.wcpb-sc-milestone:nth-child(odd) .wcpb-sc-milestone-label {
  display: flex !important;
  flex-direction: column-reverse !important;
}

.wcpb-sc-milestone-active .wcpb-sc-milestone-label {
  color: #c06815 !important;
}

/* ── Give the track enough vertical room for labels above+below */
.wcpb-sc-progress-track {
  margin-top: 36px !important;
  margin-bottom: 36px !important;
}

/* ── Legacy / duplicate styles cleanup ─────────────────────── */
/* (old .wcpb-milestone, .wcpb-progress, .wcpb-ms rules removed) */
