:root {
    --reve-primary: #332342;
    --reve-secondary: #FCF6F5;
    --reve-tertiary: #ffffff;
    --reve-accent: #9b59b6;
    --reve-light-border: #f0e6f0;
    --reve-font: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Global font */
.reve-cart-popup,
.reve-cart-popup * {
    font-family: var(--reve-font) !important;
    font-size: 14px;
}

.reve-floating-cart {
    font-family: var(--reve-font) !important;
}

/* Floating Cart Icon - Bottom Left */
.reve-floating-cart {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999998;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(51, 35, 66, 0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reve-floating-cart:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(51, 35, 66, 0.4) !important;
}

.reve-floating-cart svg {
    width: 22px;
    height: 22px;
    color: var(--reve-tertiary) !important;
}

.reve-floating-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--reve-accent) !important;
    color: var(--reve-tertiary) !important;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Cart Popup - No overlay blocking */
.reve-cart-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    pointer-events: none;
}

.reve-cart-popup.reve-open {
    pointer-events: auto;
}

.reve-cart-overlay {
    display: none;
}

.reve-cart-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--reve-tertiary) !important;
    border-radius: 20px 20px 0 0;
    max-height: 50vh;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 30px rgba(51, 35, 66, 0.25) !important;
    pointer-events: auto;
}

.reve-open .reve-cart-panel {
    transform: translateY(0);
}

/* Drag handle */
.reve-cart-handle {
    width: 40px;
    height: 4px;
    background: #ddd !important;
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
}

/* Header */
.reve-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px 12px;
    flex-shrink: 0;
}

.reve-cart-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--reve-primary) !important;
}

.reve-cart-close {
    width: 28px !important;
    height: 28px !important;
    border: none !important;
    background: var(--reve-secondary) !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    line-height: 1 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--reve-primary) !important;
    transition: background 0.2s ease !important;
}

.reve-cart-close:hover {
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
}

/* Shipping Progress Bar */
.reve-shipping-progress {
    padding: 12px 20px;
    background: var(--reve-secondary) !important;
    flex-shrink: 0;
    display: block !important;
}

.reve-shipping-progress[style*="display: none"],
.reve-shipping-progress[style*="display:none"] {
    display: block !important;
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.reve-shipping-progress:not([style*="display: none"]):not([style*="display:none"]) {
    opacity: 1;
    height: auto;
    padding: 12px 20px;
    transition: opacity 0.3s ease, height 0.3s ease, padding 0.3s ease;
}

.reve-shipping-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--reve-primary) !important;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.reve-shipping-message span {
    line-height: 1.4;
    color: var(--reve-primary) !important;
}

.reve-shipping-message strong {
    color: var(--reve-accent) !important;
}

.reve-shipping-unlocked {
    color: var(--reve-primary) !important;
    font-weight: 600;
}

.reve-progress-bar {
    position: relative;
    height: 6px;
    background: rgba(51, 35, 66, 0.15) !important;
    border-radius: 3px;
    overflow: visible;
}

.reve-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--reve-primary), var(--reve-accent)) !important;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reve-progress-truck {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: var(--reve-primary) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--reve-tertiary) !important;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(51, 35, 66, 0.3) !important;
}

.reve-progress-truck svg {
    width: 14px;
    height: 14px;
    color: var(--reve-tertiary) !important;
}

/* Truck animation when moving */
.reve-progress-truck.reve-animating {
    animation: reve-truck-bounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes reve-truck-bounce {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    25% {
        transform: translate(-50%, -60%) scale(1.1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    75% {
        transform: translate(-50%, -55%) scale(1.08);
    }
}

@keyframes reve-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Truck shake animation when reaching 100% */
.reve-progress-truck.reve-complete {
    animation: reve-truck-celebrate 0.6s ease;
    background: var(--reve-accent) !important;
}

@keyframes reve-truck-celebrate {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    20% {
        transform: translate(-50%, -50%) rotate(-10deg);
    }
    40% {
        transform: translate(-50%, -50%) rotate(10deg);
    }
    60% {
        transform: translate(-50%, -50%) rotate(-5deg);
    }
    80% {
        transform: translate(-50%, -50%) rotate(5deg);
    }
}

/* Free shipping label in breakdown */
.reve-free-shipping {
    color: #27ae60 !important;
    font-weight: 600;
}

.reve-shipping-calc {
    font-size: 12px;
    color: #888 !important;
    font-style: italic;
}

/* Content */
.reve-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    min-height: 0;
    background: var(--reve-tertiary) !important;
}

.reve-cart-empty {
    text-align: center;
    color: var(--reve-primary) !important;
    padding: 24px 0;
    opacity: 0.6;
    font-size: 16px;
}

.reve-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--reve-tertiary) !important;
}

