/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary: #004899;       /* Deep Royal Blue */
    --primary-dark: #003673;  /* Darker shade for hover */
    --accent: #FFC107;       /* Amber/Yellow for highlights */
    --text-main: #333333;
    --text-muted: #666666;
    --text-white: #ffffff;
    --bg-light: #f4f5f7;
    --border-color: #e0e0e0;
    --shadow-main: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --container-width: 1200px;
    --font-heading: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Import generic fonts if not already in main css (using system fallback for speed if not present) */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600;700&family=Sarabun:wght@400;500&display=swap');

* { box-sizing: border-box; }

/* =========================================
   2. TOP BAR (WHITE SECTION)
   ========================================= */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: #ffffff; /* Ensure background is solid behind both parts */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.navbar-top-section {
    background-color: #ffffff;
    padding: 10px 0; /* Reduced padding for compact stickiness */
    font-family: var(--font-heading);
    border-bottom: 1px solid #f0f0f0;
}

.navbar-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* 2.1 Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 200px;
}
.brand-logo img {
    height: 55px; /* Bigger logo */
    width: auto;
    display: block;
}
.brand-info h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
    font-weight: 700;
    line-height: 1;
}
.brand-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 2.2 Search Bar (Modern & Wide) */
.search-wrapper {
    flex-grow: 1;
    max-width: 600px;
    position: relative;
    z-index: 1050; /* Ensure autocomplete stays on top */
}

.search-input-group {
    display: flex;
    align-items: center;
    border: 2px solid var(--primary); /* Blue Border */
    border-radius: 8px; /* Rounded corners */
    overflow: hidden;
    height: 46px;
    transition: box-shadow 0.2s;
}
.search-input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(0, 72, 153, 0.15);
}

.search-input-group input {
    flex: 1;
    border: none;
    padding: 0 15px;
    font-size: 1rem;
    height: 100%;
    outline: none;
    font-family: var(--font-body);
    color: var(--text-main);
}

.search-btn {
    background: var(--primary);
    border: none;
    color: white;
    width: 50px;
    height: 100%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.search-btn:hover {
    background: var(--primary-dark);
}

/* Search Suggestions Dropdown */
.search-results {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-main);
    display: none;
}
.search-results.active {
    display: block;
}
.search-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-main);
    transition: background 0.1s;
}
.search-item:hover {
    background-color: var(--bg-light);
    color: var(--primary);
}
.search-item:last-child {
    border-bottom: none;
}

/* 2.3 User Actions & Contact */
.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.contact-box {
    text-align: right;
    display: none; /* Hidden on very small screens, shown later */
    line-height: 1.3;
}
@media (min-width: 992px) {
    .contact-box { display: block; }
}

.contact-box .phone {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.contact-box .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.4rem;
    transition: all 0.2s;
}
.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* =========================================
   3. MENU BAR (BLUE SECTION)
   ========================================= */
.navbar-menu-section {
    background-color: var(--primary);
    color: white;
    height: 46px; /* Slightly thinner */
    /* Remove sticky from here since parent is sticky */
    position: relative; 
    z-index: 1000;
}

.menu-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
}

/* 3.1 All Categories Button */
.category-dropdown {
    position: relative;
    height: 100%;
    width: 220px;
    flex-shrink: 0;
}

.cat-btn {
    background: rgba(0,0,0,0.1); /* Slightly darker blue */
    height: 100%;
    width: 100%;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.cat-btn:hover {
    background: rgba(0,0,0,0.2);
}
.cat-btn i.arrow { margin-left: auto; font-size: 1.2rem; }

/* Dropdown Content */
.cat-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: var(--shadow-main);
    border-radius: 0 0 8px 8px;
    padding: 5px 0;
    display: none; /* Hidden by default */
    transform-origin: top;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; transform: scaleY(0.9); }
    to { opacity: 1; transform: scaleY(1); }
}

/* Show on Hover */
.category-dropdown:hover .cat-menu {
    display: block;
}

.cat-menu a {
    display: block;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid #f5f5f5;
    transition: 0.2s;
}
.cat-menu a:last-child { border-bottom: none; }
.cat-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary);
    padding-left: 20px; /* Slight slide effect */
}

/* 3.2 Main Navigation Links */
.main-nav-links {
    display: flex;
    margin-left: 20px;
    height: 100%;
    overflow: visible; /* Changed from overflow-x: auto to allow dropdowns */
}
.main-nav-links::-webkit-scrollbar { display: none; }

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-heading);
    height: 100%;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.05);
}
/* Active Indicator (Yellow Line) */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent);
    transition: width 0.3s;
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* =========================================
   4. MOBILE HEADER
   ========================================= */
.mobile-header {
    display: none; /* Hidden on Desktop */
    background: white;
    padding: 10px 15px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1100;
    height: 60px;
}

.mobile-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 0;
}

.mobile-logo img {
    height: 32px;
    width: auto;
}

.mobile-actions {
    display: flex;
    gap: 15px;
}
.mobile-icon {
    font-size: 22px;
    color: var(--text-main);
    text-decoration: none;
}

/* Mobile Drawer (Side Menu) */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1190;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}
.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.mobile-drawer.active {
    transform: translateX(280px);
}

.drawer-head {
    background: var(--primary);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-head h3 { margin: 0; font-size: 1.1rem; font-weight: 600;color: #fff; }
.drawer-close { background: none; border: none; color: white; font-size: 24px; }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}
.drawer-link {
    display: block;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
}
.drawer-link:hover {
    background: #f9f9f9;
    color: var(--primary);
}
.drawer-link i { width: 25px; color: var(--text-muted); }

/* =========================================
   5. RESPONSIVE QUERIES
   ========================================= */
@media screen and (max-width: 991px) {
    body {
        overflow-x: hidden;
    }

    .navbar-top-section, .navbar-menu-section {
        display: none; /* Hide Desktop Header */
    }
    .mobile-header {
        display: flex; /* Show Mobile Header */
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1100;
    }
}
