/* ==========================================================================
   XC Free Shipping Progress Bar + Side Cart
   Public Stylesheet – XaniaCode © 2024
   https://xaniacode.com
   ========================================================================== */

/* === RESET & BASE ========================================================= */
.xc-pb-wrapper *,
.xc-sc-drawer *,
.xc-sc-float-btn * {
    box-sizing: border-box;
    margin: 0; padding: 0;
}

/* Font */
.xc-pb-wrapper,
.xc-sc-drawer,
.xc-sc-float-btn {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */

.xc-pb-wrapper {
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    transition: transform .3s ease, opacity .3s ease;
    z-index: 99990;
}

/* Sticky top bar */
.xc-pb-sticky {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 99991;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    animation: xcPbSlideDown .35s cubic-bezier(.22,.68,0,1.2) both;
}

/* Admin bar offset */
body.admin-bar .xc-pb-sticky { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .xc-pb-sticky { top: 46px; }
}

/* Inner layout */
.xc-pb-inner { max-width: 900px; margin: 0 auto; }

/* Message */
.xc-pb-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--xc-pb-text, #333);
    margin-bottom: 8px;
    line-height: 1.4;
}
.xc-pb-icon { font-size: 1.1em; flex-shrink: 0; }
.xc-pb-text { flex: 1; }
.xc-pb-text strong { color: var(--xc-pb-color-start, #ff6b35); }

/* Track */
.xc-pb-track {
    width: 100%;
    height: var(--xc-pb-height, 8px);
    background: var(--xc-pb-track, #e8e8e8);
    border-radius: var(--xc-pb-radius, 50px);
    overflow: hidden;
    position: relative;
}

/* Fill */
.xc-pb-fill {
    height: 100%;
    background: var(--xc-pb-bar, linear-gradient(90deg,#ff6b35,#f7931e));
    border-radius: var(--xc-pb-radius, 50px);
    transition: width .8s cubic-bezier(.22,.68,0,1.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    overflow: hidden;
}

.xc-pb-fill-label {
    position: absolute;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
    pointer-events: none;
}

/* Striped style */
.xc-pb-style-striped .xc-pb-fill,
.xc-pb-style-animated_stripes .xc-pb-fill {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,.15) 0,
        rgba(255,255,255,.15) 12px,
        transparent 12px,
        transparent 24px
    ), var(--xc-pb-bar);
    background-size: auto, auto;
}

/* Animated stripes */
.xc-pb-stripes::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,.2) 0,
        rgba(255,255,255,.2) 10px,
        transparent 10px,
        transparent 20px
    );
    animation: xcPbStripes 1.2s linear infinite;
}
@keyframes xcPbStripes {
    from { background-position: 0 0; }
    to   { background-position: 28px 0; }
}

/* Complete state */
.xc-pb--complete .xc-pb-fill { width: 100% !important; }
.xc-pb--complete .xc-pb-message { color: var(--xc-pb-color-start, #ff6b35); }
.xc-pb--complete.xc-pb-pulse_complete .xc-pb-fill {
    animation: xcPbPulse 1s ease-in-out 3;
}

/* Confetti */
.xc-pb-confetti {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* Animations */
@keyframes xcPbSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
@keyframes xcPbPulse {
    0%,100% { box-shadow: none; }
    50%      { box-shadow: 0 0 12px var(--xc-pb-color-start, #ff6b35); }
}

/* Inside side-cart variant */
.xc-pb-in-cart {
    padding: 10px 16px;
    background: rgba(255,107,53,.04);
    border-bottom: 1px solid rgba(255,107,53,.12);
    border-radius: 0;
}
.xc-pb-in-cart .xc-pb-sticky { position: relative !important; top: auto !important; box-shadow: none; animation: none; }

/* ==========================================================================
   OVERLAY
   ========================================================================== */

.xc-sc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99997;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    backdrop-filter: blur(2px);
}
.xc-sc-overlay.xc-sc-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   SIDE CART DRAWER
   ========================================================================== */

.xc-sc-drawer {
    position: fixed;
    top: 0;
    height: 100%;
    width: var(--xc-sc-width, 420px);
    max-width: 96vw;
    background: var(--xc-sc-body-bg, #fff);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,.14);
    transition: transform .35s cubic-bezier(.22,.68,0,1.15), opacity .3s ease;
    border-radius: var(--xc-sc-radius, 12px) 0 0 var(--xc-sc-radius, 12px);
    overflow: hidden;
    will-change: transform;
}

/* Position variants */
.xc-sc-drawer.xc-sc-pos-right {
    right: 0;
    transform: translateX(100%);
    border-radius: var(--xc-sc-radius, 12px) 0 0 var(--xc-sc-radius, 12px);
    box-shadow: -6px 0 40px rgba(0,0,0,.15);
}
.xc-sc-drawer.xc-sc-pos-left {
    left: 0;
    transform: translateX(-100%);
    border-radius: 0 var(--xc-sc-radius, 12px) var(--xc-sc-radius, 12px) 0;
    box-shadow: 6px 0 40px rgba(0,0,0,.15);
}

/* Open state */
.xc-sc-drawer.xc-sc-open {
    transform: translateX(0) !important;
}

/* Fade animation override */
.xc-sc-anim-fade {
    transform: translateX(0) !important;
    opacity: 0;
    pointer-events: none;
}
.xc-sc-anim-fade.xc-sc-open {
    opacity: 1 !important;
    pointer-events: auto;
}

/* Bounce animation override */
.xc-sc-anim-bounce.xc-sc-open {
    animation: xcScBounceIn .5s cubic-bezier(.22,.68,0,1.4) both;
}
@keyframes xcScBounceIn {
    from { transform: translateX(110%); }
    to   { transform: translateX(0); }
}

/* Admin bar offset */
body.admin-bar .xc-sc-drawer { top: 32px; height: calc(100% - 32px); }
@media (max-width: 782px) {
    body.admin-bar .xc-sc-drawer { top: 46px; height: calc(100% - 46px); }
}

/* --- HEADER --------------------------------------------------------------- */
.xc-sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--xc-sc-header-bg, #fff);
    color: var(--xc-sc-header-color, #1a1a2e);
    border-bottom: 1px solid rgba(0,0,0,.07);
    flex-shrink: 0;
}
.xc-sc-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.xc-sc-cart-icon { width: 20px; height: 20px; color: var(--xc-sc-accent, #ff6b35); }
.xc-sc-header-count {
    font-size: .78rem;
    font-weight: 500;
    color: var(--xc-sc-header-color, #1a1a2e);
    opacity: .55;
    margin-left: 2px;
}

/* Close button */
.xc-sc-close {
    width: 36px; height: 36px;
    background: rgba(0,0,0,.05);
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
    color: var(--xc-sc-header-color, #1a1a2e);
    flex-shrink: 0;
}
.xc-sc-close svg { width: 16px; height: 16px; }
.xc-sc-close:hover { background: rgba(0,0,0,.1); transform: scale(1.08); }
.xc-sc-close:active { transform: scale(.95); }

/* --- BODY (cart items) ----------------------------------------------------- */
.xc-sc-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding: 8px 0;
    background: var(--xc-sc-body-bg, #fff);
}
.xc-sc-body::-webkit-scrollbar { width: 4px; }
.xc-sc-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

/* Items list */
.xc-sc-items { list-style: none; }
.xc-sc-item {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: background .15s;
    align-items: flex-start;
    animation: xcItemIn .3s ease both;
}
.xc-sc-item:hover { background: rgba(0,0,0,.015); }
@keyframes xcItemIn {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Item removing */
.xc-sc-item.xc-removing {
    animation: xcItemOut .25s ease forwards;
}
@keyframes xcItemOut {
    to { opacity: 0; transform: translateX(20px); height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Product image */
.xc-sc-item-image {
    width: 72px; height: 72px; flex-shrink: 0; border-radius: 8px;
    overflow: hidden; background: #f5f5f5;
}
.xc-sc-item-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xc-sc-item-image a { display: block; width: 100%; height: 100%; }

/* Item details */
.xc-sc-item-details { flex: 1; min-width: 0; }
.xc-sc-item-name {
    display: block;
    font-weight: 600;
    font-size: .875rem;
    color: #1a1a2e;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xc-sc-item-name:hover { color: var(--xc-sc-accent, #ff6b35); }
.xc-sc-item-variation { font-size: .775rem; color: #999; display: block; margin-bottom: 6px; }
.xc-sc-item-price-row { display: flex; align-items: center; gap: 8px; }
.xc-sc-item-price { font-size: .82rem; color: #888; }
.xc-sc-item-subtotal { font-size: .9rem; font-weight: 700; color: #1a1a2e; }

/* Item actions */
.xc-sc-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* Remove */
.xc-sc-remove {
    background: none; border: none; cursor: pointer;
    color: #ccc; padding: 2px; line-height: 1;
    transition: color .15s, transform .15s;
}
.xc-sc-remove svg { width: 15px; height: 15px; display: block; }
.xc-sc-remove:hover { color: #e53e3e; transform: scale(1.1); }

/* Quantity controls */
.xc-sc-qty-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(0,0,0,.1);
    border-radius: 8px;
    overflow: hidden;
    height: 30px;
}
.xc-sc-qty-btn {
    background: none; border: none;
    width: 28px; height: 100%;
    cursor: pointer;
    font-size: 1rem; line-height: 1;
    color: #555;
    transition: background .12s, color .12s;
    display: flex; align-items: center; justify-content: center;
}
.xc-sc-qty-btn:hover { background: var(--xc-sc-accent, #ff6b35); color: #fff; }
.xc-sc-qty-input {
    width: 34px; border: none; background: none;
    text-align: center; font-size: .85rem; font-weight: 600;
    color: #1a1a2e; padding: 0; outline: none;
    -moz-appearance: textfield;
}
.xc-sc-qty-input::-webkit-inner-spin-button,
.xc-sc-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* --- CROSS-SELLS ----------------------------------------------------------- */
.xc-sc-cross-sells { flex-shrink: 0; border-top: 1px solid rgba(0,0,0,.06); background: #fafafa; }
.xc-sc-cs-wrap { padding: 14px 20px; }
.xc-sc-cs-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #999; margin-bottom: 10px; }
.xc-sc-cs-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.xc-sc-cs-grid::-webkit-scrollbar { height: 3px; }
.xc-sc-cs-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 3px; }

.xc-sc-cs-item {
    flex-shrink: 0;
    width: 120px; border: 1.5px solid rgba(0,0,0,.08);
    border-radius: 10px; overflow: hidden;
    background: #fff; position: relative;
    transition: box-shadow .2s, transform .2s;
}
.xc-sc-cs-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.xc-sc-cs-image { display: block; height: 90px; overflow: hidden; }
.xc-sc-cs-image img { width: 100%; height: 100%; object-fit: cover; }
.xc-sc-cs-info { padding: 6px 8px 8px; }
.xc-sc-cs-name { display: block; font-size: .75rem; font-weight: 600; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.xc-sc-cs-price { font-size: .78rem; color: var(--xc-sc-accent, #ff6b35); font-weight: 700; }
.xc-sc-cs-add {
    position: absolute; top: 6px; right: 6px;
    width: 26px; height: 26px;
    background: var(--xc-sc-accent, #ff6b35); color: #fff;
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(255,107,53,.4);
    transition: transform .15s, box-shadow .15s;
}
.xc-sc-cs-add svg { width: 13px; height: 13px; }
.xc-sc-cs-add:hover { transform: scale(1.12); box-shadow: 0 4px 12px rgba(255,107,53,.5); }
.xc-sc-cs-add.xc-loading { opacity: .6; pointer-events: none; }

/* --- FOOTER --------------------------------------------------------------- */
.xc-sc-footer {
    flex-shrink: 0;
    background: var(--xc-sc-footer-bg, #f9f9f9);
    border-top: 1px solid rgba(0,0,0,.06);
    padding: 16px 20px;
}

/* Totals */
.xc-sc-totals { margin-bottom: 14px; }
.xc-sc-total-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .9rem; padding: 4px 0;
}
.xc-sc-total-row span:first-child { color: #666; }
.xc-sc-subtotal-amount { font-weight: 700; font-size: 1rem; color: #1a1a2e; }

/* Applied coupons */
.xc-sc-coupon-list { margin-bottom: 10px; }
.xc-sc-coupon-applied {
    display: flex; align-items: center; gap: 8px;
    background: rgba(56,161,105,.08); border: 1px solid rgba(56,161,105,.2);
    border-radius: 7px; padding: 5px 10px;
    font-size: .82rem; margin-bottom: 5px;
}
.xc-sc-coupon-code { font-weight: 600; color: #2f7a4c; flex: 1; }
.xc-sc-coupon-discount { font-weight: 700; color: #38a169; }
.xc-sc-coupon-remove {
    background: none; border: none; cursor: pointer;
    color: #999; font-size: 1rem; line-height: 1;
    transition: color .15s;
}
.xc-sc-coupon-remove:hover { color: #e53e3e; }

/* Shipping est */
.xc-sc-shipping-est {
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; color: #888; margin-top: 6px;
}
.xc-sc-shipping-est svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Coupon form */
.xc-sc-coupon-form {
    display: flex; gap: 8px; margin-bottom: 6px;
}
.xc-sc-coupon-input {
    flex: 1; padding: 9px 12px;
    border: 1.5px solid rgba(0,0,0,.12);
    border-radius: 8px; font-size: .85rem;
    font-family: inherit; outline: none;
    transition: border-color .15s;
}
.xc-sc-coupon-input:focus { border-color: var(--xc-sc-accent, #ff6b35); }
.xc-sc-coupon-apply {
    padding: 9px 16px; background: var(--xc-sc-accent, #ff6b35);
    color: #fff; border: none; border-radius: 8px;
    font-size: .85rem; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background .15s, transform .1s;
}
.xc-sc-coupon-apply:hover { background: var(--xc-sc-cta-bg, #e8551f); transform: scale(1.02); }
.xc-sc-coupon-apply:active { transform: scale(.97); }

/* Coupon message */
.xc-sc-coupon-msg {
    font-size: .8rem; min-height: 1.2em;
    margin-bottom: 8px; transition: opacity .2s;
}
.xc-sc-coupon-msg.success { color: #38a169; }
.xc-sc-coupon-msg.error   { color: #e53e3e; }

/* CTA buttons */
.xc-sc-cta-wrap { margin-bottom: 12px; }
.xc-sc-cta-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px;
    background: var(--xc-sc-cta-bg, #ff6b35);
    color: var(--xc-sc-cta-color, #fff) !important;
    border: none; border-radius: 10px;
    font-size: .95rem; font-weight: 700; font-family: inherit;
    text-decoration: none !important; cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(255,107,53,.3);
    letter-spacing: .01em;
}
.xc-sc-cta-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.xc-sc-cta-btn:hover {
    background: var(--xc-sc-accent, #e8551f);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,107,53,.4);
}
.xc-sc-cta-btn:active { transform: translateY(1px); }

.xc-sc-continue {
    display: block; width: 100%; padding: 9px;
    background: none; border: 1.5px solid rgba(0,0,0,.1);
    border-radius: 10px; font-size: .85rem; font-weight: 500;
    color: #666; cursor: pointer; font-family: inherit;
    margin-top: 8px; transition: border-color .15s, color .15s;
}
.xc-sc-continue:hover { border-color: var(--xc-sc-accent, #ff6b35); color: var(--xc-sc-accent, #ff6b35); }

/* Trust badges */
.xc-sc-trust-badges {
    display: flex; justify-content: center; gap: 14px;
    font-size: .72rem; color: #aaa; flex-wrap: wrap;
    margin-top: 10px;
}

/* --- EMPTY STATE ----------------------------------------------------------- */
.xc-sc-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 20px; text-align: center;
    height: 100%;
}
.xc-sc-empty-icon { color: #ccc; margin-bottom: 20px; }
.xc-sc-empty-icon svg { width: 80px; height: 80px; }
.xc-sc-empty-title { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.xc-sc-empty-sub { font-size: .875rem; color: #999; margin-bottom: 24px; line-height: 1.5; }
.xc-sc-empty-cta {
    padding: 11px 28px;
    background: var(--xc-sc-accent, #ff6b35); color: #fff;
    border-radius: 10px; text-decoration: none;
    font-weight: 700; font-size: .9rem;
    transition: background .2s, transform .15s;
    box-shadow: 0 4px 14px rgba(255,107,53,.28);
}
.xc-sc-empty-cta:hover { background: #e8551f; transform: translateY(-1px); }

/* --- FLOATING TRIGGER BUTTON ----------------------------------------------- */
.xc-sc-float-btn {
    position: fixed;
    width: var(--xc-sc-icon-size, 56px);
    height: var(--xc-sc-icon-size, 56px);
    border-radius: 50%;
    background: var(--xc-sc-icon-bg, #ff6b35);
    color: var(--xc-sc-icon-color, #fff);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.15);
    z-index: 99993;
    transition: transform .2s cubic-bezier(.22,.68,0,1.4), box-shadow .2s;
}
.xc-sc-float-btn:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.xc-sc-float-btn:active { transform: scale(.95); }

/* Position variants */
.xc-sc-float-btn.xc-sc-pos-bottom_right { bottom: 24px; right: 24px; }
.xc-sc-float-btn.xc-sc-pos-bottom_left  { bottom: 24px; left: 24px; }
.xc-sc-float-btn.xc-sc-pos-top_right    { top: 80px; right: 24px; }
.xc-sc-float-btn.xc-sc-pos-top_left     { top: 80px; left: 24px; }

.xc-sc-float-icon { width: 46%; height: 46%; }

/* Badge */
.xc-sc-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 20px; height: 20px;
    background: var(--xc-sc-badge-bg, #e63946);
    color: var(--xc-sc-badge-color, #fff);
    border-radius: 50%;
    font-size: .68rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border: 2px solid #fff;
    animation: xcBadgePop .3s cubic-bezier(.22,.68,0,1.5) both;
}
@keyframes xcBadgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* Loading overlay on drawer */
.xc-sc-loading-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 10; backdrop-filter: blur(2px);
}
.xc-sc-spinner {
    width: 30px; height: 30px;
    border: 3px solid rgba(255,107,53,.2);
    border-top-color: var(--xc-sc-accent, #ff6b35);
    border-radius: 50%;
    animation: xcSpin .7s linear infinite;
}
@keyframes xcSpin { to { transform: rotate(360deg); } }

/* WooCommerce price override (ensure fonts look nice) */
.xc-sc-drawer .woocommerce-Price-amount { font-family: inherit; }

/* Scrollbar PB-zone */
.xc-sc-pb-zone { flex-shrink: 0; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 480px) {
    .xc-sc-drawer { width: 100% !important; max-width: 100%; border-radius: 0 !important; }
    .xc-sc-float-btn.xc-sc-pos-bottom_right { bottom: 16px; right: 16px; }
    .xc-sc-float-btn.xc-sc-pos-bottom_left  { bottom: 16px; left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .xc-pb-fill,
    .xc-sc-drawer,
    .xc-sc-overlay,
    .xc-sc-float-btn,
    .xc-sc-item { transition: none !important; animation: none !important; }
}