/* Cart Item */
.reve-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    background: var(--reve-tertiary) !important;
}

.reve-cart-item:not(:last-child) {
    border-bottom: 1px solid var(--reve-light-border) !important;
}

/* Quantity circle badge */
.reve-item-qty-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--reve-secondary) !important;
    border: 1px solid var(--reve-light-border) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--reve-primary) !important;
}

.reve-item-info {
    flex: 1;
    min-width: 0;
}

.reve-item-name {
    display: block;
    font-weight: 500;
    color: var(--reve-primary) !important;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reve-item-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--reve-primary) !important;
    white-space: nowrap;
}

/* Remove button - trash icon, visible by default */
.reve-item-remove {
    width: auto;
    height: auto;
    border: none !important;
    background: transparent !important;
    color: var(--reve-primary) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    padding: 0 !important;
    margin: 0;
    flex-shrink: 0;
}

.reve-item-remove:hover {
    opacity: 1;
    color: var(--reve-primary) !important;
}

.reve-item-remove svg {
    width: 16px;
    height: 16px;
    color: var(--reve-primary) !important;
}

/* Hide trash icon when breakdown is visible */
.reve-cart-popup.reve-breakdown-open .reve-item-remove {
    display: none;
}

/* Inline quantity controls - completely hidden, no editing in breakdown */
.reve-item-controls {
    display: none !important;
}

.reve-item-qty {
    display: flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    gap: 6px;
}

.reve-item-qty .reve-qty-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 14px;
    border: none !important;
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    padding: 0 !important;
    margin: 0;
    border-radius: 50% !important;
    transition: opacity 0.2s ease;
}

.reve-item-qty .reve-qty-btn:hover {
    opacity: 0.8;
}

.reve-item-qty .reve-qty-value {
    min-width: 28px !important;
    height: 26px !important;
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    color: var(--reve-primary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--reve-tertiary) !important;
    border: 1px solid var(--reve-light-border) !important;
    border-radius: 4px !important;
    padding: 0 6px;
}

/* Delivery Estimate */
.reve-delivery-estimate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    color: var(--reve-primary) !important;
    background: var(--reve-secondary) !important;
    flex-shrink: 0;
}

.reve-delivery-estimate svg {
    color: var(--reve-accent) !important;
    flex-shrink: 0;
}

.reve-delivery-estimate span {
    font-weight: 500;
    color: var(--reve-primary) !important;
}

/* Separator */
.reve-cart-separator {
    height: 1px;
    background: var(--reve-light-border) !important;
    margin: 0 20px;
    flex-shrink: 0;
}

/* Totals Section */
.reve-cart-totals {
    padding: 14px 20px;
    flex-shrink: 0;
    background: var(--reve-tertiary) !important;
}

.reve-payable-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.reve-payable-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--reve-primary) !important;
}

.reve-payable-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--reve-primary) !important;
}

.reve-tax-note {
    font-size: 12px;
    color: #888 !important;
    margin-top: 2px;
}

/* View Breakdown - Plain underlined clickable text */
.reve-view-breakdown {
    color: var(--reve-accent) !important;
    text-decoration: underline !important;
    cursor: pointer;
    font-family: var(--reve-font) !important;
    font-size: 12px;
    font-weight: 400;
    display: inline;
    line-height: 1.4;
    margin-top: 4px;
    background: transparent !important;
    border: none !important;
}

.reve-view-breakdown:hover {
    color: var(--reve-primary) !important;
}

/* Breakdown Details */
.reve-breakdown-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--reve-light-border) !important;
    background: var(--reve-tertiary) !important;
}

.reve-breakdown-details.reve-visible {
    display: block;
}

.reve-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--reve-primary) !important;
    margin-bottom: 4px;
}

.reve-breakdown-row:last-child {
    margin-bottom: 0;
}

.reve-breakdown-row.reve-breakdown-total {
    font-weight: 600;
    padding-top: 6px;
    margin-top: 6px;
    border-top: 1px solid var(--reve-light-border) !important;
    color: var(--reve-primary) !important;
}

