/**
 * Header Styles - 1:1 Figma Design Match
 *
 * @package Ivanchovandpartners
 */

/* =============================================
   Skip Link - Hidden until focused
   ============================================= */
.skip-link {
    position: absolute;
    left: -9999px;
    top: -9999px;
    z-index: 9999;
    padding: 15px 25px;
    background-color: #1e40af;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
}

/* =============================================
   Site Header - Full Width with Responsive Padding
   ============================================= */
.site-header {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 128px;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    top: 0px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* =============================================
   Logo - Figma Specs: 292.75px x 81px
   ============================================= */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    width: 292.748px;
    height: 81px;
}

.site-logo img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Logo icon box style (fallback) */
.site-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #2563eb;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.site-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.site-header.scrolled .site-logo-text {
    color: #1e293b;
}

/* =============================================
   Header Nav Container - Glassmorphism
   Figma: 1253px x 81px on 1920px screen
   ============================================= */
.header-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    max-width: 1253px;
    height: 81px;
    padding: 0 32px;
    border-radius: 12px;
    border: 1px solid rgba(246, 246, 246, 0.20);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(17.5px);
    -webkit-backdrop-filter: blur(17.5px);
    transition: all 0.3s ease;
}

.site-header.scrolled .header-nav-container {
    background: rgb(255 255 255 / 0%);
    box-shadow: 0px 0px 0px #00000000;
    border-color: rgb(0 0 0 / 0%);
}

/* =============================================
   Main Navigation
   ============================================= */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.site-header.scrolled .nav-menu > li > .nav-link {
    color: #1e293b;
}

/* Active/Hover underline */
.nav-menu > li > .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #f59e0b;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-menu > li > .nav-link:hover::after,
.nav-menu > li.current-menu-item > .nav-link::after,
.nav-menu > li > .nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-menu > li > .nav-link:hover,
.nav-menu > li.current-menu-item > .nav-link {
    color: #f59e0b;
}

