/* WooCommerce AJAX Add to Cart Button - Enhanced Styles */
.wace-cart-container {
    position: relative;
    display: block;
    width: 100%;
}

/* Add to Cart Button Base Styles */
.wace-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    outline: none;
    user-select: none;
}

.wace-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Price Info Styles */
.wace-price-info {
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

/* Stock Info Base Styles */
.wace-stock-info {
    text-align: center;
    width: 100%;
    margin-top: 8px;
    font-size: 13px;
}

/* Style Presets for Cart Container */
/* Modern Style (Default) */
.wace-style-modern .wace-add-to-cart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
}

.wace-style-modern .wace-add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.6);
}

.wace-style-modern .wace-price-info {
    color: #667eea;
    font-weight: 600;
    font-size: 20px;
}

.wace-style-modern .wace-stock-info {
    color: #10b981;
    font-weight: 500;
}

.wace-style-modern .wace-stock-info.low-stock {
    color: #f59e0b;
}

.wace-style-modern .wace-stock-info.out-of-stock {
    color: #ef4444;
}

.wace-style-modern .wace-quantity-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.wace-style-modern .wace-qty-btn {
    background: white;
    color: #64748b;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wace-style-modern .wace-qty-btn:hover:not(:disabled) {
    background: #f1f5f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Classic Style */
.wace-style-classic .wace-add-to-cart-btn {
    background: #2c3e50;
    color: white;
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wace-style-classic .wace-add-to-cart-btn:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wace-style-classic .wace-price-info {
    color: #e74c3c;
    font-weight: 700;
    font-size: 18px;
}

.wace-style-classic .wace-stock-info {
    color: #27ae60;
}

.wace-style-classic .wace-stock-info.low-stock {
    color: #f39c12;
}

.wace-style-classic .wace-stock-info.out-of-stock {
    color: #e74c3c;
}

.wace-style-classic .wace-quantity-controls {
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
}

.wace-style-classic .wace-qty-btn {
    background: #95a5a6;
    color: white;
    border-radius: 2px;
}

.wace-style-classic .wace-qty-btn:hover:not(:disabled) {
    background: #7f8c8d;
}

/* Minimal Style */
.wace-style-minimal .wace-add-to-cart-btn {
    background: transparent;
    color: #333;
    border: 2px solid #333;
    border-radius: 0;
    padding: 15px 30px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wace-style-minimal .wace-add-to-cart-btn:hover {
    background: #333;
    color: white;
    transform: none;
}

.wace-style-minimal .wace-price-info {
    color: #333;
    font-weight: 300;
    font-size: 16px;
}

.wace-style-minimal .wace-stock-info {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wace-style-minimal .wace-stock-info.low-stock,
.wace-style-minimal .wace-stock-info.out-of-stock {
    color: #333;
}

.wace-style-minimal .wace-quantity-controls {
    background: white;
    border: 1px solid #ddd;
    border-radius: 0;
}

.wace-style-minimal .wace-qty-btn {
    background: transparent;
    color: #666;
    border-radius: 0;
    border: none;
}

.wace-style-minimal .wace-qty-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

/* Quantity Controls Common Styles */
.wace-quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.wace-qty-btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 5px;
}

.wace-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wace-qty-display {
    flex-shrink: 0;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    padding: 0 15px;
    min-width: 40px;
}

/* Success Popup Styles */
.wace-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.3s ease-out;
    direction: rtl;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wace-popup {
    background: white;
    border-radius: 16px;
    padding: 24px 32px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 90%;
    position: relative;
    animation: slideInPopup 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInPopup {
    from { opacity: 0; transform: scale(0.8) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.wace-popup-content {
    text-align: center;
}

.wace-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
}

.wace-popup-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.wace-popup-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wace-popup-info {
    flex: 1;
    text-align: right;
}

.wace-popup-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.4;
}

.wace-popup-price {
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
}

/* Popup Quantity Controls */
.wace-popup-quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.wace-popup-quantity-controls .wace-qty-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.2s ease;
    margin: 0;
}

.wace-popup-quantity-controls .wace-qty-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

.wace-popup-quantity-controls .wace-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wace-popup-quantity-controls .wace-qty-display {
    font-weight: 600;
    font-size: 16px;
    padding: 0 5px;
    min-width: 30px;
    text-align: center;
}

/* Popup Action Buttons */
.wace-popup-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.wace-popup-actions .wace-popup-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.wace-popup-actions .wace-continue-shopping-btn,
.wace-popup-actions .wace-view-cart-btn {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.wace-popup-actions .wace-continue-shopping-btn:hover,
.wace-popup-actions .wace-view-cart-btn:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.wace-popup-actions .wace-checkout-btn {
    background: linear-gradient(135deg, #5664c9 0%, #683e8f 100%);
    color: white;
}

.wace-popup-actions .wace-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.wace-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.wace-popup-close:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: scale(1.05);
}

/* Global Notification Styles */
.wace-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 400px;
    width: calc(100% - 40px);
    z-index: 999999;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
}

.wace-notification.show {
    transform: translateX(-50%) translateY(0);
}

.wace-notification.wace-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.wace-notification.wace-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Loading Animation */
.wace-btn-loader svg {
    animation: waceRotate 1s linear infinite;
}

@keyframes waceRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error States */
.wace-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #ffcdd2;
    font-size: 14px;
}

/* Enhanced Interactive Effects */
.wace-add-to-cart-btn {
    position: relative;
}

.wace-add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.wace-add-to-cart-btn:hover::before {
    transform: translateX(100%);
}

/* Focus Styles for Accessibility */
.wace-add-to-cart-btn:focus,
.wace-qty-btn:focus,
.wace-popup-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .wace-add-to-cart-btn {
        border: 2px solid currentColor;
    }
    
    .wace-popup {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wace-add-to-cart-btn,
    .wace-qty-btn,
    .wace-popup-button,
    .wace-popup,
    .wace-notification {
        transition: none;
        animation: none;
    }
    
    .wace-add-to-cart-btn:hover {
        transform: none;
    }
    
    .wace-btn-loader svg {
        animation: none;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .wace-popup {
        margin: 20px;
        padding: 20px;
        border-radius: 12px;
    }
    
    .wace-popup-product {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .wace-popup-info {
        text-align: center;
    }
    
    .wace-popup-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .wace-popup-actions .wace-popup-button {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .wace-add-to-cart-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .wace-notification {
        bottom: 10px;
        width: calc(100% - 20px);
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .wace-popup {
        width: 95%;
        padding: 16px;
    }
    
    .wace-popup-title {
        font-size: 18px;
    }
    
    .wace-popup-image img {
        width: 50px;
        height: 50px;
    }
    
    .wace-qty-display {
        font-size: 14px;
        min-width: 35px;
    }
}

/* RTL Support */
[dir="rtl"] .wace-popup-product {
    text-align: left;
}

[dir="rtl"] .wace-popup-info {
    text-align: left;
}

[dir="rtl"] .wace-popup-close {
    left: auto;
    right: 16px;
}

/* Print Styles */
@media print {
    .wace-popup-overlay,
    .wace-notification {
        display: none !important;
    }
}