/* Cart Items Plugin Styles */

/* Base styles for cart items display */
[data-cart-items] {
    display: inline-block;
    font-weight: normal;
    transition: all 0.3s ease;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Tighter spacing for all cart elements */
[data-cart-items],
.cart-items-elementor {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    letter-spacing: -0.5px !important;
    word-spacing: -1px !important;
    font-size: inherit !important;
    font-kerning: none !important;
    font-weight: 500 !important;
}

/* Remove ALL spacing from parentheses and text */
[data-cart-items] *,
.cart-items-elementor * {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    letter-spacing: -0.5px !important;
    word-spacing: -1px !important;
    border: none !important;
    outline: none !important;
    vertical-align: baseline !important;
    font-weight: 500 !important;
    font-size: inherit !important;
}

/* Super tight spacing - remove gaps between characters */
[data-cart-items],
.cart-items-elementor {
    font-kerning: none !important;
    text-rendering: optimizeSpeed !important;
    white-space: nowrap !important;
}

/* Elementor specific overrides */
.elementor-widget-container [data-cart-items],
.elementor-widget-container .cart-items-elementor {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    border-spacing: 0 !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
}

/* Cart count number styling */
.cart-count {
    font-weight: 500 !important;
    color: #000000 !important;
    transition: color 0.3s ease;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
    display: inline !important;
    font-size: inherit !important;
}

/* Override theme/elementor styles */
[data-cart-items] .cart-count,
.cart-items-elementor .cart-count,
.elementor-widget .cart-count {
    color: #000000 !important;
    font-weight: 500 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    letter-spacing: -0.5px !important;
    vertical-align: baseline !important;
    display: inline !important;
    font-size: inherit !important;
}

/* When cart is empty */
.cart-empty .cart-count {
    color: #95a5a6;
}

/* When cart has items */
.cart-has-items .cart-count {
    color: #000000 !important;
}

/* Elementor widget specific styles */
.cart-items-elementor {
    display: inline-block;
}

/* Common badge/pill style */
.cart-items-badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    display: inline-block;
    line-height: 1.4;
}

.cart-items-badge.cart-empty {
    background-color: #95a5a6;
}

/* Bubble style for cart count */
.cart-items-bubble {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
}

.cart-items-bubble.cart-empty {
    background-color: #95a5a6;
}

/* Hide when cart is empty and show_zero is false */
[data-cart-items][data-show-zero="false"].cart-empty {
    display: none !important;
}

/* Animation for count changes */
@keyframes cartCountPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-count.updated {
    animation: cartCountPulse 0.6s ease-in-out;
}

/* Responsive styles */
@media (max-width: 768px) {
    [data-cart-items] {
        font-size: 14px;
    }
    
    .cart-items-badge {
        padding: 1px 6px;
        font-size: 11px;
        min-width: 16px;
    }
    
    .cart-items-bubble {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    /* Move the entire cart items container closer to cart icon on mobile */
    html body .elementor-section .elementor-container .elementor-column:has([data-cart-items]),
    html body .elementor-section .elementor-container .elementor-widget:has([data-cart-items]),
    html body .elementor-section .elementor-widget-container .elementor-widget:has([data-cart-items]),
    html body .main-header .icon-links:has([data-cart-items]),
    html body .header .icon-links:has([data-cart-items]) {
        margin-left: -90px !important;
        padding-left: 0px !important;
        position: relative !important;
    }
}

/* Additional mobile adjustments for smaller screens */
@media (max-width: 576px) {
    /* Move the entire cart items container closer to cart icon on small mobile */
    html body .elementor-section .elementor-container .elementor-column:has([data-cart-items]),
    html body .elementor-section .elementor-container .elementor-widget:has([data-cart-items]),
    html body .elementor-section .elementor-widget-container .elementor-widget:has([data-cart-items]),
    html body .main-header .icon-links:has([data-cart-items]),
    html body .header .icon-links:has([data-cart-items]) {
        margin-left: -90px !important;
        padding-left: 0px !important;
        position: relative !important;
    }
}

/* Loading state */
[data-cart-items].loading {
    opacity: 0.6;
}

[data-cart-items].loading .cart-count::after {
    content: "...";
    animation: loadingDots 1s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cart-count {
        color: #000;
        background-color: #fff;
        padding: 1px 3px;
        border: 1px solid #000;
    }
    
    .cart-items-badge,
    .cart-items-bubble {
        background-color: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* WordPress theme overrides */
.site-header [data-cart-items],
.main-navigation [data-cart-items],
.menu-item [data-cart-items],
nav [data-cart-items],
header [data-cart-items] {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Target common theme classes */
.nav-menu [data-cart-items],
.primary-menu [data-cart-items],
.main-menu [data-cart-items] {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Remove spacing that themes might add */
[data-cart-items]:before,
[data-cart-items]:after,
.cart-items-elementor:before,
.cart-items-elementor:after {
    content: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Aggressive spacing reset */
body [data-cart-items],
body .cart-items-elementor {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    display: inline !important;
    vertical-align: baseline !important;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    [data-cart-items],
    .cart-count {
        transition: none;
    }
    
    .cart-count.updated {
        animation: none;
    }
} 