/* ===================================
   ATAX HEADER BLOCK STYLES
   =================================== */

/* Container overflow fix for dropdown menus */
.container, .container-wide, .wp-block-group.alignwide, .wp-block-group.alignfull {
    overflow: visible !important;
}

.atax-header-wrapper {
    width: 100%;
    background: #fff;
    position: relative;
    overflow: visible;
    z-index: 99;
}

/* ===================================
   TOP YELLOW BANNER
   =================================== */

.atax-header-banner {
    background: #FFC845;
    padding: 8px 0;
    font-size: 16px; /* Desktop default */
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.atax-header-banner .atax-header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px; /* Main container controls side padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.atax-header-banner-center {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.atax-header-banner-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.atax-header-banner-text {
    color: #354477;
    line-height: 1.4;
    margin: 0;
    font-size: 14px;
}

.atax-header-banner-link {
    color: #354477;
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.3s ease;
}

.atax-header-banner-link:hover {
    color: #2a3659;
}

.atax-header-banner-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===================================
   MAIN HEADER CONTAINER
   =================================== */

.atax-header-main {
    background: #fff;
    overflow: visible; /* Allow dropdowns to extend beyond header */
}

.atax-header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 20px 0px 20px; /* 5px top, 10px right, 15px bottom, 20px left */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: visible; /* Allow dropdowns to extend beyond container */
}

.atax-header-search {
    order: 2;
    margin-left: auto;
}

.atax-header-hamburger {
    order: 3;
}

/* ===================================
   LOGO SECTION
   =================================== */

.atax-header-logo {
    flex: 0 0 auto;
}

.atax-header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.atax-header-logo-image {
    width: 151px;
    height: auto;
    object-fit: contain;
}

/* ===================================
   DESKTOP CONTACT SECTION
   =================================== */

.atax-header-contact-desktop {
    flex: 0 0 auto;
    order: 2;
}

.atax-header-contact-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.atax-header-contact-text {
    font-size: 14px;
    font-weight: 500;
    color: #354477;
    font-family: 'Montserrat', sans-serif;
    max-width: 180px;
    margin: 0;
    text-align: right;
}

.atax-header-phone-btn .atax-button-icon {
    width: 19px;
    height: 19px;
    margin-right: 8px;
}

/* ===================================
   SEARCH INPUT
   =================================== */

.atax-header-search {
    flex: 0 0 auto;
    display: block; /* Show by default */
}

.atax-search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 20px;
    width: 280px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.atax-search-container:focus-within {
    border-color: #10A1DC;
    box-shadow: 0 0 0 2px rgba(16, 161, 220, 0.2);
}

.atax-search-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    flex-shrink: 0;
    color: #666;
    display: block;
}

.atax-search-input {
    border: none;
    outline: none;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    background: transparent;
    flex: 1;
    color: #333;
}

.atax-search-input::placeholder {
    color: #999;
    font-size: 14px;
}

/* ===================================
   HAMBURGER MENU
   =================================== */

.atax-header-hamburger {
    flex: 0 0 auto;
    display: none; /* Hidden by default, shown on tablet/mobile */
    margin-left: 20px;
}

.atax-header-hamburger-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.atax-header-hamburger-btn:hover {
    opacity: 0.7;
}

.atax-header-hamburger-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* ===================================
   DESKTOP NAVIGATION
   =================================== */

.atax-header-navigation-desktop {
    background: #fff;
    display: block; /* Show by default */
}

.atax-header-nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px; /* Main container controls side padding */
    overflow: visible; /* Allow dropdowns to extend beyond nav container */
}

.atax-header-nav .wp-block-navigation__container {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 40px;
    justify-content: flex-end;
}

.atax-header-nav .wp-block-navigation-item {
    position: relative;
}

.atax-header-nav .wp-block-navigation-item__content {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
}

.atax-header-nav .wp-block-navigation-item__label {
    color: #354477; /* Primary blue color for all navigation text */
    overflow-wrap: break-word;
}

