/**
 * BoostCart for WooCommerce - Frontend Slide Cart Stylesheet
 */

:root {
    --bc-accent: #2563eb;
    --bc-width: 420px;
    --bc-drawer-bg: #ffffff;
    --bc-drawer-text: #0f172a;
    --bc-checkout-bg: #2563eb;
    --bc-checkout-text: #ffffff;
    --bc-cart-bg: #f1f5f9;
    --bc-cart-text: #0f172a;
    --bc-progress-fill: #10b981;
    --bc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bc-radius: 12px;
}

/* Root & Backdrop Overlay */
.boostcart-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999990;
    pointer-events: none;
    font-family: var(--bc-font);
    box-sizing: border-box;
}

.boostcart-root * {
    box-sizing: border-box;
}

/* Theme Cart Conflict Suppressor */
body.boostcart-suppress-theme-cart .ast-site-header-cart-data,
body.boostcart-suppress-theme-cart .oceanwp-cart-sidebar,
body.boostcart-suppress-theme-cart #cart-popup,
body.boostcart-suppress-theme-cart .kadence-slide-cart,
body.boostcart-suppress-theme-cart .site-header-cart .widget_shopping_cart {
    display: none !important;
}

.boostcart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* Drawer Container */
.boostcart-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: var(--bc-width);
    background: var(--bc-drawer-bg);
    color: var(--bc-drawer-text);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.boostcart-position-right .boostcart-drawer {
    right: 0;
    transform: translateX(105%);
}

.boostcart-position-left .boostcart-drawer {
    left: 0;
    transform: translateX(-105%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

/* Open Active States */
.boostcart-root.is-open {
    pointer-events: auto;
}

.boostcart-root.is-open .boostcart-overlay {
    opacity: 1;
    pointer-events: auto;
}

.boostcart-root.is-open .boostcart-drawer {
    transform: translateX(0);
}

/* Inner Layout */
.boostcart-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.boostcart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: var(--bc-drawer-bg);
    flex-shrink: 0;
}

.boostcart-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.boostcart-header-title-wrap h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--bc-drawer-text);
}

.boostcart-count-pill {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.boostcart-close-btn {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.boostcart-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Urgency Timer Banner */
.boostcart-timer-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    animation: bcPulse 2s infinite ease-in-out;
}

.boostcart-timer-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

@keyframes bcPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.88; }
}

/* Rewards Progress Bar */
.boostcart-rewards-container {
    padding: 14px 22px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.boostcart-rewards-message {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-align: center;
    margin-bottom: 12px;
}

.boostcart-rewards-message strong {
    color: var(--bc-accent);
}

.boostcart-progress-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
}

.boostcart-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, var(--bc-progress-fill));
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.boostcart-reward-milestones {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 0;
    pointer-events: none;
}

.boostcart-milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
}

.boostcart-milestone-icon {
    font-size: 15px;
    transform: translateY(-16px);
    transition: transform 0.2s ease;
}

.boostcart-milestone.is-unlocked .boostcart-milestone-icon {
    animation: bcBounce 0.4s ease;
}

.boostcart-milestone-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    transition: all 0.2s ease;
}

.boostcart-milestone.is-unlocked .boostcart-milestone-dot {
    border-color: var(--bc-progress-fill);
    background: var(--bc-progress-fill);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

@keyframes bcBounce {
    0%, 100% { transform: translateY(-16px) scale(1); }
    50% { transform: translateY(-22px) scale(1.2); }
}

/* Drawer Body & Items */
.boostcart-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.boostcart-empty-state {
    text-align: center;
    padding: 60px 20px;
    margin: auto 0;
}

.boostcart-empty-icon {
    margin-bottom: 16px;
}

.boostcart-empty-state h4 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
}

.boostcart-empty-state p {
    margin: 0 0 20px;
    font-size: 13px;
    color: #64748b;
}

