﻿/* ========================================== */
/* STYLING CHO MODAL POPUP                    */
/* ========================================== */

/* Nền làm mờ toàn màn hình */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 16px;
    box-sizing: border-box;
}

/* Kích hoạt hiển thị modal */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Khung nội dung Form */
.modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 28px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

/* Nút đóng */
.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 26px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #0f172a;
}

/* Tiêu đề Modal */
.modal-header h2 {
    margin: 0 0 6px 0;
    font-size: 1.35rem;
    color: #1e293b;
    font-weight: 700;
}

.modal-header p {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* Hộp tóm tắt sản phẩm */
.order-summary-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-label {
    color: #64748b;
}

.summary-value.highlight {
    font-weight: 600;
    color: #1e293b;
}

.summary-value.price {
    font-weight: 700;
    color: #0284c7;
    font-size: 1.05rem;
}

/* Các trường nhập liệu */
.form-group {
    margin-bottom: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-group .required {
    color: #ef4444;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Thông báo trạng thái */
.modal-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    text-align: center;
}

.modal-alert.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.modal-alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Nút bấm hành động */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 10px 18px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-submit {
    padding: 10px 22px;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background: #0369a1;
}

.btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}