/* Express Checkout / Payment Request Containers */
.reve-express-checkout {
    margin-bottom: 10px;
    min-height: 44px;
    display: none;
}

.reve-express-checkout.reve-has-payment {
    display: block !important;
}

.reve-payment-request-container {
    min-height: 44px;
}

.reve-payment-request-container iframe {
    width: 100% !important;
}

/* Ensure payment buttons take full width */
.reve-express-fkwcs,
.reve-express-wcpay,
.reve-express-stripe {
    width: 100%;
}

.reve-express-fkwcs .StripeElement,
.reve-express-wcpay .StripeElement,
.reve-express-stripe .StripeElement {
    width: 100% !important;
}

/* Actions */
.reve-cart-actions {
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    background: var(--reve-tertiary) !important;
}

.reve-express-btn {
    flex: 1;
    padding: 10px 14px !important;
    text-align: center;
    font-weight: 600 !important;
    font-size: 16px !important;
    background: var(--reve-secondary) !important;
    color: var(--reve-accent) !important;
    border: 2px solid var(--reve-accent) !important;
    border-radius: 25px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--reve-font) !important;
}

.reve-express-btn:hover {
    background: rgba(155, 89, 182, 0.1) !important;
    color: var(--reve-accent) !important;
}

.reve-checkout-btn {
    flex: 1;
    padding: 10px !important;
    text-align: center;
    font-weight: 600 !important;
    font-size: 16px !important;
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: block;
    font-family: var(--reve-font) !important;
    width: 100%;
}

.reve-checkout-btn:hover {
    opacity: 0.9;
    color: var(--reve-tertiary) !important;
    background: var(--reve-accent) !important;
}

/* Hide old view cart button */
.reve-view-cart-btn {
    display: none !important;
}

/* Cart count badge */
.reve-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--reve-accent) !important;
    color: var(--reve-tertiary) !important;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 6px;
}

/* Mobile Quick View Banner (Mini Cart) */
.reve-mobile-banner {
    display: none;
    flex-direction: column;
    background: var(--reve-tertiary) !important;
    border-bottom: 1px solid var(--reve-light-border) !important;
    flex-shrink: 0;
}

/* Shipping Progress Bar in Banner - at top */
.reve-mobile-banner .reve-shipping-progress {
    padding: 12px 20px 10px;
    background: transparent !important;
    border-bottom: none !important;
    margin-bottom: 0;
}

/* Banner content wrapper */
.reve-banner-content {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 16px;
}

.reve-banner-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reve-banner-total-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.reve-banner-total-label {
    font-size: 13px;
    color: #888 !important;
    font-weight: 500;
    font-family: var(--reve-font) !important;
    white-space: nowrap;
}

.reve-banner-total-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--reve-primary) !important;
    font-family: var(--reve-font) !important;
}

.reve-banner-view-details {
    background: var(--reve-secondary) !important;
    border: 1px solid var(--reve-light-border) !important;
    border-radius: 20px !important;
    padding: 3px 10px !important;
    color: var(--reve-accent) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    font-family: var(--reve-font) !important;
    display: inline-block;
    transition: all 0.2s ease;
    text-decoration: none !important;
    align-self: flex-start;
}

.reve-banner-view-details:hover {
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    border-color: var(--reve-primary) !important;
}

.reve-banner-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
    max-width: 140px;
}

/* Express Checkout Slots */
.reve-express-slot {
    width: 100%;
}

/* Movable Express Container */
.reve-express-movable {
    width: 100%;
    display: none;
}

.reve-express-movable.reve-has-payment {
    display: block !important;
}

.reve-express-movable .reve-payment-request-container {
    min-height: 40px;
    border-radius: 5px;
    overflow: hidden;
}

.reve-banner-checkout-btn {
    width: 100% !important;
    padding: 10px 12px !important;
    text-align: center;
    font-weight: 600 !important;
    font-size: 14px !important;
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: block !important;
    font-family: var(--reve-font) !important;
    line-height: 1.4;
}

.reve-banner-checkout-btn:hover {
    opacity: 0.9;
    color: var(--reve-tertiary) !important;
    background: var(--reve-accent) !important;
}

/* Full Cart View - hidden on mobile by default */
.reve-full-cart-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--reve-tertiary) !important;
}

