/* Overlay và Modal container */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    justify-content: center;
    align-items: flex-start; /* Để modal không bị che nếu dài quá */
    padding-top: 50px;
    overflow-y: auto;
}

.modal-container {
    background: #fff;
    width: 600px;
    max-width: 95%;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    color: #999;
}

.close-btn:hover { color: #333; }

/* Input Styles - CHỈ áp dụng cho text, select, textarea */
.modal-container input[type="text"],
.modal-container input[type="number"],
.modal-container select,
.modal-container textarea {
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box; /* Quan trọng để không bị vỡ layout */
    outline: none;
    transition: border 0.3s;
}

.modal-container textarea {
    height: auto;
    resize: none;
}

.modal-container input:focus,
.modal-container textarea:focus {
    border-color: #337ab7; /* Màu chủ đạo của bạn */
}

/* Layout chia cột */
.form-row {
    display: flex;
    gap: 15px; /* Khoảng cách giữa các ô */
    margin-bottom: 15px;
}

.form-row.three-col .input-wrapper {
    flex: 1; /* Chia đều 3 cột */
}

.input-wrapper {
    width: 100%;
}

/* Custom Radio Button (Loại địa chỉ) */
.address-type-group {
    display: flex;
    gap: 15px;
}

.type-option {
    cursor: pointer;
    position: relative;
}

/* Ẩn input radio mặc định xấu xí */
.type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Style giả lập nút bấm */
.type-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    color: #555;
    transition: all 0.3s;
}

/* Khi radio được check */
.type-option input[type="radio"]:checked + .type-btn {
    border-color: #ee2b5b;
    color: #ee2b5b;
    background-color: #ffeaea;
    font-weight: 600;
}

/* Toggle Switch (Nút gạt mặc định) */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ee2b5b;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Footer Buttons */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.btn-cancel-custom {
    padding: 10px 25px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
}

.btn-confirm-custom {
    padding: 10px 25px;
    background: #ee2b5b; /* Đổi màu theo brand của bạn */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
}