/* Стили для модального окна заказа - Climat-OD */

/* Импорт переменных */
@import url('variables.css');

/* Дополнительные стили для лучшего отображения */
.order-modal * {
    box-sizing: border-box;
}

.order-modal {
    font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* Модальное окно */
.order-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.order-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.order-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    width: 100%;
    max-height: 95vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Заголовок модального окна */
.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.order-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.order-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.order-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Тело модального окна */
.order-modal-body {
    padding: 0 24px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.order-modal-body::-webkit-scrollbar {
    width: 6px;
}

.order-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.order-modal-body::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

.order-modal-body::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Информация о товаре */
.order-product-info {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.order-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.order-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
}

/* Форма заказа */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

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

.form-group label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-group input,
.form-group textarea {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Чекбокс установки */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    padding: 8px 0;
}

.checkbox-custom {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    background: #3b82f6;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-label input[type="checkbox"]:not(:checked) + .checkbox-custom {
    background: white;
    border-color: #d1d5db;
}

.checkbox-label input[type="checkbox"]:not(:checked) + .checkbox-custom::after {
    opacity: 0;
}

.installation-info {
    margin-top: 8px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
    display: none;
}

.installation-price {
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 4px;
}

.installation-description {
    font-size: 12px;
    color: #0c4a6e;
}

/* Итоговая сумма */
.order-total {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-top: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    padding: 4px 0;
}

.total-line:last-child {
    margin-bottom: 0;
}

.total-final {
    border-top: 2px solid #e2e8f0;
    padding-top: 16px;
    margin-top: 16px;
    font-size: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 8px;
    padding: 16px;
    margin: 16px -4px 0 -4px;
}

.total-amount {
    color: #059669;
    font-weight: 700;
    font-size: 20px;
}

/* Подвал модального окна */
.order-modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
    flex-shrink: 0;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    flex: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

/* Уведомление об успехе */
.order-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.order-success-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #d1fae5;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-message {
    font-size: 14px;
    color: #065f46;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 640px) {
    .order-modal {
        padding: 8px 8px 20px 8px;
        align-items: flex-end;
    }
    
    .order-modal-content {
        max-height: 90vh;
        max-width: 100%;
        border-radius: 20px;
        margin-top: auto;
        margin-bottom: 0;
        animation: modalSlideUp 0.3s ease-out;
        display: flex;
        flex-direction: column;
    }
    
    @keyframes modalSlideUp {
        from {
            transform: translateY(calc(100% + 20px));
        }
        to {
            transform: translateY(0);
        }
    }
    
    .order-modal-header {
        padding: 16px 20px 12px 20px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .order-modal-title {
        font-size: 18px;
    }
    
    .order-modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .order-modal-body {
        padding: 0 20px 8px 20px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .order-modal-footer {
        padding: 12px 20px 16px 20px;
        flex-direction: column;
        gap: 10px;
        border-top: 1px solid #e5e7eb;
        background: #f8fafc;
        align-items: center;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 12px;
        text-align: center;
    }
    
    /* Информация о товаре */
    .order-product-info {
        padding: 16px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .order-product-name {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .order-product-price {
        font-size: 18px;
    }
    
    /* Поля формы */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
    }
    
    .form-group textarea {
        min-height: 100px;
    }
    
    /* Чекбокс */
    .checkbox-label {
        font-size: 16px;
        padding: 12px;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
    }
    
    .installation-info {
        margin-top: 12px;
        padding: 12px;
        background: #e0f2fe;
        border-radius: 8px;
    }
    
    .installation-price {
        font-size: 16px;
        font-weight: 600;
    }
    
    /* Итоговая сумма */
    .order-total {
        padding: 16px;
        margin-top: 16px;
        border-radius: 12px;
    }
    
    .total-line {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .total-final {
        font-size: 16px;
        padding: 12px;
        margin: 12px -4px 0 -4px;
    }
    
    .total-amount {
        font-size: 18px;
    }
    
    .order-success-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification-content {
        max-width: none;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .order-modal {
        padding: 4px 4px 16px 4px;
    }
    
    .order-modal-content {
        max-height: 88vh;
        border-radius: 16px;
        margin-bottom: 0;
    }
    
    .order-modal-header {
        padding: 16px 16px 12px 16px;
    }
    
    .order-modal-title {
        font-size: 16px;
    }
    
    .order-modal-body {
        padding: 0 16px 6px 16px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .order-modal-footer {
        padding: 10px 16px 12px 16px;
        align-items: center;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        gap: 8px;
    }
    
    .btn {
        max-width: 260px;
    }
    
    .order-product-info {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 14px;
        font-size: 16px;
    }
    
    .checkbox-label {
        padding: 10px;
        font-size: 15px;
    }
    
    .order-total {
        padding: 12px;
    }
    
    .total-final {
        padding: 10px;
        font-size: 15px;
    }
    
    .total-amount {
        font-size: 17px;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-width: 640px) and (orientation: landscape) {
    .order-modal-content {
        max-height: 100vh;
        border-radius: 12px;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    
    .order-modal-body {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .order-modal-footer {
        padding: 12px 20px;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
    }
}

/* Анимации */
.order-modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Стили для загрузки */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Стили для кнопки "Купить" в каталоге */
.buy-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.buy-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Анимация пульсации для привлечения внимания */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
}

.buy-btn {
    animation: pulse 2s infinite;
}

.buy-btn:hover {
    animation: none;
}
