/* ======================== */
/* Header Cart Popup Styles */
/* Light SaaS Theme         */
/* ======================== */

/* 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 */
.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: #0f172a;
    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: #4f46e5;
}

.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, #4f46e5, #7c3aed);
    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 Panel         */
/* ======================== */
.cart-popup {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 360px;
    max-height: 500px;
    border-radius: 16px;
    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: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
    backdrop-filter: none !important;
}

.header-cart.active .cart-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ======================== */
/* Popup Header             */
/* ======================== */
.cart-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-popup-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-popup-header h4 i {
    color: #4f46e5;
    margin: 0 !important;
    font-size: 1.1rem;
}

.cart-popup-close {
    background: #ef4444;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    outline: none !important;
    flex-shrink: 0;
}

.cart-popup-close i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    line-height: 1;
}

.cart-popup-close:hover {
    background: #dc2626;
    color: #ffffff;
    transform: scale(1.1);
}

.cart-popup-close:focus,
.cart-popup-close:active,
.cart-popup-close:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* ======================== */
/* Cart Items List          */
/* ======================== */
.cart-popup-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    max-height: 280px;
}

.cart-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cart-popup-item:last-child {
    margin-bottom: 0;
}

.cart-popup-item:hover {
    background: #f1f5f9;
    border-color: rgba(79, 70, 229, 0.1);
}

.cart-popup-item .item-image {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
}

.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.88rem;
    color: #1e293b !important;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.cart-popup-item .item-price {
    font-size: 0.82rem;
    color: #4f46e5 !important;
    font-weight: 600;
}

.cart-popup-item .item-remove {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.cart-popup-item .item-remove:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* ======================== */
/* Empty Cart               */
/* ======================== */
.cart-empty {
    text-align: center;
    padding: 25px 20px;
    color: #94a3b8 !important;
}

.cart-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.4;
    display: block;
    color: #94a3b8;
}

.cart-empty p {
    margin: 0;
    font-size: 0.88rem;
    color: #94a3b8 !important;
}

/* ======================== */
/* Footer (Total + Buttons) */
/* ======================== */
.cart-popup-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fafbfc;
}

.cart-popup-footer .cart-total {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #475569;
}

.cart-popup-footer .cart-total span {
    color: #64748b !important;
    font-weight: 500;
}

.cart-popup-footer .cart-total strong {
    color: #0f172a !important;
    font-weight: 700;
    font-size: 1rem;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #0f172a !important;
    background-clip: unset !important;
}

.cart-popup-footer .button {
    font-size: 0.82rem !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.cart-popup-footer .button.button-outline {
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    box-shadow: none !important;
}

.cart-popup-footer .button.button-outline:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    transform: none !important;
}

.cart-popup-footer .button.glow-effect {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
}

.cart-popup-footer .button.glow-effect:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35) !important;
    transform: translateY(-1px) !important;
}

/* ======================== */
/* Product Card Effects     */
/* ======================== */
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* Add to Cart Button */
.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               */
/* ======================== */
@media (max-width: 480px) {
    .cart-popup {
        width: 320px;
        right: -50px;
    }
}