/**
 * Flora Variable Products Styles
 * Версия: 1.0.0
 *
 * Стили для вариативных товаров
 * Файл: /wp-content/themes/storefront-flora-child/assets/css/flora-variable-products.css
 */

/* ===== КНОПКА ВЫБОРА ВАРИАЦИЙ ===== */
.flora-select-options {
    background: linear-gradient(135deg, #4caf50, #45a049) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.flora-select-options:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3) !important;
}

.flora-select-options.loading {
    opacity: 0.7;
    pointer-events: none;
}

.flora-variation-icon {
    margin-right: 5px;
    display: inline-block;
    animation: pulse 2s infinite;
}

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

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.flora-variation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.flora-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.flora-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Блокировка прокрутки body при открытом модальном окне */
body.flora-modal-open {
    overflow: hidden;
}

/* ===== ШАПКА МОДАЛЬНОГО ОКНА ===== */
.flora-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa, #fff);
}

.flora-modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: #2e7d32;
    font-weight: 600;
}

.flora-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.flora-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ===== ТЕЛО МОДАЛЬНОГО ОКНА ===== */
.flora-modal-body {
    padding: 25px;
}

.flora-product-image {
    text-align: center;
    margin-bottom: 20px;
}

.flora-product-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* ===== ФОРМА ВЫБОРА ВАРИАЦИЙ ===== */
.flora-variation-form {
    margin-top: 20px;
}

.flora-variation-row {
    margin-bottom: 20px;
}

.flora-variation-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flora-variation-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s;
    cursor: pointer;
}

.flora-variation-select:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.flora-variation-select:hover {
    border-color: #bbb;
}

/* ===== ИНФОРМАЦИЯ О ВАРИАЦИИ ===== */
.flora-variation-info {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.flora-variation-price {
    font-size: 24px;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 10px;
}

.flora-variation-price .amount {
    color: #2e7d32;
}

.flora-variation-stock {
    font-size: 14px;
}

.flora-variation-stock .in-stock {
    color: #4caf50;
    font-weight: 600;
}

.flora-variation-stock .out-of-stock {
    color: #f44336;
    font-weight: 600;
}

.no-variation {
    color: #999;
    font-style: italic;
}

/* ===== ДЕЙСТВИЯ ===== */
.flora-variation-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.flora-quantity {
    width: 80px;
    padding: 12px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s;
}

.flora-quantity:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.flora-add-variation-to-cart {
    flex: 1;
    padding: 12px 30px !important;
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flora-add-variation-to-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.flora-add-variation-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.flora-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000000;
    display: none;
    animation: slideInRight 0.3s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

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

.flora-notification-success {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.flora-notification-error {
    background: linear-gradient(135deg, #f44336, #e53935);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .flora-modal-content {
        width: 95%;
        max-height: 95vh;
        top: 2.5vh;
        transform: translate(-50%, 0);
    }

    .flora-modal-header {
        padding: 15px 20px;
    }

    .flora-modal-header h3 {
        font-size: 18px;
    }

    .flora-modal-body {
        padding: 20px;
    }

    .flora-product-image img {
        max-width: 150px;
    }

    .flora-variation-actions {
        flex-direction: column;
        width: 100%;
    }

    .flora-quantity {
        width: 100%;
    }

    .flora-add-variation-to-cart {
        width: 100%;
    }

    .flora-notification {
        right: 10px;
        left: 10px;
        top: 60px;
    }
}

/* ===== ИНТЕГРАЦИЯ С ТАБЛИЦЕЙ КАТАЛОГА ===== */
.ftc-table-wrapper .flora-select-options {
    font-size: 13px !important;
    padding: 8px 15px !important;
}

.ftc-table-wrapper .flora-variation-icon {
    font-size: 12px;
}

/* ===== АНИМАЦИЯ ЗАГРУЗКИ ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.flora-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