/* Dropdown indicator */
.nav-link .dropdown-icon {
    width: 12px;
    height: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.nav-menu > li:hover > .nav-link .dropdown-icon {
    transform: rotate(180deg);
}

/* =============================================
   Dropdown Menu
   ============================================= */
.sub-menu {
    position: absolute;
    top: 100%;
    left: -15px;
    min-width: 220px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(8px);
}

.sub-menu li {
    margin: 0;
}

.sub-menu .nav-link {
    display: block;
    padding: 12px 16px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sub-menu .nav-link::after {
    display: none;
}

.sub-menu .nav-link:hover {
    background-color: #f1f5f9;
    color: #2563eb;
}

/* =============================================
   Header Actions (Right side)
   ============================================= */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Vertical divider before phone */
.header-actions::before {
    content: '';
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    margin-right: 8px;
}

.site-header.scrolled .header-actions::before {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Phone */
.header-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-header.scrolled .header-phone {
    color: #1e293b;
}

.header-phone:hover {
    color: #f59e0b;
}

.header-phone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.header-phone-icon svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.site-header.scrolled .header-phone-icon {
    background-color: #f1f5f9;
}

.site-header.scrolled .header-phone-icon svg {
    color: #2563eb;
}

.header-phone:hover .header-phone-icon {
    background-color: rgba(255, 255, 255, 0.25);
}

.site-header.scrolled .header-phone:hover .header-phone-icon {
    background-color: #e2e8f0;
}

.header-phone-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.header-phone-label {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.8;
}

.header-phone-number {
    font-size: 18px;
    font-weight: 500;
}

/* CTA Button */
.header-cta {
    display: inline-flex;
    align-items: center;
    padding: 16px 24px;
    background-color: #2563eb;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 40px;
    border: none;
    transition: all 0.3s ease;
}

.header-cta:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* User icon */
.header-user {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    transition: all 0.2s ease;
}

.site-header.scrolled .header-user {
    background-color: #f1f5f9;
    color: #64748b;
}

.header-user:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.site-header.scrolled .header-user:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.header-user .icon {
    width: 18px;
    height: 18px;
}

/* =============================================
   Mobile Menu Toggle
   ============================================= */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.site-header.scrolled .menu-toggle-bar {
    background-color: #1e293b;
}

.menu-toggle-bar:nth-child(1) {
    transform: translateY(-6px);
}

.menu-toggle-bar:nth-child(3) {
    transform: translateY(6px);
}

/* Active state - X */
.menu-toggle.active .menu-toggle-bar:nth-child(1) {
    transform: translateY(0) rotate(45deg);
}

.menu-toggle.active .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-toggle-bar:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
}

/* =============================================
   Mobile Navigation
   ============================================= */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    padding: 100px 30px 40px;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu > li > .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mobile-nav-menu > li > .nav-link:hover,
.mobile-nav-menu > li > .nav-link.active,
.mobile-nav-menu > li.current-menu-item > .nav-link {
    background-color: #f1f5f9;
    color: #2563eb;
}

.mobile-nav-menu > li > .nav-link::after {
    display: none;
}

.mobile-nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0 0 0 20px;
    margin-top: 5px;
    display: none;
    background: transparent;
}

.mobile-nav-menu .sub-menu.active {
    display: block;
}

.mobile-nav-menu .sub-menu .nav-link {
    padding: 12px 15px;
    font-size: 16px;
}

/* Mobile Nav Actions */
.mobile-nav-actions {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
}

.mobile-nav-phone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.mobile-nav-phone .icon {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.mobile-nav-cta {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    background-color: #2563eb;
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.mobile-nav-cta:hover {
    background-color: #1d4ed8;
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Body scroll lock */
body.menu-open {
    overflow: hidden;
}

/* =============================================
   Responsive Header
   ============================================= */

/* 1920px+ - Full specs */
@media (min-width: 1920px) {
    .site-header {
        padding: 0 128px;
    }

    .header-nav-container {
        max-width: 1253px;
        height: 81px;
    }
}

/* 1400px - 1919px */
@media (min-width: 1400px) and (max-width: 1919px) {
    .site-header {
        padding: 0 100px;
    }

    .header-nav-container {
        max-width: calc(100% - 320px); /* Logo + gap */
        height: 81px;
    }
}

/* 1200px - 1399px */
@media (max-width: 1399px) {
    .site-header {
        top: 24px;
        padding: 0 64px;
    }

    .site-logo {
        width: 240px;
        height: 70px;
    }

    .header-nav-container {
        height: 70px;
        padding: 0 24px;
    }

    .nav-menu {
        gap: 20px;
    }
}

/* 992px - 1199px */
@media (max-width: 1199px) {
    .site-header {
        top: 20px;
        padding: 0 32px;
    }

    .site-logo {
        width: 200px;
        height: 60px;
    }

    .site-logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .site-logo-text {
        font-size: 16px;
    }

    .header-nav-container {
        height: 60px;
        padding: 0 20px;
    }

    .nav-menu {
        gap: 16px;
    }

    .nav-menu > li > .nav-link {
        font-size: 16px;
    }

    .header-phone span {
        display: none;
    }

    .header-actions::before {
        display: none;
    }

    .header-cta {
        padding: 10px 18px;
        font-size: 16px;
    }
}

/* Tablet - 768px - 991px */
@media (max-width: 991px) {
    .site-header {
        top: 16px;
        padding: 0 24px;
    }

    .site-logo {
        width: 180px;
        height: 50px;
    }

    .header-nav-container {
        display: none;
    }

    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    .mobile-nav-overlay {
        display: block;
    }

    .header-phone {
        display: none;
    }

    .header-user {
        display: none;
    }

    .header-actions::before {
        display: none;
    }
}

/* Mobile - 575px and below */
@media (max-width: 575px) {
    .site-header {
        top: 12px;
        padding: 0 16px;
    }

    .site-logo {
        width: 160px;
        height: 45px;
    }

    .site-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 11px;
        border-radius: 6px;
    }

    .site-logo-text {
        font-size: 16px;
    }

    .header-cta {
        padding: 8px 14px;
        font-size: 16px;
    }
}

/* =============================================
   Inner Page Header - Dark text on light background
   ============================================= */
.site-header.inner-page-header {
    top: 0;
    background: #f5f5f5;
    padding-top: 16px;
    padding-bottom: 16px;
}

.site-header.inner-page-header .site-logo-text {
    color: #1e293b;
}

.site-header.inner-page-header .nav-menu > li > .nav-link {
    color: #1e293b;
}

.site-header.inner-page-header .nav-menu > li > .nav-link:hover,
.site-header.inner-page-header .nav-menu > li.current-menu-item > .nav-link {
    color: #2563eb;
}

.site-header.inner-page-header .header-nav-container {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-header.inner-page-header .header-phone {
    color: #1e293b;
}

.site-header.inner-page-header .header-phone-icon {
    background-color: #e2e8f0;
}

.site-header.inner-page-header .header-phone-icon svg {
    color: #2563eb;
}

.site-header.inner-page-header .header-user {
    background-color: #e2e8f0;
    color: #64748b;
}

.site-header.inner-page-header .header-user:hover {
    background-color: #cbd5e1;
    color: #1e293b;
}

.site-header.inner-page-header .header-actions::before {
    background-color: rgba(0, 0, 0, 0.1);
}

.site-header.inner-page-header .menu-toggle-bar {
    background-color: #1e293b;
}

/* Inner page header when scrolled */
.site-header.inner-page-header.scrolled {
    background: rgba(245, 245, 245, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.site-header.inner-page-header.scrolled .header-nav-container {
    background: transparent;
    box-shadow: none;
    border-color: transparent;
}

/* Show scrolled logo by default on inner pages if available */
.site-header.inner-page-header .site-logo .logo-default {
    display: none;
}

.site-header.inner-page-header .site-logo .logo-scrolled {
    display: block;
}

/* If no scrolled logo, show default */
.site-header.inner-page-header .site-logo:not(:has(.logo-scrolled)) .logo-default {
    display: block;
}

/* =============================================
   Logo Switching on Scroll
   ============================================= */
.site-logo .logo-default {
    display: block;
    transition: opacity 0.3s ease;
}

.site-logo .logo-scrolled {
    display: none;
    transition: opacity 0.3s ease;
}

/* When header is scrolled, swap logos */
.site-header.scrolled .site-logo .logo-default {
    display: none;
}

.site-header.scrolled .site-logo .logo-scrolled {
    display: block;
}
