/* ======================== */
/* Header Cart Popup Styles */
/* ======================== */

/* Hide broken/weird font icons */
.cart-empty::before,
.header-cart .cart-empty::before,
.wc-block-cart__empty-cart__title::before,
.with-empty-cart-icon::before {
    display: none !important;
    content: '' !important;
}

/* Button icon spacing - gap between icon and text */
.button i,
.buy-now-btn i,
.add-to-cart-btn i,
button i,
.btn i {
    margin-inline-end: 6px;
}

.header-cart {
    position: relative;
}

.cart-toggle {
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.cart-toggle:hover {
    background: transparent;
    color: var(--secondary-color);
}

.cart-toggle:focus,
.cart-toggle:active {
    outline: none;
    box-shadow: none;
}

.cart-toggle i {
    font-size: 1.3rem;
    margin: 0 !important;
    outline: none !important;
}

/* Remove ALL outlines */
.header-cart *:focus,
.header-cart *:active,
.header-cart *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.cart-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.cart-count.pulse {
    animation: cartPulse 0.5s ease;
}

@keyframes cartPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

.cart-popup {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 360px;
    max-height: 500px;
    border-radius: 20px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #1a1a2e !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.header-cart.active .cart-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.cart-popup-header h4 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-popup-header h4 i {
    color: var(--secondary-color);
    margin: 0 !important;
}

.cart-popup-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 5px;
    transition: color 0.3s;
    outline: none !important;
}

.cart-popup-close:hover {
    color: #ef4444;
}

.cart-popup-close:focus,
.cart-popup-close:active,
.cart-popup-close:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.cart-popup-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    max-height: 280px;
}

.cart-popup-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.cart-popup-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cart-popup-item .item-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
}

.cart-popup-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-popup-item .item-info {
    flex: 1;
    min-width: 0;
}

.cart-popup-item .item-name {
    display: block;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.cart-popup-item .item-price {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.cart-popup-item .item-remove {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.cart-popup-item .item-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    transform: scale(1.1);
}

/* Empty Cart - Compact version */
.cart-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.cart-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
    display: block;
}

.cart-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.cart-popup-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cart-popup-footer .cart-total {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1rem;
}

.cart-popup-footer .cart-total strong {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Product Card Hover Effect */
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* Add to Cart Button Styles */
.add-to-cart-btn {
    position: relative;
}

.add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Cart Popup */
@media (max-width: 480px) {
    .cart-popup {
        width: 320px;
        right: -50px;
    }
}