/* ============================================================
   HEADER LAYOUT — Two-row with logo spanning full height
   Loaded last in every page — overrides page-specific CSS
   ============================================================ */

/* ── Reset page-level header padding ── */
header {
    padding: 0 !important;
}
header.scrolled {
    padding: 0 !important;
}

/* ── Outer wrapper: logo LEFT | rows RIGHT ── */
.header-container {
    display: flex !important;
    align-items: stretch !important;   /* logo fills the full header height */
    justify-content: space-between !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    gap: 1.5rem;
}

/* ── Logo — big, centered vertically, never shrinks ── */
.logo {
    display: flex !important;
    align-items: center !important;
    align-self: stretch !important;    /* stretches to full header height */
    flex-shrink: 0 !important;
    padding: 0.5rem 0;
}
.logo img {
    height: 70px !important;           /* tall enough to cover both rows */
    width: auto !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    display: block !important;
    transition: height 0.3s ease;
}
header.scrolled .logo img {
    height: 58px !important;           /* slightly smaller when scrolled */
}

/* ── Right side: stacked rows ── */
.header-rows {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* ─── TOP ROW: Contact Us + Search + EN/FIL ─── */
.header-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;         /* push everything to the right */
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: none;
    transition: border-color 0.3s ease;
}
header.scrolled .header-top-row {
    border-bottom: none;
}

/* Contact Us — pushed to the RIGHT, beside search */
.top-bar-contact {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    transition: color 0.25s ease;
}
.top-bar-contact i {
    font-size: 0.75rem;
    opacity: 0.85;
}
.top-bar-contact:hover { color: #00b4d8; }

header.scrolled .top-bar-contact { color: #475569; }
header.scrolled .top-bar-contact:hover { color: #00509d; }

/* Right cluster inside top row: search + lang toggle */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

/* ─── BOTTOM ROW: Nav links ─── */
.header-bottom-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.35rem 0;
}

/* ── Override old header .container layout ── */
header .container {
    display: flex !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ============================================================
   SEARCH BAR (LIQUID GLASS)
   ============================================================ */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-wrap {
    display: flex;
    align-items: center;
    padding: 5px 12px;
    gap: 6px;
    width: 180px;
    border-radius: 50px;
    
    /* Gradient background for dynamic light reflection */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%);
    
    /* Enhanced Liquid Glass optics */
    backdrop-filter: blur(16px) saturate(120%) brightness(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(120%) brightness(1.1);
    
    /* A thinner, more delicate outer border */
    border: 1px solid rgba(255, 255, 255, 0.3);
    
    /* Layered shadows: inset for the glossy rim, outer for depth */
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.7), 
        inset 0 -1px 1px rgba(255, 255, 255, 0.1), 
        0 6px 12px rgba(0, 0, 0, 0.1); 
        
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search-wrap:focus-within {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(255, 255, 255, 0.15), /* Outer glow ring */
        0 10px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.02); /* Slight scale up for tactile feedback */
}

header.scrolled .header-search-wrap {
    /* Switching to the LWD blue tones for the scrolled state */
    background: linear-gradient(135deg, rgba(0, 80, 157, 0.08) 0%, rgba(0, 80, 157, 0.02) 100%);
    border-color: rgba(0, 80, 157, 0.2);
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        0 4px 12px rgba(0, 80, 157, 0.05);
}

header.scrolled .header-search-wrap:focus-within {
    background: linear-gradient(135deg, rgba(0, 80, 157, 0.12) 0%, rgba(0, 80, 157, 0.04) 100%);
    border-color: var(--primary); 
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 1),
        0 0 0 3px rgba(0, 80, 157, 0.12),
        0 8px 16px rgba(0, 80, 157, 0.1);
    transform: scale(1.02);
}

.header-search-icon {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    flex-shrink: 0;
    pointer-events: none;
}
header.scrolled .header-search-icon { color: #00296b; }

.header-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #fff;
    width: 100%;
    min-width: 0;
}
.header-search-input::-webkit-search-cancel-button,
.header-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    display: none;
}
.header-search-input::placeholder { color: rgba(255, 255, 255, 0.65); }
header.scrolled .header-search-input { color: #1a1a2e; }
header.scrolled .header-search-input::placeholder { color: #9aaabb; }

.header-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    padding: 0;
    display: none;
    flex-shrink: 0;
    transition: color 0.2s;
}
header.scrolled .header-search-clear { color: #7a8a9a; }
.header-search-clear:hover { color: #fff; }
header.scrolled .header-search-clear:hover { color: #00296b; }
.header-search-clear.visible { display: flex; }

/* ============================================================
   LANGUAGE TOGGLE — fixed width, never stretches header
   ============================================================ */
.global-lang-toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.lang-toggle-checkbox { display: none; }

.lang-toggle-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 68px !important;    /* fixed — EN vs FIL never changes size */
    height: 28px !important;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0 4px;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}
header.scrolled .lang-toggle-label,
header.menu-open .lang-toggle-label {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.lang-toggle-label span:not(.lang-slider) {
    z-index: 1;
    font-size: 0.68rem;
    font-weight: 700;
    width: 50%;
    text-align: center;
    transition: color 0.2s;
    user-select: none;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
}
header.scrolled .lang-toggle-label span:not(.lang-slider),
header.menu-open .lang-toggle-label span:not(.lang-slider) {
    color: #64748b;
}
.lang-toggle-checkbox:not(:checked) + .lang-toggle-label .lang-en,
.lang-toggle-checkbox:checked + .lang-toggle-label .lang-fil {
    color: #fff !important;
}

.lang-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 22px;
    background-color: #00b4d8;
    border-radius: 50px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.lang-toggle-checkbox:checked + .lang-toggle-label .lang-slider {
    transform: translateX(30px);
}

/* Fade animation */
.fade-text { animation: fadeInText 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes fadeInText {
    0%   { opacity: 0; transform: translateY(3px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1150px) {
    .header-search-wrap { width: 150px; }
    .logo img { height: 62px !important; }
    header.scrolled .logo img { height: 52px !important; }
}

@media (max-width: 992px) {
    .header-search { display: none; }
    .logo img { height: 54px !important; }
    header.scrolled .logo img { height: 46px !important; }
}

@media (max-width: 600px) {
    .top-bar-contact span { display: none; }  /* icon only */
    .logo img { height: 46px !important; }
}

/* ============================================================
   SEARCH NOT FOUND TOAST
   ============================================================ */
.search-not-found-toast {
    position: fixed;
    top: 90px;
    right: 20px;
    background: #1e293b;
    color: #f8fafc;
    border-left: 4px solid #f59e0b;
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 999999;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.search-not-found-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.search-not-found-toast i {
    color: #f59e0b;
    font-size: 1.1rem;
}