/**
 * Add to Cart Bag Button Styles
 * Shopping bag icon positioned in the bottom RIGHT corner of product cards
 */

.add-to-cart-bag-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;

    /* Button styling - Modified to Transparent */
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 10px;
    cursor: pointer;

    /* New Icon via Background */
    background-image: url('/wp-content/themes/MG_Wear/assets/img/bag.svg'); 
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;

    /* Flexbox for centering icon */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Transitions */
    transition: all 0.3s ease;

    /* Shadow - Removed */
    box-shadow: none;
}

.add-to-cart-bag-btn:hover {
 background-color: transparent;
    box-shadow: none;
    transform: scale(1.1);
}

.add-to-cart-bag-btn:active {
    transform: scale(0.95);
}

.add-to-cart-bag-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Icon styling - Hide original SVG by default */
.add-to-cart-bag-btn svg {
    width: 24px;
    height: 24px;
    display: none; /* Hidden */
    color: #000;
    transition: color 0.3s ease;
}

.add-to-cart-bag-btn:hover svg {
    color: #333;
}

/* Loading state */
.add-to-cart-bag-btn.loading {
    pointer-events: none;
    opacity: 0.7; /* Added opacity for visual feedback since SVG is hidden */
}

.add-to-cart-bag-btn.loading svg {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Added state (success) - Restore Green Background and SVG */
/* .add-to-cart-bag-btn.added {
    background: #4caf50;
    background-image: none; Remove custom bag icon
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); Optional: restore shadow for pop
} */

/* .add-to-cart-bag-btn.added svg {
    color: #fff;
    display: block; Show checkmark
} */

/* Responsive adjustments */
@media (max-width: 768px) {
    .add-to-cart-bag-btn {
        width: 42px;
        height: 42px;
        padding: 8px;
        bottom: 10px;
        right: 10px;
        background-size: 20px; /* Adjusted icon size */
    }

    .add-to-cart-bag-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .add-to-cart-bag-btn {
        width: 38px;
        height: 38px;
        padding: 7px;
        bottom: 8px;
        right: 8px;
        background-size: 18px; /* Adjusted icon size */
    }

    .add-to-cart-bag-btn svg {
        width: 18px;
        height: 18px;
    }
}