/* Add this at the top of your CSS file */
* {
    -webkit-tap-highlight-color: transparent; /* Removes blue box on mobile tap */
}

/* =========================================
   1. FONTS & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    /* --- COLOR PALETTE --- */
    --top-bg: #ffffff;           /* White Top Bar */
    --bottom-bg: #1c2e4a;        /* Navy Blue Bottom Bar & Active Categories */
    --accent-red: #d32f2f;       /* Action Color (Buttons/Links) */
    --logo-blue: #0d47a1;        /* Corporate Blue for Text/Borders */
    --text-dark: #333333;
    --text-white: #ffffff;
    --border-light: #e0e0e0;
    --hover-grey: #f5f5f5;
    
    /* --- DIMENSIONS --- */
    --header-height-desktop: 80px;
    --header-height-mobile: 60px;
    --nav-height: 40px;
    --ticker-height: 35px;
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f4f4;
    padding-top: 120px; 
    transition: padding-top 0.3s ease;
}

body.has-ticker {
    padding-top: 155px; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.flag-icon {
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* =========================================
   3. HEADER LAYOUT (FIXED)
   ========================================= */
#header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background: #fff; 
    transform: translateZ(0);
}

/* =========================================
   4. ROW 1: MAIN
   ========================================= */
.header-main {
    background-color: var(--top-bg);
    height: var(--header-height-desktop);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 20px;
    border-bottom: 1px solid var(--border-light);
}

.logo-area {
    display: flex;
    align-items: center;
    margin-right: 20px;
    height: 100%;
}

.logo-image {
    height: 60px; 
    width: auto;
    object-fit: contain;
    display: block;
}

.header-action { margin-left: auto; }

.btn-enquiry {
    background-color: var(--accent-red);
    color: var(--text-white);
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-enquiry:hover { background-color: #b71c1c; }

/* =========================================
   5. ROW 2: NAVIGATION & MENU
   ========================================= */
.header-bottom {
    background-color: var(--bottom-bg);
    height: var(--nav-height);
    color: white;
}

.bottom-container {
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 100%;
    position: relative; 
}

.nav-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    margin-right: 25px;
    padding: 5px;
}
.nav-trigger:hover { background-color: rgba(255,255,255,0.1); }

.main-nav {
    display: flex;
    gap: 5px;
    height: 100%;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    white-space: nowrap;
    cursor: pointer;
}
.nav-link:hover { background-color: rgba(255,255,255,0.1); }

.nav-item-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.nav-item-dropdown:hover .nav-link { background-color: rgba(255,255,255,0.1); }

/* --- TABBED MEGA MENU (STABLE & SHARP) --- */

.tabbed-mega-menu {
    position: absolute;
    top: 100%;
    left: -150px; 
    width: 950px;
    min-height: 380px; 
    background: #ffffff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0;
    border: 1px solid var(--bottom-bg); 
    display: flex;
    
    /* Animation State */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* CRITICAL FIX 2: Disables mouse interaction while hidden */
    transform: translateY(5px);
    transition: all 0.2s ease;
    z-index: 100;
}

.tabbed-mega-menu.menu-sm {
    width: 700px;
    left: 0;
    min-height: 250px;
}

/* CRITICAL FIX 1: Ultra-stable invisible bridge restricted to vertical gap only */
.tabbed-mega-menu::before {
    content: '';
    position: absolute;
    top: -20px; 
    left: 0; 
    right: 0;
    height: 20px;
}

.nav-item-dropdown:hover .tabbed-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* CRITICAL FIX 2: Re-enables interaction when hovered */
    transform: translateY(0);
}

/* --- Left Sidebar (Categories) --- */
.mega-menu-tabs {
    width: 280px;
    background: #f4f7f6; 
    border-right: 1px solid #e0e0e0;
    padding: 0; 
    display: flex;
    flex-direction: column;
}

.mega-tab-item {
    list-style: none;
    width: 100%;
}

/* Category Links */
.mega-tab-link {
    display: block;
    padding: 16px 20px;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.1s ease;
    cursor: pointer;
    text-decoration: none;
    border-left: 4px solid transparent;
}

/* --- Right Side (Content Panes) --- */
.mega-tab-pane {
    position: absolute;
    top: 0;
    left: 280px; 
    width: calc(100% - 280px); 
    height: 100%;
    padding: 30px;
    background: #ffffff;
    
    /* Stops the image from bleeding out of this box */
    overflow: hidden; 
    
    /* ANTI-FLICKER DELAY */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
}

/* The Watermark Symbol (Perfectly Centered & Contained) */
.pane-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Responsive width instead of fixed height */
    width: 65%; 
    max-width: 320px; 
    height: auto;
    
    opacity: 0.08; 
    pointer-events: none; 
    z-index: 0;
}

/* === STABLE HOVER LOGIC === */