.boostcart-shop-now-btn {
    display: inline-block;
    background: var(--bc-accent);
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.boostcart-shop-now-btn:hover {
    opacity: 0.9;
}

/* Items List */
.boostcart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.boostcart-item-row {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: var(--bc-radius);
    transition: all 0.2s ease;
}

.boostcart-item-row:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.boostcart-item-row.is-free-gift-item {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.boostcart-item-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.boostcart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.boostcart-item-details {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.boostcart-item-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.boostcart-item-title a {
    color: var(--bc-drawer-text);
    text-decoration: none;
    transition: color 0.15s;
}

.boostcart-item-title a:hover {
    color: var(--bc-accent);
}

.boostcart-free-gift-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    width: fit-content;
}

.boostcart-item-price-wrap {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.boostcart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* Quantity Stepper */
.boostcart-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.boostcart-qty-btn {
    background: #f8fafc;
    border: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s;
}

.boostcart-qty-btn:hover {
    background: #e2e8f0;
}

.boostcart-qty-input {
    width: 34px;
    height: 26px;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    -moz-appearance: textfield;
    padding: 0;
    background: #ffffff;
}

.boostcart-qty-input::-webkit-outer-spin-button,
.boostcart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.boostcart-remove-item-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.boostcart-remove-item-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* In-Cart Upsells */
.boostcart-upsells-section {
    margin-top: 14px;
    padding: 14px;
    background: #f8fafc;
    border-radius: var(--bc-radius);
    border: 1px solid #e2e8f0;
}

.boostcart-upsells-header h4 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.boostcart-upsells-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.boostcart-upsell-card {
    min-width: 140px;
    max-width: 140px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.boostcart-upsell-image-wrap {
    position: relative;
    width: 100%;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.boostcart-upsell-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.boostcart-discount-pill {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
}

.boostcart-upsell-title {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.boostcart-upsell-title a {
    color: #1e293b;
    text-decoration: none;
}

.boostcart-upsell-price {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.boostcart-add-upsell-btn {
    width: 100%;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    background: var(--bc-accent) !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    margin-top: auto;
}

/* Footer & Checkout */
.boostcart-drawer-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid #e2e8f0;
    background: var(--bc-drawer-bg);
    flex-shrink: 0;
}

.boostcart-coupon-box, .boostcart-notes-box {
    margin-bottom: 12px;
}

.boostcart-coupon-toggle, .boostcart-notes-toggle {
    background: none;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    padding: 4px 0;
}

.boostcart-coupon-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.boostcart-coupon-input-group input {
    flex-grow: 1;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
}

.boostcart-coupon-input-group button {
    padding: 6px 14px;
    background: #334155;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.boostcart-applied-coupons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.boostcart-coupon-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.boostcart-remove-coupon-btn {
    background: none;
    border: none;
    color: #0369a1;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

/* Exit-Intent Urgency Flash Banner */
.boostcart-exit-flash-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    padding: 12px 18px;
    font-size: 13px;
    position: relative;
    animation: bcSlideDown 0.3s ease-out;
}

.boostcart-exit-flash-icon {
    font-size: 22px;
}

.boostcart-exit-flash-content {
    flex-grow: 1;
}

.boostcart-exit-flash-content strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.boostcart-exit-flash-content p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.95;
}

.boostcart-exit-flash-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.boostcart-exit-flash-close:hover {
    opacity: 1;
}

@keyframes bcSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 1-Click Micro Add-Ons */
.boostcart-micro-addons-wrap {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: var(--bc-radius);
    border: 1px solid #e2e8f0;
}

.boostcart-micro-addons-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.boostcart-micro-addons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.boostcart-addon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.boostcart-addon-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.boostcart-addon-item.is-active {
    border-color: #10b981;
    background: #f0fdf4;
}

.boostcart-addon-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.boostcart-addon-icon {
    font-size: 18px;
}

.boostcart-addon-info {
    display: flex;
    flex-direction: column;
}

.boostcart-addon-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.boostcart-addon-price {
    color: #16a34a;
    font-size: 12px;
}

.boostcart-addon-desc {
    margin: 2px 0 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

.boostcart-addon-toggle {
    position: relative;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

.boostcart-addon-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.boostcart-addon-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .25s;
    border-radius: 20px;
}

.boostcart-addon-switch:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s;
    border-radius: 50%;
}

.boostcart-addon-checkbox:checked + .boostcart-addon-switch {
    background-color: #10b981;
}

.boostcart-addon-checkbox:checked + .boostcart-addon-switch:before {
    transform: translateX(18px);
}

.boostcart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 4px;
    margin-bottom: 4px;
}

.boostcart-express-checkout-wrap {
    margin: 4px 0;
}

.boostcart-express-checkout-wrap .wc-proceed-to-checkout {
    padding: 0;
    margin: 0;
}

.boostcart-checkout-btn {
    width: 100%;
    padding: 13px 20px !important;
    background: var(--bc-checkout-bg) !important;
    color: var(--bc-checkout-text) !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: opacity 0.2s, transform 0.1s !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    display: block !important;
}

.boostcart-checkout-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.boostcart-viewcart-btn {
    width: 100%;
    padding: 10px 16px !important;
    background: var(--bc-cart-bg) !important;
    color: var(--bc-cart-text) !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    display: block !important;
}

/* Floating Launcher Button */
.boostcart-floating-btn {
    position: fixed;
    z-index: 999980;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bc-accent);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.boostcart-floating-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.boostcart-launcher-pos-bottom-right {
    bottom: 24px;
    right: 24px;
}

.boostcart-launcher-pos-bottom-left {
    bottom: 24px;
    left: 24px;
}

.boostcart-launcher-pos-middle-right {
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
}

.boostcart-launcher-pos-middle-left {
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
}

.boostcart-launcher-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.boostcart-launcher-badge.is-empty {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .boostcart-drawer {
        max-width: 100vw;
    }
    .boostcart-floating-btn {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }
}