.atax-header-nav .wp-block-navigation-item__content:hover .wp-block-navigation-item__label {
    color: #2a3659; /* Slightly darker blue on hover */
}

/* Active menu item underline */
.atax-header-nav .wp-block-navigation-item__content.active {
    text-decoration: underline;
    text-decoration-color: #354477;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* Focus indicators for accessibility */
.atax-header-nav .wp-block-navigation-item__content:focus {
    outline: none;
    box-shadow: 0 0 0 1px #fff;;
    border-radius: 4px;
}

.atax-header-nav .wp-block-navigation-item__content:focus .wp-block-navigation-item__label {
    color: #2a3659;
}

/* Add dropdown arrow for parent items with submenus */
.atax-header-nav .wp-block-navigation-item.has-child .wp-block-navigation-item__content::after {
    content: '';
    width: 12px;
    height: 12px;
    margin-left: 6px;
    background-image: url('../../assets/images/icon_chevron-down.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
}

.atax-header-nav .wp-block-navigation-item.has-child:hover .wp-block-navigation-item__content::after {
    transform: rotate(180deg);
}

/* Remove chevrons from child items */
.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item .wp-block-navigation-item__content::after {
    display: none !important;
}

/* Submenu styles */
.atax-header-nav .wp-block-navigation__submenu-container {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    /* Ensure submenu doesn't cause horizontal scroll */
    max-width: 300px;
    word-wrap: break-word;
    padding: 0px;
    /* Add invisible padding-top to create hover bridge - prevents dropdown from disappearing when moving mouse from menu item to dropdown */
    padding-top: 10px;
    margin-top: -10px;
}

/* Show dropdown when hovering over parent menu item */
.atax-header-nav .wp-block-navigation-item:hover .wp-block-navigation__submenu-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Keep dropdown visible when hovering over the dropdown itself - prevents disappearing when moving mouse from menu item to dropdown */
.atax-header-nav .wp-block-navigation__submenu-container:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item {
    border-bottom: 1px solid #f0f0f0;
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item:last-child {
    border-bottom: none;
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    padding: 12px 16px;
    font-size: 14px;
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__label {
    color: #354477; /* Primary blue color for submenu text */
    overflow-wrap: break-word;
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    background: #f8f9fa;
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover .wp-block-navigation-item__label {
    color: #2a3659; /* Slightly darker blue on hover */
}

/* Focus indicators for submenu items */
.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px #354477;
    border-radius: 4px;
}

.atax-header-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus .wp-block-navigation-item__label {
    color: #2a3659;
}

/* ===================================
   MOBILE NAVIGATION MENU
   =================================== */

.atax-header-navigation-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #10A1DC;
    z-index: 9999;
    display: none;
    overflow-y: auto;
}

.atax-header-navigation-mobile.active {
    display: block;
}

.atax-header-mobile-nav-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.atax-header-mobile-nav-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

/* Mobile Header with Logo and Close Button */
.atax-header-mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.atax-header-mobile-logo-container {
    flex: 1;
}

.atax-header-mobile-logo {
    height: 47px;
    width: auto;
}

.atax-header-mobile-close {
    background: none;
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.atax-header-mobile-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.atax-header-mobile-close-icon {
    line-height: 1;
}

/* Mascot Section */
.atax-header-mobile-mascot {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.atax-header-mobile-mascot-image {
    width: 65px;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Mobile Navigation Menu */
.atax-header-mobile-nav-menu {
    flex: 1;
    margin-bottom: 30px;
}

.atax-mobile-nav-container {
    list-style: none;
    margin: 0;
    padding: 0;
}

.atax-mobile-nav-item {
    margin-bottom: 8px;
}

.atax-mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease;
}

.atax-mobile-nav-link:hover {
    color: #FFC845;
}

.atax-mobile-nav-label {
    flex: 1;
}

.atax-mobile-nav-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.atax-mobile-nav-item.has-child .atax-mobile-nav-arrow {
    transform: rotate(0deg);
}

.atax-mobile-nav-item.has-child.expanded .atax-mobile-nav-arrow {
    transform: rotate(180deg);
}

/* Mobile Submenu */
.atax-mobile-nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
}

.atax-mobile-nav-item.expanded .atax-mobile-nav-submenu {
    display: block;
}

.atax-mobile-nav-subitem {
    margin: 0;
}

.atax-mobile-nav-sublink {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.atax-mobile-nav-sublink:hover {
    color: #FFC845;
    background-color: rgba(255, 255, 255, 0.1);
}

.atax-mobile-nav-sublabel {
    display: block;
}



.atax-header-mobile-phone-btn {
    width: 100%;
    justify-content: center;
}

/* ===================================
   RESPONSIVE DESIGN - GOLDEN STANDARD
   ===================================
   
   BREAKPOINT STRATEGY:
   - 1600px+: Desktop default (full layout)
   - 1151px-1600px: Laptop (reduced gaps only, same fonts)
   - 768px-1150px: Tablet (hamburger menu, banner text 14px)
   - 0px-767px: Mobile (hamburger menu, banner text 13px)
   =================================== */

/* Laptop - Reduced gaps and spacing only */
@media (max-width: 1600px) {
 .atax-header-container,
    .atax-header-container {
        padding: 20px 20px 0px 20px; /* 5px top, 10px right, 15px bottom, 20px left */
    }
    
    .atax-header-nav-list {
        gap: 30px; /* Slightly reduced gap */
    }
}

/* Tablet - Hamburger menu appears, banner text 14px */
@media (max-width: 1150px) {
    .atax-header-banner {
        font-size: 14px; /* Tablet banner text size */
    }
    
    .atax-header-banner .atax-header-container {
        padding: 0 20px; /* Maintain desktop side padding */
        flex-direction: column; /* Stack columns vertically if right column exists */
        align-items: flex-start; /* Align content to left */
        gap: 8px; /* Reduced gap for stacked layout */
    }
    
    .atax-header-banner-left {
        text-align: left; /* Left align banner text */
        width: 100%; /* Full width when stacked */
    }
    
    .atax-header-banner-right {
        display: block; /* Show location switcher on tablet if it exists */
        width: 100%; /* Full width when stacked */
        text-align: left; /* Left align on tablet */
    }
    
    /* Keep center alignment for parent theme single-column banner */
    .atax-header-banner-center {
        justify-content: flex-start; /* Align content to left on tablet */
    }
    
    .atax-header-container {
        padding: 16px 20px 16px 20px; /* 5px top, 10px right, 15px bottom, 20px left */
        justify-content: space-between;
    }
    
    .atax-header-logo {
        order: 1;
    }
    
    .atax-header-contact-desktop {
        display: none; /* Hide desktop contact on tablet */
    }
    
    .atax-header-search {
        display: none; /* Hide search on tablet */
    }
    
    .atax-header-hamburger {
        display: block; /* Show hamburger on tablet */
        order: 2;
    }
    
    .atax-header-navigation-desktop {
        display: none; /* Hide desktop navigation on tablet */
    }
    
    .atax-header-nav-container {
        padding: 0 20px; /* Maintain desktop side padding */
    }
}

/* Mobile - Hamburger menu, banner text 13px */
@media (max-width: 767px) {
    .atax-header-banner {
        font-size: 13px; /* Mobile banner text size */
        padding: 6px 0;
    }
    
    .atax-header-banner .atax-header-container {
        padding: 0 16px; /* Mobile side padding */
        flex-direction: column; /* Stack columns vertically if right column exists */
        align-items: flex-start; /* Align content to left */
        gap: 8px; /* Reduced gap for stacked layout */
    }
    
    .atax-header-banner-left {
        text-align: left; /* Left align banner text */
        width: 100%; /* Full width when stacked */
    }
    
    .atax-header-banner-right {
        display: block; /* Show location switcher on mobile if it exists */
        width: 100%; /* Full width when stacked */
        text-align: left; /* Left align on mobile */
    }
    
    /* Keep center alignment for parent theme single-column banner */
    .atax-header-banner-center {
        justify-content: flex-start; /* Align content to left on mobile */
    }
    
    .atax-header-main {
        padding: 15px 0;
    }
    
    .atax-header-container {
        padding: 0 16px; /* Mobile side padding */
        justify-content: space-between;
    }
    
    .atax-header-logo-image {
        width: 120px; /* Slightly smaller logo on mobile */
    }
    
    .atax-header-contact-desktop {
        display: none; /* Hide desktop contact on mobile */
    }
    
    .atax-header-search {
        display: none; /* Hide search on mobile */
    }
    
    .atax-header-hamburger {
        display: block; /* Show hamburger on mobile */
    }
    
    .atax-header-navigation-desktop {
        display: none; /* Hide desktop navigation on mobile */
    }
    
    .atax-header-nav-container {
        padding: 0 16px; /* Mobile side padding */
    }
}

/* ===================================
   ACCESSIBILITY & FOCUS STATES
   =================================== */

.atax-header-hamburger-btn:focus {
    outline: 2px solid #10A1DC;
    outline-offset: 2px;
}

.atax-header-nav-link:focus {
    outline: 2px solid #10A1DC;
    outline-offset: 2px;
}

/* ===================================
   MOBILE NAVIGATION MENU
   =================================== */

.atax-header-navigation-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #10A1DC;
    z-index: 9999;
    display: none;
    overflow-y: auto;
}

.atax-header-navigation-mobile.active {
    display: block;
}

.atax-header-mobile-nav-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.atax-header-mobile-nav-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

/* Mobile Header with Logo and Close Button */
.atax-header-mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.atax-header-mobile-logo-container {
    flex: 1;
}

.atax-header-mobile-logo {
    height: 40px;
    width: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.atax-header-mobile-close {
    background: none;
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.atax-header-mobile-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.atax-header-mobile-close-icon {
    line-height: 1;
}

/* Mascot Section */
.atax-header-mobile-mascot {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 24px;
    margin-top: 48px;
}

.atax-header-mobile-mascot-image {
    width: 65px;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Mobile Navigation Menu */
.atax-header-mobile-nav-menu {
    flex: 1;
    margin-bottom: 30px;
}

.atax-mobile-nav-container {
    list-style: none;
    margin: 0;
    padding: 0;
}

.atax-mobile-nav-item {
    margin-bottom: 8px;
}

.atax-mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease;
}

.atax-mobile-nav-link:hover {
    color: #FFC845;
}

.atax-mobile-nav-label {
    flex: 1;
}

.atax-mobile-nav-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.atax-mobile-nav-item.has-child .atax-mobile-nav-arrow {
    transform: rotate(0deg);
}

.atax-mobile-nav-item.has-child.expanded .atax-mobile-nav-arrow {
    transform: rotate(180deg);
}

/* Mobile Submenu */
.atax-mobile-nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    padding: 8px 0;
    display: none;
}

.atax-mobile-nav-item.expanded .atax-mobile-nav-submenu {
    display: block;
}

.atax-mobile-nav-subitem {
    margin: 0;
}

.atax-mobile-nav-sublink {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.atax-mobile-nav-sublink:hover {
    color: #FFC845;
    background-color: rgba(255, 255, 255, 0.1);
}

.atax-mobile-nav-sublabel {
    display: block;
}


/* ===================================
   OVERFLOW PROTECTION
   =================================== */

.atax-header-wrapper {
    max-width: 100vw;
}

.atax-header-banner {
    max-width: 100%;
    overflow-x: hidden;
}

.atax-header-main {
    max-width: 100%;
    /* Removed overflow-x: hidden to allow dropdowns to extend */
}