/* Phần Header (Thanh điều hướng) */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10%;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-red);
    text-decoration: none;
    line-height: 1.2;
}

.logo span {
    color: var(--dark-gray);
    font-size: 13px;
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Căn chỉnh kích thước hình ảnh logo */
.logo img {
    max-height: 60px;
    width: auto;
    display: block;
    margin-bottom: 5px;
}

.nav-links a {
    margin: 0 15px;
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-red);
}

.btn-call {
    background: var(--primary-red);
    color: white;
    padding: 10px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-call:hover {
    background: #992d22;
}

/* =========================================
   CẤU HÌNH NÚT HAMBURGER (MẶC ĐỊNH ẨN TRÊN PC)
   ========================================= */
.hamburger {
    display: none;
    /* Ẩn trên máy tính */
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    /* Khoảng cách giữa 3 thanh gạch ngang */
    padding: 5px;
    z-index: 100;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #333;
    /* Màu đen thanh lịch cho 3 gạch */
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    /* Tạo chuyển động mượt mà */
}

/* =========================================
   XỬ LÝ ĐÁP ỨNG RESPONSIVE TRÊN MOBILE
   ========================================= */
@media (max-width: 900px) {
    header {
        justify-content: space-between;
        flex-wrap: wrap;
        /* Cho phép các phần tử con rớt dòng khi menu mở rộng */
        padding: 15px 20px;
        height: auto;
    }

    .logo {
        order: 1;
        /* Cố định vị trí Logo luôn ở hàng đầu bên trái */
    }

    .hamburger {
        display: flex;
        /* Hiện nút Hamburger ở hàng đầu bên phải */
        order: 2;
    }

    /* ẨN TOÀN BỘ MENU CHỮ VÀ NÚT LIÊN HỆ KHI CHƯA BẤM MỞ */
    .nav-links,
    .action-buttons {
        display: none !important;
        width: 100%;
    }

    /* =========================================
       GIAO DIỆN KHI MENU ĐƯỢC BẤM KÍCH HOẠT (.menu-active)
       ========================================= */

    /* 1. Đổ menu chữ thành hàng dọc thông thoáng */
    header.menu-active .nav-links {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        margin-top: 25px;
        order: 3;
        /* Nằm ở dòng thứ 2 */
    }

    header.menu-active .nav-links a {
        font-size: 16px;
        font-weight: 600;
        width: 100%;
        text-align: center;
        padding: 8px 0;
    }

    /* 2. Đổ khối 3 nút liên hệ thành hàng dọc nằm dưới cùng */
    header.menu-active .action-buttons {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
        margin-bottom: 10px;
        order: 4;
        /* Nằm ở dòng thứ 3 dưới cùng */
    }

    header.menu-active .action-buttons a {
        width: 100%;
        max-width: 300px;
        /* Khống chế bề rộng nút nằm giữa màn hình mobile */
        margin: 0 auto;
        padding: 12px !important;
        font-size: 14px !important;
        text-align: center;
        box-sizing: border-box;
    }

    /* =========================================
       HIỆU ỨNG BIẾN ĐỔI NÚT HAMBURGER THÀNH DẤU X
       ========================================= */
    /* Thanh gạch số 1 xoay chéo xuống */
    header.menu-active .hamburger span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background-color: var(--primary-red);
        /* Đổi sang màu đỏ tạo điểm nhấn biệt lập */
    }

    /* Thanh gạch số 2 ở giữa ẩn biến mất */
    header.menu-active .hamburger span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    /* Thanh gạch số 3 dưới cùng xoay chéo ngược lên */
    header.menu-active .hamburger span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: var(--primary-red);
    }
}