/* ------------------------------------------------------------
   Header Global Styles
   - ฟอนต์และพื้นหลัง
------------------------------------------------------------ */
body {
    font-family: 'Anuphan', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
}

/* ------------------------------------------------------------
   Header Container & Top Bar
   - โครงสร้างหลักของส่วนหัวและแถบบนสุด
------------------------------------------------------------ */
.main-header {
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.top-nav-bar {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.header-logo {
    height: 200px;
    width: auto;
}

/* ------------------------------------------------------------
   Navigation (Desktop + Shared)
------------------------------------------------------------ */
.navbar-nav .nav-link {
    font-weight: bold;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgb(200, 166, 0);
}

.navbar-nav .nav-item.dropdown .dropdown-menu {
    border: none;
}

.navbar-nav .nav-item.dropdown .dropdown-item {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar-nav .nav-item.dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

nav { padding: 10px 20px; }

ul.navbar {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.nav-item { position: relative; }

.nav-link {
    text-decoration: none;
    color: #333;
    cursor: pointer;
    padding: 8px 12px;
    display: inline-block;
}

.nav-link:hover {
    background-color: #e2e6ea;
    border-radius: 5px;
}

/* ------------------------------------------------------------
   Dropdown & Mega Menu
------------------------------------------------------------ */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    width: 200px;
    z-index: 999;
    left: 50%;
    transform: translateX(-50%);
}

.dropdown-menu a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
}

.dropdown-menu a:hover { background-color: #f1f1f1; }

.nav-item .mega-menu {
    display: none;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 0;
    margin-left: -20rem;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    padding: 20px;
    display: flex;
    gap: 40px;
    width: 50vw;
    box-sizing: border-box;
    transform: none;
}

.nav-item:hover .mega-menu { display: flex; opacity: 1; visibility: visible; }

.nav-item .nav-link i.fa-chevron-down { transition: transform 0.3s ease; }
.nav-item:hover .nav-link i.fa-chevron-down { transform: rotate(180deg); }

.mega-menu .column { flex: 1; padding: 0 15px; }
.mega-menu .column h3 { font-size: 1.1em; margin: 0 0 10px; color: #333; }
.mega-menu .column ul { list-style: none; padding: 0; margin: 0; }
.mega-menu .column ul li { margin-bottom: 8px; }
.mega-menu .column ul li a { padding: 5px 0; font-size: 0.95em; color: #555; text-decoration: none; }
.mega-menu .column ul li a:hover { color: #adaa00ff; background-color: transparent; }
.dropdown.show .mega-menu { display: flex; }

/* ------------------------------------------------------------
   Search Bar
------------------------------------------------------------ */
.search-input {
    border-radius: 50px;
    padding-left: 40px;
    border: 1px solid #ddd;
    background-color: #f1f1f1;
    height: 40px;
}
.search-input::placeholder { color: #aaa; }
.search-icon { position: absolute; top: 50%; transform: translateY(-50%); color: #acacacff; margin-left: 1rem; }

/* ------------------------------------------------------------
   Right Icons
------------------------------------------------------------ */
.header-icon-link { color: #333; font-size: 1.5rem; text-decoration: none; transition: color 0.3s ease; }
.header-icon-link:hover { color: #007bff; }
.header-icon { color: #aaa; }

/* ------------------------------------------------------------
   Contact Buttons Section
------------------------------------------------------------ */
.contact-buttons-section { background-color: #fff; padding-bottom: 20px !important; }
.btn-line { background-color: #00c300; color: #fff; border-radius: 5px; padding: 8px 15px; font-weight: bold; text-decoration: none; transition: background-color 0.3s ease; font-size: 0.9rem; }
.btn-line:hover { background-color: #009900; color: #fff; }
.btn-whatsapp { background-color: #00b944; color: #fff; padding: 8px 15px; font-weight: bold; text-decoration: none; transition: background-color 0.3s ease; font-size: 0.9rem; }
.btn-whatsapp:hover { background-color: #1da851; color: #fff; }
.btn-phone { background-color: #5cb85c; color: #fff; padding: 8px 15px; font-weight: bold; text-decoration: none; transition: background-color 0.3s ease; font-size: 0.9rem; }
.btn-phone:hover { background-color: #4cae4c; color: #fff; }

/* ------------------------------------------------------------
   Account/Login Box
------------------------------------------------------------ */
.account-wrapper { position: relative; display: inline-block; }
#account-container { display: flex; align-items: center; gap: 8px; cursor: pointer; }
#account-container i { font-size: 20px; }
.login-box { position: absolute; top: 100%; right: 0; background: #fff; width: 240px; padding: 15px; text-align: center; box-shadow: 0 4px 8px rgba(0,0,0,0.1); border-radius: 8px; margin-top: 8px; z-index: 1000; display: none; }
.login-box.show { display: block; }
.login-box h2, .login-box h3 { font-size: 1.2rem; font-weight: 700; color: #333; margin-bottom: 12px; }
.login-box .login-button { background: #007bff; color: #fff; border: none; border-radius: 6px; padding: 10px 15px; font-size: 1rem; cursor: pointer; width: 100%; margin-bottom: 12px; }
.login-box .login-button:hover { background: #0056b3; }
.login-box .signup-link { display: inline-block; margin-top: 8px; font-weight: 600; color: #007bff; text-decoration: none; }
.login-box .signup-link:hover { text-decoration: underline; }
.login-box .no-account { font-size: 0.9rem; color: #666; }
.logout-link { text-decoration: none; color: #dc3545; font-weight: bold; }
.logout-link:hover { text-decoration: underline; }

/* Mobile (account/login) */
@media (max-width: 576px) {
    #account-container span { font-size: 14px; font-weight: 600; }
    .login-box { position: fixed; top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: none; border-radius: 16px 16px 0 0; padding: 20px; text-align: center; box-shadow: 0 -4px 12px rgba(0,0,0,0.15); animation: slideUp 0.3s ease-out; }
    .login-box h2, .login-box h3 { font-size: 1rem; }
    .login-box .login-button { font-size: 0.95rem; padding: 10px; }
}

@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ------------------------------------------------------------
   Mobile Overlay Menu
------------------------------------------------------------ */
.mobile-overlay-menu { position: fixed; top: 0; left: 0; width: 100vw; height: 100%; background-color: #fff; z-index: 1000; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease-in-out; overflow-y: auto; padding: 20px; box-sizing: border-box; }
.mobile-overlay-menu.active { transform: translateX(0); }
.mobile-overlay-header { display: flex; justify-content: flex-end; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.close-menu-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #333; }
.close-menu-btn:hover { color: #adaa00ff; }
.mobile-overlay-menu .nav-item .mega-menu { position: static; display: none; opacity: 1; visibility: visible; box-shadow: none; padding: 10px 0 10px 20px; gap: 0; flex-direction: column; }
.mobile-overlay-menu .nav-item.active .mega-menu { display: flex; }
.mobile-overlay-menu .mega-menu .column { margin-bottom: 15px; }
.mobile-overlay-menu .mega-menu .column h3 { margin-bottom: 5px; cursor: pointer; }
.mobile-overlay-menu .mega-menu .column ul { margin-left: 10px; }

/* ------------------------------------------------------------
   Responsive Rules
------------------------------------------------------------ */
@media (max-width: 991.98px) {
    #desktop-nav { display: none !important; }
    .navbar-toggler.d-lg-none { display: block !important; }
    .top-nav-bar { flex-wrap: nowrap !important; justify-content: space-between !important; align-items: center !important; gap: 12px; padding-left: 10px; padding-right: 10px; }
    .search-input { font-size: 12px; padding: 6px 8px; }
    .header-logo { order: 2; max-width: 120px; height: auto; }
    .d-flex.align-items-center.gap-3 { order: 3; margin-left: 0; margin-right: 0; gap: 5px; }
    .contact-buttons-section { justify-content: center !important; flex-wrap: nowrap !important; gap: 6px; }
    .contact-buttons-section .btn { flex-shrink: 1; max-width: 120px; font-size: 10px; padding: 4px 8px; }
    .main-heading, .tagline { text-align: center; margin-left: 0; }
}

@media (min-width: 992px) {
    .navbar-toggler.d-lg-none { display: none !important; }
    #mobile-menu-overlay { display: none !important; }
    #desktop-nav { display: block !important; }
    #desktop-nav .nav-item:hover .mega-menu { display: flex; opacity: 1; visibility: visible; }
}

@media (max-width: 576px) { .nav-item .mega-menu { margin-left: 0rem; } }

/* ------------------------------------------------------------
   Floating Action Buttons (FAB)
------------------------------------------------------------ */
@media (max-width: 768px) {
    #floatingContainer { bottom: 100px !important; right: 42px !important; z-index: 9999; }
    #floatingContainer .social-button { width: 44px !important; height: 44px !important; margin-bottom: 5rem; margin-right: 1.6rem !important; }
    #floatingContainer .social-button img { width: 20px !important; height: 20px !important; }
    #mainButton { width: 52px !important; height: 52px !important; }
    #mainButton img { width: 24px !important; height: 24px !important; }
    #closeIcon { font-size: 24px !important; }
}

/* ------------------------------------------------------------
   Hero Heading (under header)
------------------------------------------------------------ */
main.container { margin: 0 0 0 4%; height: 9rem; }
main.container h1 { font-size: 4rem; color: #333; text-align: left; margin-bottom: 1rem; }
@media (max-width: 768px) { main.container h1 { margin-bottom: 3rem; } }

/* Contact buttons section spacing overrides */
.contact-buttons-section { margin-top: -50px; }
@media (max-width: 991.98px) {
    main.container { width: 90vw; padding-top: 20px !important; margin-left: 33px !important; }
    main.container h1 { font-size: 1.7rem !important; }
    main.container p { font-size: 0.8rem !important; margin-left: 2px !important; margin-right: 10% !important; margin-top: -20px !important; }
    .contact-buttons-section { margin-top: -10px; margin-bottom: -20px; }
    .btn-whatsapp { font-size: 0.3rem; }
}


