/* ================================================
   MODERN NAVBAR STYLES - Trat Polytechnic College
   Version: 2.0
   Design: Premium, Dark Theme with Gradient Accents
   ================================================ */

/* ===============================================
   CSS VARIABLES - Color Scheme
   =============================================== */
:root {
    /* Primary Colors */
    --nav-primary: #8B0000;
    --nav-primary-dark: #5a0004;
    --nav-primary-light: #a80008;

    /* Accent Colors */
    --nav-accent: #FFD700;
    --nav-accent-light: #FFE44D;
    --nav-accent-glow: rgba(255, 215, 0, 0.3);

    /* Gradient Colors */
    --nav-gradient-start: #dc3545;
    --nav-gradient-middle: #ff6b35;
    --nav-gradient-end: #ffa366;

    /* Neutral Colors */
    --nav-white: #ffffff;
    --nav-light: #f8f9fa;
    --nav-gray: #6c757d;
    --nav-dark: #212529;

    /* Effects */
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --nav-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --nav-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --nav-transition-fast: all 0.2s ease;
}

/* ===============================================
   SITE HEADER - Main Container
   =============================================== */
.site-header {
    position: relative;
    z-index: 1000;
    font-family: 'Kanit', sans-serif;
}

/* Z-index hierarchy:
   - site-header: 1000 (base)
   - main-navbar: 1010
   - dropdown-panel: 1020
   - navbar-menu (mobile): 1050
   - mobile-menu-close: 1060
   - overlay (body::before): 999
*/

/* ===============================================
   TOP BAR - Contact & Social Links
   =============================================== */
.header-top-bar {
    background-color: var(--nav-dark);
    background-image:
        linear-gradient(135deg, rgba(60, 60, 60, 0.9) 0%, rgba(30, 30, 30, 0.9) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255, 255, 255, 0.05) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255, 255, 255, 0.05) 20px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    background-position: center;
    padding: 8px 0;
    transition: var(--nav-transition);
    position: relative;
    overflow: hidden;
}

.header-top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    animation: shimmer 8s infinite linear;
}

@keyframes shimmer {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

.header-top-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 300;
}

/* Animated Slogan */
.animated-slogan {
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0.9) 20%,
            #FFD700 50%,
            rgba(255, 255, 255, 0.9) 80%);
    background-size: 200% auto;
    color: #fff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
    animation: shineText 3s linear infinite;
    display: inline-block;
}

@keyframes shineText {
    to {
        background-position: 200% center;
    }
}

.top-bar-item i {
    color: var(--nav-accent);
    font-size: 14px;
}

.top-bar-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-link {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: var(--nav-transition);
    text-decoration: none;
}

.social-link:hover {
    background: var(--nav-accent);
    color: var(--nav-primary-dark);
    transform: translateY(-3px) scale(1.1) rotate(360deg);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

/* ===============================================
   BRAND SECTION - Logo & Title
   =============================================== */
.header-brand-section {
    background: linear-gradient(180deg,
            var(--nav-white) 0%,
            #f8f9fa 50%,
            #fff5f5 100%);
    padding: 30px 0;
    position: relative;
    overflow: hidden;
}

.header-brand-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
            var(--nav-gradient-start),
            var(--nav-gradient-middle),
            var(--nav-gradient-end),
            var(--nav-gradient-middle),
            var(--nav-gradient-start));
    background-size: 200% 100%;
    animation: gradientFlow 4s ease infinite;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 0%;
    }
}

.brand-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none !important;
    transition: var(--nav-transition);
}

.brand-logo-link:hover {
    transform: translateY(-2px);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-container {
    position: relative;
}

.logo-img {
    max-height: 80px !important;
    width: auto;
    transition: var(--nav-transition);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(220, 53, 69, 0.2));
}

.logo-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 50px;
}

.divider-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(180deg,
            transparent,
            var(--nav-gradient-start),
            var(--nav-gradient-middle));
    border-radius: 1px;
}

.divider-line:last-child {
    background: linear-gradient(180deg,
            var(--nav-gradient-middle),
            var(--nav-gradient-start),
            transparent);
}

.divider-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--nav-gradient-start), var(--nav-gradient-middle));
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
}

.tpt-logo {
    max-height: 75px !important;
}