/* 1. Default State */
.mega-tab-item:first-child > .mega-tab-link {
    background-color: var(--bottom-bg); /* #1c2e4a Dark Blue */
    color: #ffffff;
    border-left: 4px solid var(--accent-red);
}
.mega-tab-item:first-child > .mega-tab-pane {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    transition: opacity 0.2s ease, visibility 0s 0s;
}

/* 2. Reset Default State when sidebar is hovered */
.mega-menu-tabs:hover .mega-tab-item:first-child > .mega-tab-link {
    background-color: transparent;
    color: #333;
    border-left: 4px solid transparent;
}
.mega-menu-tabs:hover .mega-tab-item:first-child > .mega-tab-pane {
    opacity: 0;
    visibility: hidden;
    z-index: 0;
}

/* 3. Highlight the specific hovered tab instantly */
.mega-menu-tabs .mega-tab-item:hover > .mega-tab-link {
    background-color: var(--bottom-bg) !important; /* #1c2e4a Dark Blue */
    color: #ffffff !important;
    border-left: 4px solid var(--accent-red) !important;
}
.mega-menu-tabs .mega-tab-item:hover > .mega-tab-pane {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2 !important; 
    transition: opacity 0.2s ease, visibility 0s 0s !important;
}

/* --- Content Grid Inside Panes --- */
.mega-pane-grid {
    display: grid;
    gap: 15px 20px;
    list-style: none;
    margin: 0; padding: 0;
    position: relative;
    z-index: 2; /* Keeps links above the watermark */
}

.mega-pane-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.mega-pane-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.mega-pane-grid li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #444; 
    font-size: 0.92rem;
    font-weight: 500;
    padding: 8px 10px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mega-pane-grid li a:hover {
    color: var(--bottom-bg); 
    background-color: #f0f4fa; 
    transform: translateX(4px);
}

.mega-pane-grid li a i {
    color: var(--bottom-bg); 
    font-size: 1.1rem;
}

.nav-extra { margin-left: auto; font-size: 0.85rem; font-weight: 600; }
.nav-extra a:hover { text-decoration: underline; }

/* =========================================
   6. NEWS TICKER STYLES
   ========================================= */
