:root {
    --header-height: 70px;
    --logo-width: 150px;
    --mobile-header-height: 60px;
}

.site-header * {
    box-sizing: border-box;
}

body {
    padding-top: var(--header-height);
}

@media (max-width: 1024px) {
    body {
        padding-top: var(--mobile-header-height);
    }
}

body.home,
body.page-template-front-page {
    padding-top: 0 !important;
}

.site-header {
    background: #ffffff; /* Default: White */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, top 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.admin-bar .site-header {
    top: 32px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- LOGO TEXT STYLING (New) --- */
.header-logo {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
    text-decoration: none;
}

.site-title-text {
    font-family: var(--font-secondary);
    font-weight: 900; /* Extra Bold */
    font-size: 26px;
    color: #000000; /* Default Black (Light Background) */
    text-transform: uppercase;
    letter-spacing: -1.3px;
    text-decoration: none;
    transition: color 0.4s ease;
    display: flex;
    align-items: center;
}

.brand-star {
    color: #ff2a55; /* Always Pink */
    margin: 0 3px;
    font-size: 28px;
    position: relative;
    top: -1px;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.site-title-text:hover .brand-star {
    color: #ffda00;
    transform: rotate(360deg) scale(1.3);
    text-shadow: 0 0 15px rgba(255, 218, 0, 0.8);
}

.header-search-wrap {
    flex: 1;
    max-width: 800px;
    margin: 0 20px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #007cba;
    outline: none;
}

.header-nav-trigger {
    flex-shrink: 0;
}

.menu-toggle-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    padding: 0 15px;
    border-radius: 8px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333 !important;
}

.menu-toggle-btn svg {
    fill: #333 !important;
}

.menu-toggle-btn:hover {
    background: #f5f5f5;
}

.mobile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: var(--mobile-header-height, 60px);
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background-color 0.4s ease, box-shadow 0.4s ease, top 0.3s ease, transform 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.admin-bar .mobile-top-bar {
    top: 46px;
}

@media (min-width: 783px) {
    .admin-bar .mobile-top-bar {
        top: 32px;
    }
}

.mobile-top-bar .menu-toggle-btn {
    color: #333 !important;
    border: none;
}

.mobile-top-bar .menu-toggle-btn svg {
    fill: #333 !important;
}

.mobile-search-bar-wrap {
    background: #ffffff;
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    right: 0;
    z-index: 999;
    padding: 10px 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-150%);
    transition: transform 0.3s ease, top 0.3s ease;
    visibility: hidden;
}

.admin-bar .mobile-search-bar-wrap {
    top: calc(var(--mobile-header-height) + 46px);
}

@media (min-width: 783px) {
    .admin-bar .mobile-search-bar-wrap {
        top: calc(var(--mobile-header-height) + 32px);
    }
}

.live-search-results {
    position: absolute;
    top: 100%;
    background: #fff;
    margin-top: 10px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid #eee;
    display: none;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

@media (min-width: 1025px) {
    .live-search-results {
        width: 100%;
        left: 0;
    }
}

@media (max-width: 1024px) {
    .live-search-results {
        left: 0;
        right: 0;
        width: 100%;
        position: relative;
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
}

.search-result-item:hover {
    background: #fafafa;
}

.search-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: cover;
}

.search-meta h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.search-meta p {
    margin: 0;
    font-size: 11px;
    color: #777;
}

.search-badge {
    margin-left: auto;
    font-size: 10px;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: block;
    }
}

/* ============================================================
   TRANSPARENT HEADER LOGIC (DARK MODE HEADER)
   Activated by JS when on Hero Section
   ============================================================ */

body.header-is-transparent .site-header,
body.header-is-transparent .mobile-top-bar {
    background-color: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Logo turns WHITE */
body.header-is-transparent .site-title-text {
    color: #ffffff !important;
}

/* Search Input Transparent */
body.header-is-transparent .header-search-wrap .search-input {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
}

body.header-is-transparent .search-input::placeholder {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Menu Button turns WHITE */
body.header-is-transparent .menu-toggle-btn {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

body.header-is-transparent .menu-toggle-btn svg {
    fill: #ffffff !important;
}

/* Mobile Swap Logic (Hidden Header) */
.mobile-top-bar.mobile-header-hidden {
    transform: translateY(-100%);
}

/* Mobile Search Bar (Sticky) Styles */
body.header-is-transparent .mobile-search-bar-wrap {
    background-color: rgba(0, 0, 0, 0.6) !important; /* Dark on Hero */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.header-is-transparent .mobile-search-bar-wrap .search-input {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.mobile-search-bar-wrap {
    background-color: #ffffff;
}

.mobile-search-bar-wrap.is-visible {
    transform: translateY(0);
    visibility: visible;
    top: 0 !important;
}

.admin-bar .mobile-search-bar-wrap.is-visible {
    top: 46px !important;
}

@media (min-width: 783px) {
    .admin-bar .mobile-search-bar-wrap.is-visible {
        top: 32px !important;
    }
}

/* ============================================================
   FIX: MOBILE HEADER OVERFLOW (SINGLE PAGE FIX)
   ============================================================ */

/* Force Header to stay inside screen */
.mobile-header-container,
.mobile-top-bar,
.mobile-search-bar-wrap {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Search Input Fix */
.mobile-search-bar-wrap .search-input {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* Ensure Logo and Button stay inside */
.mobile-top-bar {
    padding-right: 15px !important;
    padding-left: 15px !important;
}