/* ===== Cart Counter ===== */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    display: none;
    /* Hidden by default */
}

/* ===== Mini Cart Items ===== */
.tf-mini-cart-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.tf-mini-cart-item:last-child {
    border-bottom: none;
}

.tf-mini-cart-items {
    min-height: 200px;
}

.box-text_empty {
    padding: 40px 20px;
    text-align: center;
}

/* ===== Color Dot ===== */
.dot-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-left: 5px;
    border: 1px solid #ddd;
}

/* ===== Progress Bar ===== */
.tf-progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
    margin: 10px 0;
}

.tf-progress-bar .value {
    background: #28a745;
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* ===== Cart Summary ===== */
#cartSummary {
    display: block !important;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    background: white;
    position: sticky;
    bottom: 0;
}

/* ===== Remove Button ===== */
.tf-mini-cart-item .remove {
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    padding: 5px;
}

.tf-mini-cart-item .remove:hover {
    color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
}

/* ===== Button States ===== */
.tf-mini-cart-view-checkout .tf-btn[style*="pointer-events: none"] {
    cursor: not-allowed;
}

/* ===== Add to Cart Success State ===== */
.add-to-cart-btn.added {
    color: #28a745 !important;
}

/* Prevent double event triggering */
.btn-quantity {
    position: relative;
    z-index: 1;
}

.btn-quantity::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

/* Ensure proper button behavior */
.wg-quantity {
    position: relative;
}

.quantity-product {
    pointer-events: auto;
}

.nav-icon-list .wishlist-count,
.nav-icon-list .cart-count {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: #dc3545 !important;
    color: white !important;
    border-radius: 50% !important;
    width: 18px !important;
    height: 18px !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    line-height: 1 !important;
    transform: translate(0, 0) !important;
}

.nav-icon-list li {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-icon-list .shop-cart {
    position: relative;
}

.nav-icon-list .nav-icon-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

/* Ensure the counts are positioned correctly relative to their icons */
.nav-icon-list li:not(.shop-cart) {
    position: relative;
}

/* Hide counts when they are 0 */
.nav-icon-list .wishlist-count:not(:empty),
.nav-icon-list .cart-count:not(:empty) {
    display: flex;
}

.nav-icon-list .wishlist-count:empty,
.nav-icon-list .cart-count:empty {
    display: none;
}

/* Pulse animation for when counts update */
@keyframes headerCountPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.nav-icon-list .wishlist-count.pulse,
.nav-icon-list .cart-count.pulse {
    animation: headerCountPulse 0.5s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .nav-icon-list .wishlist-count,
    .nav-icon-list .cart-count {
        width: 16px;
        height: 16px;
        font-size: 9px;
        top: -6px;
        right: -6px;
    }
}

/* Hover effects */
.nav-icon-list li:hover .wishlist-count,
.nav-icon-list li:hover .cart-count {
    background: #c82333;
    transform: scale(1.05);
    transition: all 0.3s ease;
}