.brand-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name-th {
    font-size: 25px !important;
    font-weight: 500;
    margin: 0;
    background: linear-gradient(135deg,
            var(--nav-primary) 0%,
            var(--nav-gradient-start) 50%,
            var(--nav-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.brand-name-en {
    font-size: 15px !important;
    font-weight: 300;
    color: var(--nav-gray);
    margin: 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* Header Contact Cards */
.header-contact-cards {
    display: flex;
    gap: 25px;
}

.contact-card-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background: transparent;
    transition: var(--nav-transition);
}

.contact-card-item:hover {
    transform: translateY(-2px);
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--nav-gradient-start), var(--nav-gradient-middle));
    border-radius: 50%;
    color: var(--nav-white);
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    transition: var(--nav-transition);
}

.contact-icon.phone {
    background: linear-gradient(135deg, var(--nav-gradient-middle), var(--nav-gradient-end));
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.contact-card-item:hover .contact-icon {
    transform: scale(1.1) rotate(5deg);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-label {
    font-size: 15px;
    font-weight: 400;
    color: var(--nav-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--nav-dark);
}

/* ===============================================
   MAIN NAVBAR
   =============================================== */
.main-navbar {
    background: linear-gradient(135deg,
            #8B0000 0%,
            #720006 30%,
            #5a0004 70%,
            #3d0003 100%);
    padding: 0;
    position: relative;
    z-index: 1010;
    box-shadow: var(--nav-shadow);
    transition: var(--nav-transition);
}

.main-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            transparent);
    pointer-events: none;
}

.main-navbar.navbar-scrolled {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: var(--nav-shadow-lg);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Mobile Brand (shown when scrolled) */
/* Mobile Brand (shown when scrolled) - Now also used for Desktop Scroll Sticky */
.navbar-brand-mobile {
    display: flex;
    align-items: center;
    padding: 8px 0;
    margin-right: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    transition: var(--nav-transition);
    width: 0;
    overflow: hidden;
}

.navbar-brand-mobile img {
    height: 45px;
    width: auto;
}

.navbar-brand-mobile.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    width: auto;
    overflow: visible;
}

/* Mobile Toggle Button */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--nav-transition);
}

.navbar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.toggle-line {
    width: 22px;
    height: 2px;
    background: var(--nav-white);
    border-radius: 2px;
    transition: var(--nav-transition);
}

.navbar-toggle:hover .toggle-line {
    background: var(--nav-accent);
}

.toggle-line:nth-child(2) {
    margin: 5px 0;
}

.navbar-toggle.active .toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.navbar-toggle.active .toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation Menu */
.navbar-menu {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Nav Items */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
    transition: var(--nav-transition);
    position: relative;
    cursor: pointer;
}

.nav-link i:first-child {
    font-size: 14px;
    opacity: 0.8;
    transition: var(--nav-transition);
}

.nav-link:hover i:first-child {
    opacity: 1;
    color: var(--nav-accent);
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: var(--nav-transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 3px;
    background: linear-gradient(90deg,
            var(--nav-gradient-start),
            var(--nav-gradient-middle),
            var(--nav-gradient-end));
    border-radius: 3px;
    transition: var(--nav-transition);
}

.nav-link:hover::after,
.nav-link.active::after,
.nav-item.has-dropdown:hover .nav-link::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--nav-white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: var(--nav-accent);
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Highlight Nav Item (CTA) */
.nav-item.highlight .nav-link {
    background: linear-gradient(135deg,
            rgba(255, 215, 0, 0.15),
            rgba(255, 215, 0, 0.08));
    border-radius: 8px;
    margin: 0 5px;
    position: relative;
}

.nav-item.highlight .nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    animation: borderPulse 2s infinite;
}

@keyframes borderPulse {

    0%,
    100% {
        border-color: rgba(255, 215, 0, 0.3);
    }

    50% {
        border-color: rgba(255, 215, 0, 0.6);
    }
}

.badge-new {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, var(--nav-accent), #FFA500);
    color: var(--nav-primary-dark);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    animation: badgeBounce 2s infinite;
}

@keyframes badgeBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ===============================================
   DROPDOWN PANEL
   =============================================== */
.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: var(--nav-white);
    border-radius: 16px;
    box-shadow: var(--nav-shadow-lg), 0 0 0 1px rgba(220, 53, 69, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--nav-transition);
    z-index: 1020;
    overflow: hidden;
}

.dropdown-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
            var(--nav-gradient-start),
            var(--nav-gradient-middle),
            var(--nav-gradient-end));
}

/* Hover effect เฉพาะ device ที่รองรับ hover จริงๆ (ไม่ใช่ touch) */
@media (hover: hover) and (pointer: fine) {
    .has-dropdown:hover .dropdown-panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* สำหรับ click/tap toggle (ทุก device) */
.has-dropdown.dropdown-open .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-inner {
    padding: 12px 0;
}

.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-list.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    min-width: 400px;
}

.dropdown-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--nav-dark);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
    transition: var(--nav-transition);
    position: relative;
}