/* Mobile */
@media (max-width: 768px) {
    .reve-cart-panel {
        max-height: 28vh;
        border-radius: 16px 16px 0 0;
        transition: max-height 0.3s ease, transform 0.25s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    /* Show banner on mobile */
    .reve-mobile-banner {
        display: flex !important;
        flex-direction: column;
    }
    
    /* Shipping progress visible in banner on mobile */
    .reve-mobile-banner .reve-shipping-progress {
        display: block !important;
        padding: 12px 20px 10px;
    }
    
    /* Hide full cart view on mobile by default */
    .reve-full-cart-view {
        display: none !important;
    }
    
    /* When details are open, expand panel and make scrollable */
    .reve-cart-popup.reve-details-open .reve-cart-panel {
        max-height: 85vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    /* Show full cart when details open - FIXED TYPO */
    .reve-cart-popup.reve-details-open .reve-full-cart-view {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    
    /* Hide banner when details open */
    .reve-cart-popup.reve-details-open .reve-mobile-banner {
        display: none !important;
    }
    
    /* Ensure cart content is scrollable when details open */
    .reve-cart-popup.reve-details-open .reve-cart-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    /* Cart header stays at top when scrolling */
    .reve-cart-popup.reve-details-open .reve-cart-header {
        position: sticky;
        top: 0;
        background: var(--reve-tertiary) !important;
        z-index: 10;
        border-bottom: 1px solid var(--reve-light-border) !important;
    }
    
    /* Cart actions stay at bottom when scrolling */
    .reve-cart-popup.reve-details-open .reve-cart-actions {
        position: sticky;
        bottom: 0;
        background: var(--reve-tertiary) !important;
        z-index: 10;
        border-top: 1px solid var(--reve-light-border) !important;
    }
    
    .reve-floating-cart {
        bottom: 16px !important;
        left: 16px !important;
        width: 48px !important;
        height: 48px !important;
    }
    
    .reve-cart-actions {
        flex-direction: column;
    }
}

/* Desktop - Bottom Left Panel */
@media (min-width: 769px) {
    /* Hide mobile banner on desktop */
    .reve-mobile-banner {
        display: none !important;
    }
    
    /* Always show full cart view on desktop */
    .reve-full-cart-view {
        display: flex !important;
    }
    
    /* Shipping progress always visible on desktop in full cart */
    .reve-full-cart-view .reve-shipping-progress {
        display: block !important;
    }
    
    .reve-cart-panel {
        max-width: 420px;
        width: 420px;
        right: auto;
        left: 0;
        border-radius: 0 20px 0 0;
        max-height: 70vh;
    }
    
    .reve-cart-content {
        padding: 0 24px;
    }
    
    .reve-cart-header {
        padding: 6px 24px 12px;
    }
    
    .reve-cart-totals {
        padding: 14px 24px;
    }
    
    .reve-cart-actions {
        padding: 12px 24px 20px;
    }
    
    .reve-cart-separator {
        margin: 0 24px;
    }
    
    .reve-shipping-progress {
        padding: 12px 24px;
    }
    
    .reve-delivery-estimate {
        padding: 10px 24px;
    }
}

/* Bundled Items in Cart */
.reve-cart-item-bundle .reve-item-info {
    flex-direction: column;
    align-items: flex-start;
}

.reve-bundled-items {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
    font-size: 12px;
}

.reve-bundled-item {
    display: flex;
    gap: 4px;
    color: #666 !important;
    padding: 2px 0;
}

.reve-bundled-item-qty {
    color: #888 !important;
    font-weight: 500;
}

.reve-bundled-item-name {
    color: #666 !important;
}

/* Bundle product type styling - use same color as regular products */
.reve-product-type-bundle .reve-add-btn {
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
}

.reve-product-type-bundle .reve-add-btn:hover {
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    opacity: 0.9;
}

.reve-product-type-bundle .reve-qty-btn {
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
}

.reve-product-type-bundle .reve-qty-btn:hover {
    background: var(--reve-primary) !important;
    color: var(--reve-tertiary) !important;
    opacity: 0.8;
}

.reve-product-type-bundle .reve-qty-value {
    color: var(--reve-primary) !important;
    background: var(--reve-tertiary) !important;
    border: 1px solid var(--reve-light-border) !important;
}

/* Composite children in cart */
.reve-composite-children {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    font-size: 12px;
}

.reve-composite-child-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    padding: 2px 0;
}

.reve-composite-child-qty {
    color: var(--reve-primary);
    font-weight: 600;
    min-width: 24px;
}

.reve-composite-child-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reve-cart-item-composite {
    border-left: 3px solid var(--reve-primary);
}
