:root {
    --school-red: #f3d528; /* สีแดงหลัก */
    --school-dark-red: #9a0000;
}

.school-header {
    background-color: var(--school-red);
    color: #393636;
    padding: 12px 0;
    font-family: 'Prompt', sans-serif;
}

.header-main-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Left Section */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 250px;
}
.header-left img {
    height: 65px;
    width: auto;
}
.brand-text .main-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}
.brand-text .sub-title {
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

/* Center Section */
.header-center {
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    max-width: 600px;
}
.search-box {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}
.search-box input {
    width: 100%;
    padding: 8px 45px 8px 20px;
    border-radius: 25px;
    border: none;
    outline: none;
    font-size: 0.9rem;
}
.search-box button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
}
.header-nav {
    display: flex;
    gap: 30px;
}
.header-nav .nav-link {
    color: #393636;
    text-decoration: none;
    font-weight: 500;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}


/* Right Section */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 220px;
}
.top-settings {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 8px;
    gap: 10px;
}
.lang-switcher .active {
    font-weight: bold;
}

/* Button Login (Pill Style) */
.btn-login-pill {
    background-color: #ffffff;
    color: var(--school-red) !important;
    border-radius: 50px;
    padding: 6px 28px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-login-pill:hover {
    background-color: #f2f2f2;
    transform: translateY(-1px);
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: #4cd964; }
input:checked + .slider:before { transform: translateX(14px); }

/* Hamburger for Mobile */
.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
}
/* =========================
   Mobile Responsive
   ========================= */
@media (max-width: 991px) {

    .header-main-wrapper {
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    /* Left */
    .header-left {
        min-width: auto;
        gap: 10px;
    }

    .header-left img {
        height: 50px;
    }

    .brand-text .main-title {
        font-size: 1.1rem;
    }

    .brand-text .sub-title {
        font-size: 0.85rem;
    }

    /* Center (menu) */
    .header-center {
        display: none !important;
    }

    /* Right */
    .header-right {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        min-width: auto;
    }

    .top-settings {
        display: none; /* ซ่อนโหมดกลางคืน + ภาษาในมือถือ */
    }

    .btn-login-pill {
        padding: 6px 18px;
        font-size: 0.9rem;
    }

    /* Hamburger */
    .hamburger-btn {
        border: none;
        background: none;
        padding: 6px;
    }
}

/* =========================
   Mobile Dropdown Menu
   ========================= */
.main-nav {
    display: none;
    width: 100%;
    background-color: var(--school-red);
    padding: 10px 0;
}

.main-nav.active {
    display: block;
}

.main-nav a {
    display: block;
    padding: 10px 20px;
    color: #393636;
    text-decoration: none;
    font-weight: 500;
}
