/* Custom Add to Cart Styles - Based on your design system */

.custom-add-to-cart-wrapper {
    margin: 15px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quantity Selector */
.quantity-selector {
    display: flex !important;
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.qty-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.qty-btn:hover {
    background: #89AE45 !important;
    color: white !important;
}

.qty-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.qty-btn svg {
    width: 12px !important;
    height: 12px !important;
}

.qty-input {
    width: 55px !important;  /* Til tal op til 999 */
    height: 28px !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    outline: none !important;
    -moz-appearance: textfield !important;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Main Add to Cart Button - Updated with green as default */
.custom-add-to-cart-btn {
    flex: 1 !important;
    padding: 8px 12px !important;
    background: linear-gradient(135deg, #89AE45 0%, #7a9b3e 100%) !important;
    border: 1px solid #89AE45 !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: white !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

/* Single button styling (when not in wrapper with quantity) */
.custom-add-to-cart-btn:not(.add-to-cart-wrapper .custom-add-to-cart-btn) {
    width: 100% !important;
    padding: 10px 14px !important;
    min-width: 150px !important;
}

/* Hover effect - only shimmer, no color change */
.custom-add-to-cart-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    transition: left 0.5s ease !important;
}

.custom-add-to-cart-btn:hover:not(:disabled)::before {
    left: 100% !important;
}

.custom-add-to-cart-btn:hover:not(:disabled) {
    /* Only shimmer effect, no color change */
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(137, 174, 69, 0.3) !important;
}

.custom-add-to-cart-btn:active {
    transform: translateY(0) !important;
}

/* Disabled state */
.custom-add-to-cart-btn:disabled,
.custom-add-to-cart-btn.disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.custom-add-to-cart-btn:disabled:hover {
    background: linear-gradient(135deg, #89AE45 0%, #7a9b3e 100%) !important;
    color: white !important;
    border-color: #89AE45 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Button text, icons and loader */
.btn-text {
    display: inline-block !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
}

.btn-icon {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
}

.btn-cart-icon {
    display: inline-block !important;
}

.btn-loader {
    display: none !important; /* Hidden by default */
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
}

/* Spinner animation for loading */
.spinner {
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

/* Loading State */
.custom-add-to-cart-btn.loading {
    opacity: 0.8 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.custom-add-to-cart-btn.loading .btn-loader {
    animation: spin 1s linear infinite !important;
}

.custom-add-to-cart-btn.loading .btn-text::after {
    content: '...' !important;
    animation: loading-dots 1.5s infinite !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes loading-dots {
    0%, 20% { content: '...' !important; }
    40% { content: '..' !important; }
    60% { content: '.' !important; }
    80%, 100% { content: '' !important; }
}

/* Success State */
.custom-add-to-cart-btn.success {
    background: linear-gradient(135deg, #000 0%, #333 100%) !important;
    color: white !important;
    border-color: #10b981 !important;
}

/* Success animation */
.custom-add-to-cart-btn.success-animation {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border-color: #10b981 !important;
    transform: scale(1.05) !important;
}

/* Messages */
.cart-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
}

.cart-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.cart-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Variation select */
.variation-select {
    margin-bottom: 15px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: #f8fafc;
    color: #475569;
    font-weight: 500;
}

.variation-select:focus {
    outline: none;
    border-color: #89AE45;
    box-shadow: 0 0 0 2px rgba(137, 174, 69, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .custom-add-to-cart-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .custom-add-to-cart-btn {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    .quantity-selector {
        align-self: flex-start;
    }
}

/* Product page integration */
.single-product .custom-add-to-cart-wrapper {
    margin: 25px 0;
}

.single-product .custom-add-to-cart-btn {
    font-size: 14px !important;
    padding: 12px 20px !important;
    min-width: 180px !important;
}

/* Shop page / archive pages */
.woocommerce ul.products li.product .custom-add-to-cart-btn {
    font-size: 11px !important;
    padding: 8px 12px !important;
    min-width: 120px !important;
}

/* Theme-specific overrides */
.woocommerce .custom-add-to-cart-wrapper {
    margin: 20px 0;
}

/* FunnelKit specific styles */
.fkcart-widget .custom-add-to-cart-btn {
    font-size: 11px !important;
    padding: 6px 12px !important;
    min-width: 100px !important;
}

/* Color variations */
.custom-add-to-cart-btn.btn-green:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #10b981 !important;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2) !important;
}

.custom-add-to-cart-btn.btn-orange:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.2) !important;
}

.custom-add-to-cart-btn.btn-red:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.2) !important;
}

/* Loading state overlay */
.custom-add-to-cart-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    pointer-events: none;
}