.news-ticker-container {
    width: 100%; 
    height: var(--ticker-height);
    background: #1F1F3D; 
    color: #fff; 
    display: flex; 
    align-items: center;
    position: relative;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ticker-label {
    background: var(--accent-red); 
    height: 100%;
    display: flex; 
    align-items: center; 
    padding: 0 20px;
    font-size: 0.8rem; 
    font-weight: 700; 
    text-transform: uppercase;
    position: relative;
    z-index: 2; 
    flex-shrink: 0;
    gap: 8px;
    color: #fff;
}

.pulse-indicator {
    position: absolute;
    top: 8px; right: 8px;
    width: 6px; height: 6px; 
    background: rgba(255, 255, 255, 0.8); 
    border-radius: 50%;
    z-index: 10;
    animation: blink 2s infinite;
}

@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

.ticker-wrapper { 
    flex: 1; overflow: hidden; position: relative; height: 100%; display: flex; align-items: center; 
}

.ticker-move { 
    display: inline-block; white-space: nowrap; padding-left: 100%; animation: ticker-scroll 60s linear infinite; 
}

.ticker-item { 
    display: inline-flex; align-items: center; font-size: 0.85rem; margin-right: 25px; cursor: pointer; color: #b0b0b0; transition: 0.2s;
}

.ticker-item:hover { color: #fff; text-decoration: underline; }

@keyframes ticker-scroll { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

@media (min-width: 901px) {
    .news-ticker-container { background: #ffffff; border-bottom: none; }
    .ticker-item { color: #1F1F3D; font-weight: 500; }
    .ticker-item:hover { color: var(--accent-red); text-decoration: underline; }
}

/* =========================================
   7. MOBILE ELEMENTS
   ========================================= */
.nav-toggle { display: none; }

/* =========================================
   8. MOBILE SIDEBAR DRAWER
   ========================================= */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1001; opacity: 0; visibility: hidden; transition: 0.3s;
}

.sidebar {
    position: fixed; top: 0; left: -320px; width: 80%; max-width: 320px; height: 100%;
    background: white; z-index: 1002; transition: 0.3s ease-out; display: flex; flex-direction: column;
}

.sidebar-header {
    background-color: var(--bottom-bg); color: white; padding: 15px;
    display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 1.1rem;
}
.close-sidebar { font-size: 1.8rem; cursor: pointer; }
.user-welcome { display: flex; align-items: center; gap: 8px; }
.sidebar-content { padding: 0; overflow-y: auto; flex: 1; }
.sidebar-group { padding-bottom: 10px; }
.sidebar-group h3 { padding: 15px 20px; font-size: 1.1rem; background-color: #fff; color: var(--text-dark); margin: 0; }
.sidebar-group ul li a { display: block; padding: 12px 20px; color: #444; font-size: 0.95rem; border-bottom: 1px solid #f0f0f0; }

.sidebar-group summary {
    list-style: none; display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; font-weight: 500; color: #444; cursor: pointer; border-bottom: 1px solid #f0f0f0;
}
.sidebar-group summary::after { content: '+'; font-size: 1.2rem; font-weight: 300; }
details[open] > summary::after { content: '-'; }

.mobile-sub-group { background-color: #f8f9fa; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.continent-details summary { padding-left: 35px; font-size: 0.9rem; font-weight: 600; color: var(--logo-blue); border-bottom: 1px solid #e0e0e0; }
.mobile-sub-list { background-color: #ffffff; padding: 0 !important; }
.mobile-sub-list li a { padding-left: 50px !important; font-size: 0.85rem; color: #555; border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; gap: 8px; }
.mobile-sub-list li a:hover { background-color: #f0f8ff; color: var(--accent-red); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* =========================================
   9. MEDIA QUERIES
   ========================================= */
@media (max-width: 900px) {
    body { padding-top: 60px; }
    body.has-ticker { padding-top: 95px; }
    .header-main { height: var(--header-height-mobile); justify-content: space-between; }
    .logo-image { height: 40px; }
    .header-bottom { display: none; }
    .nav-toggle { display: block; font-size: 1.6rem; color: var(--text-dark); cursor: pointer; }
    .btn-enquiry { padding: 8px 12px; font-size: 0.85rem; }
    .ticker-label-text { display: none; }
    .ticker-label { padding: 0 12px; }
    .pulse-indicator { display: none; }
}

/* =========================================
   10. ENQUIRY MODAL POPUP 
   ========================================= */
.enquiry-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7); z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; padding: 20px;
}
.enquiry-modal-overlay.active { opacity: 1; visibility: visible; }

.enquiry-modal {
    background: #fff; width: 100%; max-width: 850px; max-height: 95vh; border-radius: 0;
    display: flex; overflow: hidden; position: relative; transform: translateY(20px); transition: all 0.3s ease;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}
.enquiry-modal-overlay.active .enquiry-modal { transform: translateY(0); }

.enquiry-modal-close {
    position: absolute; top: 15px; right: 15px; background: #f5f5f5; color: var(--text-dark);
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; z-index: 10; transition: 0.2s;
}
.enquiry-modal-close:hover { background: var(--accent-red); color: white; }

.enquiry-modal-image { flex: 0 0 40%; position: relative; background-color: var(--logo-blue); }
.enquiry-modal-image img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.enquiry-modal-image::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.9)); z-index: 1;
}

.image-overlay-text {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 30px;
    display: flex; flex-direction: column; justify-content: center; color: white; z-index: 2; box-sizing: border-box;
}

.badge-premium {
    background-color: #ffd54f; color: #1c2e4a; padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px;
}
.image-overlay-text h3 { margin-bottom: 4px; font-size: 1.4rem; }
.image-overlay-text p { margin-bottom: 10px; font-size: 0.85rem; line-height: 1.3; color: #e0e0e0; }

.consultant-stats {
    display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0; padding: 10px 12px; margin: 10px 0; backdrop-filter: blur(4px);
}
.stat-item h4 { font-size: 1rem; color: #fff; margin-bottom: 0; }
.stat-item span { font-size: 0.65rem; text-transform: uppercase; color: #e0e0e0; letter-spacing: 0.5px; }
.stat-item.divider { height: 30px; width: 1px; background: rgba(255, 255, 255, 0.2); }

.modal-contact-info { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.contact-item { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; line-height: 1.4; }
.contact-item i { font-size: 1.1rem; color: #ffd54f; margin-top: 2px; }
.branch-list strong { font-weight: 600; color: #fff; display: inline-block; margin-bottom: 2px; }

.enquiry-modal-form-container { flex: 1; padding: 20px 30px; background: #fff; }
.enquiry-modal-form-container h2 { color: var(--logo-blue); font-size: 1.4rem; margin-bottom: 2px; }
.enquiry-modal-form-container p { color: #666; font-size: 0.85rem; margin-bottom: 12px; }

.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.form-group .required { color: var(--accent-red); }

.form-group input, .form-group textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: 0;
    font-family: inherit; font-size: 0.9rem; transition: 0.2s; background: #fcfcfc;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--logo-blue); background: #fff; box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.btn-submit-enquiry {
    background-color: var(--accent-red); color: white; border: none; padding: 10px 20px;
    width: 100%; border-radius: 0; font-size: 1rem; font-weight: 600; cursor: pointer; display: flex;
    justify-content: center; align-items: center; gap: 8px; transition: background 0.2s; margin-top: 5px;
}
.btn-submit-enquiry:hover { background-color: #b71c1c; }

@media (max-width: 768px) {
    .enquiry-modal { flex-direction: column; overflow-y: auto; }
    .enquiry-modal-image { flex: none; min-height: 400px; }
    .enquiry-modal-form-container { padding: 25px 20px; }
    .form-row { flex-direction: column; gap: 0; }
}

.enquiry-modal-overlay.forced .enquiry-modal-close { display: none !important; }