.dropdown-list li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--nav-gradient-start), var(--nav-gradient-middle));
    transform: scaleY(0);
    transition: var(--nav-transition);
}

.dropdown-list li a:hover {
    background: linear-gradient(90deg,
            rgba(220, 53, 69, 0.08),
            transparent);
    color: var(--nav-gradient-start);
    padding-left: 28px;
}

.dropdown-list li a:hover::before {
    transform: scaleY(1);
}

.dropdown-list li a i {
    width: 20px;
    color: var(--nav-gradient-start);
    opacity: 0.7;
    transition: var(--nav-transition);
}

.dropdown-list li a:hover i {
    opacity: 1;
    transform: scale(1.15);
}

.dropdown-list li a.active {
    background: linear-gradient(90deg,
            rgba(220, 53, 69, 0.1),
            transparent);
    color: var(--nav-gradient-start);
}

.dropdown-list li a.active::before {
    transform: scaleY(1);
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(220, 53, 69, 0.15),
            transparent);
    margin: 8px 20px;
}

/* ===============================================
   MEGA MENU
   =============================================== */
.mega-menu {
    min-width: 550px;
    left: 0;
    transform: translateY(10px);
}

.has-dropdown:hover .mega-menu {
    transform: translateY(0);
}

.mega-menu .dropdown-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 20px;
}

.mega-menu-column {
    padding: 0 15px;
    border-right: 1px solid rgba(220, 53, 69, 0.08);
}

.mega-menu-column:last-child {
    border-right: none;
}

.mega-menu-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--nav-primary);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--nav-gradient-start), transparent) 1;
}

.mega-menu-title i {
    color: var(--nav-gradient-start);
}

.mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--nav-dark);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none !important;
    border-radius: 8px;
    transition: var(--nav-transition);
}

.mega-menu-list li a i {
    width: 18px;
    color: var(--nav-gradient-start);
    opacity: 0.6;
    font-size: 13px;
    transition: var(--nav-transition);
}

.mega-menu-list li a:hover {
    background: linear-gradient(90deg,
            rgba(220, 53, 69, 0.08),
            transparent);
    color: var(--nav-gradient-start);
    transform: translateX(5px);
}

.mega-menu-list li a:hover i {
    opacity: 1;
    color: var(--nav-gradient-middle);
}

.mega-menu-list li a.active {
    background: rgba(220, 53, 69, 0.08);
    color: var(--nav-gradient-start);
}

/* ===============================================
   RESPONSIVE STYLES
   =============================================== */

/* Large Desktop (1600px+) */
@media (min-width: 1600px) {
    .nav-link {
        font-size: 15px;
        padding: 20px 18px;
    }

    .brand-name-th {
        font-size: 32px;
    }

    .logo-img {
        max-height: 90px;
    }
}

/* Desktop (1200px - 1600px) */
@media (max-width: 1599.98px) and (min-width: 1200px) {
    .nav-link {
        font-size: 14px;
        padding: 16px 12px;
    }

    .dropdown-panel {
        min-width: 250px;
    }

    .mega-menu {
        min-width: 650px;
    }
}

