/**
 * Product Card Variations Popup Styles
 */

/* Variable Product Button Styling */
.product-card-v2__add-to-cart.variable-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 14px;
}

/* Popup Overlay */
.variation-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

/* Popup Container */
.variation-popup {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    font-family: "Archivo Variable", sans-serif;
}

/* Loading State */
.variation-popup.loading {
    max-width: 300px;
    padding: 40px;
    text-align: center;
}

.loading-spinner {
    margin-bottom: 20px;
    color: #007cba;
}

/* Popup Header */
.variation-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.variation-popup-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.variation-popup-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 35%;
    transition: all 0.2s ease;
}

.variation-popup-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* Popup Content */
.variation-popup-content {
    display: flex;
    gap: 24px;
    padding: 0 24px 24px 24px;
}

.variation-product-image {
    flex: 0 0 200px;
}

.variation-product-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

.variation-details {
    flex: 1;
}

.variation-price {
    font-size: 24px;
    font-weight: 600;
    color: #007cba;
    margin-bottom: 24px;
}

/* Variation Attributes */
.variation-attribute {
    margin-bottom: 24px;
}

.variation-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variation-option {
    padding: 12px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #333;
}

.variation-option:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
}

.variation-option.selected {
    border-color: #007cba;
    background-color: #007cba;
    color: white;
}

/* Quantity Controls */
.variation-quantity {
    margin-bottom: 24px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.quantity-btn {
    background: #f8f9fa;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    transition: background-color 0.2s ease;
    min-width: 44px;
}

.quantity-btn:hover {
    background-color: #e9ecef;
}

.quantity-input {
    border: none;
    padding: 12px 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    width: 80px;
    background: white;
    color: #333;
}

.quantity-input:focus {
    outline: none;
}

/* Add to Cart Button */
.variation-actions {
    margin-top: 32px;
}

.variation-add-to-cart {
    width: 100%;
    padding: 16px 24px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
}

.variation-add-to-cart:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-1px);
}

.variation-add-to-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.variation-add-to-cart .btn-loading svg {
    color: white;
}

.variation-add-to-cart .btn-success {
    color: white;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .variation-popup-overlay {
        padding: 10px;
    }
    
    .variation-popup {
        max-height: 95vh;
    }
    
    .variation-popup-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .variation-product-image {
        flex: none;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .variation-popup-header {
        padding: 20px 20px 0 20px;
    }
    
    .variation-popup-content {
        padding: 0 20px 20px 20px;
    }
    
    .variation-options {
        gap: 6px;
    }
    
    .variation-option {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .variation-popup-header h3 {
        font-size: 20px;
    }
    
    .variation-price {
        font-size: 20px;
    }
    
    .quantity-controls {
        width: 100%;
    }
    
    .quantity-input {
        flex: 1;
    }
}

/* Message Styles */
.popup-message {
    animation: slideInRight 0.3s ease;
}

.popup-message-success {
    background-color: #4CAF50 !important;
}

.popup-message-error {
    background-color: #f44336 !important;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
