/* css/modal.css - Стили для модального окна */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-light-gray) 100%);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(-30px);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
}

.modal-header h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

/* Секции в модальном окне */
.modal-section {
    margin-bottom: 2rem;
}

.modal-section h4 {
    color: var(--color-primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(233, 30, 99, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section h4 i {
    font-size: 1.4rem;
}

/* Детали заказа */
.order-details {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--color-gray);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    flex: 0 0 140px;
    font-weight: 600;
    color: var(--color-text-light);
}

.detail-value {
    flex: 1;
    color: var(--color-dark-graphite);
}

.detail-value.total-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-magenta);
}

/* Форма в модальном окне */
.modal-form .form-group {
    margin-bottom: 1.2rem;
}

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-primary);
    font-size: 0.95rem;
}

.modal-form input,
.modal-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--color-gray);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-form input:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--color-magenta);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.modal-form input.error,
.modal-form textarea.error {
    border-color: #f44336;
}

.modal-form .error-message {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* Кнопки в модальном окне */
.modal-footer {
    padding: 1.5rem 2rem;
    background: var(--color-light-gray);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid var(--color-gray);
}

.modal-btn {
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 43, 76, 0.3);
}

.modal-btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.modal-btn-secondary:hover {
    background: var(--color-primary);
    color: white;
}

/* Анимация для отправки */
@keyframes modalSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.modal-success {
    animation: modalSuccess 0.5s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .detail-label {
        flex: none;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 95%;
    }
    
    .modal-header {
        padding: 1rem 1.2rem;
    }
    
    .modal-body {
        padding: 1.2rem;
    }
    
    .modal-footer {
        padding: 1.2rem;
    }
}

/* Иконки (если используете Font Awesome или другие) */
.fas, .far, .fab {
    font-style: normal;
}

/* Для поддержки эмодзи как иконок */
.modal-section h4 span {
    font-size: 1.4rem;
    margin-right: 0.5rem;
}