/* ===== Mobile Menu Close Button Styles ===== */
.mobile-menu-close {
    display: none !important;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1060;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Small Desktop / Large Tablet (992px - 1200px) */
@media (max-width: 1199.98px) {

    /* ซ่อน brand section บน mobile เพราะจะแสดง logo ใน navbar แทน */
    .header-brand-section {
        display: none;
    }

    /* ทำให้ navbar fixed บน mobile */
    .main-navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 10px 0;
    }

    /* Mobile Spacer - สร้าง space ใต้ navbar fixed */
    .navbar-mobile-spacer {
        display: block !important;
        height: 65px;
        height: calc(65px + env(safe-area-inset-top, 0px));
        width: 100%;
        visibility: hidden;
        pointer-events: none;
    }

    /* แสดงปุ่ม close บน mobile */
    .mobile-menu-close {
        display: flex !important;
    }

    .header-top-bar {
        display: none;
    }

    .navbar-toggle {
        display: flex !important;
        position: relative;
        z-index: 1002;
    }

    .navbar-brand-mobile {
        display: flex;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        width: auto !important;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: 100%;
        height: 100dvh;
        background: linear-gradient(180deg,
                #8B0000 0%,
                #720006 40%,
                #5a0004 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 70px 0 30px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* ใช้ transform แทน right เพื่อซ่อนได้สมบูรณ์ */
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.35s ease-in-out, visibility 0.35s ease-in-out;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
        z-index: 1050;
    }

    /* แสดง close button บน mobile */
    .mobile-menu-close {
        display: flex !important;
    }

    .navbar-menu.active {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link {
        padding: 16px 25px;
        justify-content: flex-start;
    }

    .nav-link::after {
        display: none;
    }

    .dropdown-arrow {
        margin-left: auto;
    }

    .dropdown-panel {
        position: static;
        opacity: 0;
        visibility: hidden;
        transform: none;
        max-height: 0;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 0;
        box-shadow: none;
        /* ปิดเร็ว: 0.15s */
        transition: max-height 0.15s ease-out, opacity 0.15s ease-out, visibility 0.15s ease-out;
    }

    .dropdown-panel::before {
        display: none;
    }

    /* เมื่อ dropdown เปิด */
    .has-dropdown.dropdown-open>.dropdown-panel {
        visibility: visible;
        opacity: 1;
        max-height: 800px;
        /* ลดลงเพื่อให้ animation เร็วขึ้น */
        /* เปิดช้ากว่า: 0.3s */
        transition: max-height 0.3s ease-in, opacity 0.2s ease-in, visibility 0.2s ease-in;
    }

    .has-dropdown.dropdown-open>.nav-link .dropdown-arrow {
        transform: rotate(180deg);
    }



    .dropdown-list li a {
        color: rgba(255, 255, 255, 0.9);
        padding: 12px 40px;
    }

    .dropdown-list li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--nav-accent);
        padding-left: 50px;
    }

    .dropdown-list li a::before {
        display: none;
    }

    .dropdown-list li a i {
        color: var(--nav-accent);
    }

    .dropdown-list.two-columns {
        grid-template-columns: 1fr;
        min-width: 100%;
    }

    .mega-menu {
        min-width: 100%;
        left: 0;
        transform: none;
    }

    .mega-menu .dropdown-inner {
        grid-template-columns: 1fr;
        padding: 15px 0;
    }

    .mega-menu-column {
        padding: 10px 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mega-menu-column:last-child {
        border-bottom: none;
    }

    .mega-menu-title {
        color: var(--nav-accent);
        padding: 0 25px 10px;
        border-image: none;
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }

    .mega-menu-title i {
        color: var(--nav-accent);
    }

    .mega-menu-list li a {
        color: rgba(255, 255, 255, 0.85);
        padding: 10px 40px;
    }

    .mega-menu-list li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--nav-accent);
    }

    .mega-menu-list li a i {
        color: var(--nav-accent);
        opacity: 0.7;
    }

    .nav-item.highlight .nav-link {
        background: linear-gradient(135deg,
                rgba(255, 215, 0, 0.2),
                rgba(255, 215, 0, 0.1));
        margin: 5px 15px;
        border-radius: 10px;
    }

    .badge-new {
        position: static;
        margin-left: auto;
    }

    /* Brand Section - Mobile */
    .header-brand-section {
        padding: 15px 0;
    }

    .brand-wrapper {
        justify-content: center;
    }

    .logo-img {
        max-height: 60px;
    }

    .tpt-logo {
        max-height: 55px;
    }

    .brand-name-th {
        font-size: 20px;
    }

    .brand-name-en {
        font-size: 13px;
    }

    .brand-tagline {
        display: none;
    }

    .header-contact-cards {
        display: none !important;
    }
}

/* Mobile (576px - 768px) */
@media (max-width: 767.98px) {
    .navbar-menu {
        width: 100%;
        max-width: 100%;
        /* ไม่ต้องใช้ right เพราะใช้ transform แล้ว */
    }

    .logo-img {
        max-height: 55px;
    }

    .tpt-logo {
        max-height: 50px;
    }

    .logo-divider {
        height: 45px;
    }

    .brand-name-th {
        font-size: 18px;
    }

    .brand-name-en {
        font-size: 12px;
    }

    .brand-logo-link {
        gap: 12px;
    }

    .logo-group {
        gap: 10px;
    }
}

/* Small Mobile (< 576px) */
@media (max-width: 575.98px) {
    .header-brand-section {
        padding: 12px 0;
    }

    .logo-img {
        max-height: 50px;
    }

    .tpt-logo {
        max-height: 45px;
    }

    .logo-divider {
        height: 40px;
        gap: 2px;
    }

    .divider-dot {
        width: 6px;
        height: 6px;
    }

    .brand-name-th {
        font-size: 16px;
    }

    .brand-name-en {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .brand-text-group {
        gap: 1px;
    }

    .nav-link {
        padding: 14px 20px;
        font-size: 14px;
    }

    .dropdown-list li a {
        padding: 10px 35px;
        font-size: 14px;
    }

    .mega-menu-list li a {
        padding: 8px 35px;
        font-size: 14px;
    }
}

/* Body overflow when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Overlay when mobile menu is open */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}