/* =============================================================================
   VARIANT SELECTOR POPUP STYLES
   ============================================================================= */

/* Overlay */
.variant-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Container */
.variant-popup {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.btn-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f5f5f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.btn-close-popup:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* Popup Title */
.popup-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    padding-right: 40px;
}

.popup-secondary-name {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.popup-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Variant Options Grid */
.variant-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Variant Option Card */
.variant-option {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    position: relative;
    overflow: hidden;
}

.variant-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color, #007bff) 0%, var(--secondary-color, #0056b3) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.variant-option > * {
    position: relative;
    z-index: 1;
}

.variant-option:hover:not(.disabled) {
    border-color: var(--primary-color, #007bff);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.variant-option.selected {
    border-color: var(--primary-color, #007bff);
    background: rgba(0, 123, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.variant-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color, #007bff);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

.variant-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(100%);
    background: #f9f9f9;
}

/* Variant Image */
.variant-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: transform 0.3s;
}

.variant-option:hover:not(.disabled) .variant-image {
    transform: scale(1.05);
}

.variant-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}

/* Variant Details */
.variant-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-attrs {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    min-height: 40px;
}

.variant-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color, #007bff);
    margin: 8px 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-agotado {
    background: #6c757d;
    color: white;
}

.badge-stock {
    background: #28a745;
    color: white;
}

/* Section Divider */
.section-divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 25px 0;
}

/* Section Title */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-color, #007bff);
}

/* Quantity Controls */
.quantity-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Total Display */
.total-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 18px;
    font-weight: 600;
    color: #555;
}

.total-amount {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color, #007bff);
}

/* Add to Cart Button */
.btn-add-variant-to-cart {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-variant-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

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

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Product Card - Ver Variantes Button */
.btn-ver-variantes {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ver-variantes:hover {
    background: var(--secondary-color, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .variant-popup {
        padding: 20px;
        max-height: 95vh;
    }
    
    .popup-title {
        font-size: 22px;
    }
    
    .variant-options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quantity-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .variant-image,
    .variant-image-placeholder {
        height: 200px;
    }
    
    .total-display {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .variant-popup {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .btn-close-popup {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .variant-image,
    .variant-image-placeholder {
        height: 150px;
    }
    
    .variant-price {
        font-size: 20px;
    }
    
    .total-amount {
        font-size: 24px;
    }
}

/* Scrollbar Styling */
.variant-popup::-webkit-scrollbar {
    width: 8px;
}

.variant-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.variant-popup::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.variant-popup::-webkit-scrollbar-thumb:hover {
    background: #555;
}
