/* WC Preorder Button Styles */

/* Обертка кнопки на странице товара */
.wc-preorder-wrapper {
    margin: 20px 0;
}

/* 
 * Кнопка предзаказа - наследует стили WooCommerce .button.alt
 * но с уникальным цветом для выделения
 */
.wc-preorder-btn {
    display: inline-block;
    padding: .618em 1em;
    font-size: 100%;
    font-weight: 700;
    line-height: 1.618;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    background-color: #2c3e50 !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
    vertical-align: middle;
}

.wc-preorder-btn:hover,
.wc-preorder-btn:focus {
    background-color: #1a252f !important;
    color: #fff !important;
    text-decoration: none !important;
    outline: none;
}

.wc-preorder-btn:active {
    background-color: #151d25 !important;
}

/* Кнопка на странице товара */
.woocommerce .wc-preorder-wrapper .wc-preorder-btn,
.woocommerce-page .wc-preorder-wrapper .wc-preorder-btn,
.single-product .wc-preorder-wrapper .wc-preorder-btn,
.wc-preorder-wrapper .wc-preorder-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    height: 3.25rem !important;
    padding: 0 2.5rem !important;
    background-color: #2c3e50 !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    text-align: center !important;
    cursor: pointer !important;
    min-width: 200px !important;
    box-sizing: border-box !important;
}

.wc-preorder-wrapper .wc-preorder-btn:hover {
    background-color: #1a252f !important;
    color: #fff !important;
}

/* Кнопка в каталоге - точно как кнопки темы Bevesi */
.woocommerce ul.products li.product .wc-preorder-loop-btn,
.product-cart .wc-preorder-loop-btn,
.wc-preorder-loop-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 2.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    padding: 0 0.75rem !important;
    margin: 0 !important;
    background-color: #2c3e50 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    text-align: center !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.wc-preorder-loop-btn:hover,
.wc-preorder-loop-btn:focus {
    background-color: #1a252f !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* Модальное окно */
.wc-preorder-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.wc-preorder-modal.active {
    display: block;
}

/* Оверлей */
.wc-preorder-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Контент модального окна */
.wc-preorder-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 40px;
    box-sizing: border-box;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Кнопка закрытия */
.wc-preorder-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    color: #6b7280;
    line-height: 1;
}

.wc-preorder-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Форма */
.wc-preorder-form-wrapper h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.wc-preorder-product-name {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 16px 0;
    font-weight: 500;
}

.wc-preorder-notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Поля формы */
.wc-preorder-field {
    margin-bottom: 20px;
}

.wc-preorder-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.wc-preorder-field .required {
    color: #ef4444;
}

.wc-preorder-field input[type="text"],
.wc-preorder-field input[type="tel"],
.wc-preorder-field input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.wc-preorder-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wc-preorder-field input::placeholder {
    color: #9ca3af;
}

/* Чекбокс */
.wc-preorder-checkbox {
    margin-top: 24px;
}

.wc-preorder-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 400;
    color: #4b5563;
    cursor: pointer;
}

.wc-preorder-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #2563eb;
}

/* Кнопка отправки */
.wc-preorder-submit {
    width: 100%;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #2563eb !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 24px;
}

.wc-preorder-submit:hover {
    background: #1d4ed8 !important;
}

.wc-preorder-submit:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
}

/* Экран успеха */
.wc-preorder-success {
    text-align: center;
    padding: 20px 0;
}

.wc-preorder-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    margin: 0 auto 24px;
    animation: successPop 0.4s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.wc-preorder-success h2 {
    font-size: 28px;
    color: #111827;
    margin: 0 0 16px 0;
}

.wc-preorder-success p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.wc-preorder-close-btn {
    margin-top: 24px;
    padding: 12px 32px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wc-preorder-close-btn:hover {
    background: #e5e7eb !important;
}

/* Сообщение об ошибке */
.wc-preorder-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

/* Загрузка */
.wc-preorder-loading {
    position: relative;
    pointer-events: none;
}

.wc-preorder-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Адаптивность */
@media (max-width: 540px) {
    .wc-preorder-modal-content {
        max-width: calc(100% - 32px);
        padding: 32px 24px;
        border-radius: 12px;
    }
    
    .wc-preorder-form-wrapper h2 {
        font-size: 20px;
    }
    
    .wc-preorder-success h2 {
        font-size: 24px;
    }
    
    .wc-preorder-success-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }
}
