/**
 * Header 2 - Pure Visual Styles (Refactored)
 * Clean, minimal CSS for A1 Chimney style header
 * JavaScript functionality moved to shared header logic system
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

/* Override body padding for this header */
body.zx_hd2_active {
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-x: hidden;
}

.admin-bar body.zx_hd2_active {
    padding-top: 0 !important;
}

/* Main header element */
.zx_hd2_header {
    position: relative;
    width: 100%;
    background-image: url('../images/brick-background.png');
    background-repeat: repeat;
    background-size: 150px auto;
    background-position: top left;
    border-bottom: 5px solid #e07310;
    min-height: 90px;
    z-index: 9999;
    margin: 0;
    padding: 0;
}

/* Black overlay for brick background */
.zx_hd2_header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1;
}

/* Container */
.zx_hd2_container {
    position: relative;
    z-index: 2;
    max-width: 1320px;
    margin: 0 auto;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ==========================================================================
   Logo Section
   ========================================================================== */

.zx_hd2_logo {
    flex: 0 0 20%;
    max-width: 20%;
}

.zx_hd2_logo_link {
    display: inline-block;
}

.zx_hd2_logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

.zx_hd2_site_title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ==========================================================================
   Navigation Section
   ========================================================================== */

.zx_hd2_nav {
    flex: 0 0 60%;
    max-width: 60%;
    display: flex;
    justify-content: center;
}

.zx_hd2_menu_wrapper {
    width: 100%;
}

/* Main menu list */
.zx_hd2_menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.zx_hd2_menu_item {
    position: relative;
}

/* Menu links */
.zx_hd2_menu_link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: color 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.zx_hd2_menu_link:hover {
    color: #FFD700;
}

/* Dropdown icon */
.zx_hd2_dropdown_icon {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #ffffff;
    transition: color 0.3s ease;
}

.zx_hd2_dropdown_icon:hover {
    color: #FFD700;
}

/* Dropdown menu */
.zx_hd2_dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 20px;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.zx_hd2_menu_item:hover .zx_hd2_dropdown {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

.zx_hd2_dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zx_hd2_dropdown a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    display: block;
    transition: color 0.3s ease;
}

.zx_hd2_dropdown a:hover {
    color: #e74c3c;
}

/* ==========================================================================
   Silkweaver Menu Classes (shared with header1, scoped to header2)
   ========================================================================== */

.zx_hd2_header .silkweaver-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.zx_hd2_header .silkweaver-menu > li {
    position: relative;
}

.zx_hd2_header .silkweaver-menu > li > a {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: color 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.zx_hd2_header .silkweaver-menu > li > a:hover {
    color: #FFD700;
}

.zx_hd2_header .silkweaver-parent-button {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    color: #ffffff;
    background: none;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.zx_hd2_header .silkweaver-parent-button:hover {
    color: #FFD700;
}

.zx_hd2_header .silkweaver-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 20px;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
    list-style: none;
    z-index: 100;
}

.zx_hd2_header .silkweaver-dropdown:hover .silkweaver-dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

.zx_hd2_header .silkweaver-dropdown-menu li {
    list-style: none;
}

.zx_hd2_header .silkweaver-dropdown-menu a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    display: block;
    transition: color 0.3s ease;
}

.zx_hd2_header .silkweaver-dropdown-menu a:hover {
    color: #e74c3c;
}

/* Mobile menu toggle (hidden on desktop) */
.zx_hd2_mobile_toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 4px;
}

.zx_hd2_toggle_bar {
    display: block;
    width: 25px;
    height: 3px;
    background: #ffffff;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Phone CTA Section
   ========================================================================== */

.zx_hd2_cta {
    flex: 0 0 20%;
    max-width: 20%;
    display: flex;
    justify-content: flex-end;
    white-space: nowrap;
}

.zx_hd2_phone_button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFD700;
    color: #333333;
    padding: 12px 20px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 1px solid #E6C200;
    white-space: nowrap;
}

.zx_hd2_phone_icon {
    width: 18px;
    height: 18px;
    fill: #333333;
    flex-shrink: 0;
}

.zx_hd2_phone_button:hover {
    background: #FFC700;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Sticky Header Behavior
   ========================================================================== */

.zx_hd2_header[data-sticky="true"] {
    transition: none; /* Prevent jankiness */
}

.zx_hd2_header.zx_hd2_sticky_active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.admin-bar .zx_hd2_header.zx_hd2_sticky_active {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar .zx_hd2_header.zx_hd2_sticky_active {
        top: 46px !important;
    }
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1024px) {

    /* ---- Header bar: single row [LOGO] [HAMBURGER] [PHONE] ---- */

    .zx_hd2_container {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .zx_hd2_logo {
        flex: 0 0 auto;
        max-width: none;
    }

    /* Nav shrinks to fit toggle button only; stays in natural DOM order (middle) */
    .zx_hd2_nav {
        flex: 0 0 auto;
        max-width: none;
        width: auto;
        order: 0;
        display: flex;
        align-items: center;
    }

    /* Hamburger: visible, white bars */
    .zx_hd2_mobile_toggle {
        display: flex;
    }

    /* Phone CTA: visible and compact on right */
    .zx_hd2_cta {
        flex: 0 0 auto;
        max-width: none;
        display: flex;
        justify-content: flex-end;
    }

    .zx_hd2_phone_button {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* ---- Menu panel (opens when hamburger clicked) ---- */

    .zx_hd2_menu_wrapper {
        display: none;
        position: fixed;
        top: 90px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #000;
        overflow-y: auto;
        padding: 8px;
        z-index: 9998;
    }

    .zx_hd2_menu_wrapper.active {
        display: block;
    }

    /* ---- Top-level nav items: vertical list ---- */

    .zx_hd2_menu {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        margin: 0;
    }

    /* Each top-level item: black bg, full border box, gap below */
    .zx_hd2_menu_item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        background: #000;
        border: 1px solid #ccc;
        margin-bottom: 4px;
    }

    .zx_hd2_menu_link {
        flex: 1;
        padding: 15px 16px;
        color: #fff;
        font-size: 16px;
        text-shadow: none;
    }

    .zx_hd2_menu_link:hover {
        color: #FFD700;
    }

    /* Expand icon: LEFT of text, white */
    .zx_hd2_dropdown_icon {
        order: -1;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: #fff;
        padding: 0;
    }

    .zx_hd2_dropdown_icon svg {
        transition: transform 0.25s ease;
    }

    .zx_hd2_has_dropdown.active .zx_hd2_dropdown_icon svg {
        transform: rotate(180deg);
    }

    /* ---- Child items (zx_hd2): black bg, bordered, indented ---- */

    .zx_hd2_dropdown {
        display: none; /* JS slideToggle controls visibility */
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        margin: 0;
        opacity: 1;
        visibility: visible;
        width: 100%;
        flex-basis: 100%;
        padding: 4px 4px 0 4px;
        background: #000;
    }

    .zx_hd2_dropdown ul {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .zx_hd2_dropdown li {
        margin-bottom: 4px;
    }

    .zx_hd2_dropdown a {
        display: block;
        padding: 13px 16px 13px 20px;
        color: #fff;
        font-size: 15px;
        border: 1px solid #ccc;
        text-decoration: none;
        background: #000;
    }

    .zx_hd2_dropdown a:hover {
        color: #FFD700;
    }

    /* ---- Silkweaver menu: same accordion pattern ---- */

    .zx_hd2_header .silkweaver-menu {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        margin: 0;
    }

    /* Non-parent silkweaver items: black bg, full border box */
    .zx_hd2_header .silkweaver-menu > li {
        background: #000;
        border: 1px solid #ccc;
        margin-bottom: 4px;
    }

    .zx_hd2_header .silkweaver-menu > li > a {
        display: block;
        padding: 15px 16px;
        color: #fff;
        font-size: 16px;
        text-shadow: none;
        text-decoration: none;
    }

    .zx_hd2_header .silkweaver-menu > li > a:hover {
        color: #FFD700;
    }

    /* Parent silkweaver items: flex row, black bg, full border box */
    .zx_hd2_header .silkweaver-dropdown {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        background: #000;
        border: 1px solid #ccc;
        margin-bottom: 4px;
    }

    .zx_hd2_header .silkweaver-parent-button {
        order: 0;
        flex: 1;
        display: flex;
        align-items: center;
        padding: 15px 16px 15px 0;
        color: #fff;
        font-size: 16px;
        background: none;
        border: none;
        cursor: pointer;
        text-align: left;
        text-shadow: none;
    }

    /* Chevron on LEFT of silkweaver parent text — white */
    .zx_hd2_header .silkweaver-parent-button::before {
        content: '▶';
        display: inline-block;
        width: 48px;
        text-align: center;
        font-size: 10px;
        color: #fff;
        flex-shrink: 0;
        transition: transform 0.25s ease;
    }

    .zx_hd2_header .silkweaver-dropdown.active .silkweaver-parent-button::before {
        transform: rotate(90deg);
    }

    /* Silkweaver child list: black bg, bordered items */
    .zx_hd2_header .silkweaver-dropdown-menu {
        display: none; /* JS slideToggle controls visibility */
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        margin: 0;
        opacity: 1;
        visibility: visible;
        width: 100%;
        flex-basis: 100%;
        padding: 4px 4px 0 4px;
        background: #000;
        list-style: none;
    }

    /* Disable desktop hover-open on mobile */
    .zx_hd2_header .silkweaver-dropdown:hover .silkweaver-dropdown-menu {
        opacity: 1;
        visibility: visible;
    }

    .zx_hd2_header .silkweaver-dropdown-menu li {
        list-style: none;
        margin-bottom: 4px;
    }

    .zx_hd2_header .silkweaver-dropdown-menu a {
        display: block;
        padding: 13px 16px 13px 20px;
        color: #fff;
        font-size: 15px;
        border: 1px solid #ccc;
        text-decoration: none;
        background: #000;
    }

    .zx_hd2_header .silkweaver-dropdown-menu a:hover {
        color: #FFD700;
    }
}

@media (max-width: 768px) {
    .zx_hd2_container {
        padding: 8px 12px;
    }

    .zx_hd2_logo img {
        max-height: 44px;
    }

    .zx_hd2_phone_button {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */

.zx_hd2_header.zx_hd2_invisible {
    opacity: 0;
    animation: zx_hd2_fadeIn 0.5s ease forwards;
    animation-delay: 0.3s;
}

@keyframes zx_hd2_fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Enhanced Interaction States
   ========================================================================== */

/* Hover state for menu items */
.zx_hd2_menu_item.zx_hd2_hover .zx_hd2_menu_link {
    color: #FFD700;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Focus state for accessibility */
.zx_hd2_menu_item.zx_hd2_focused .zx_hd2_menu_link {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Enhanced phone button interaction */
.zx_hd2_phone_button:focus {
    outline: 2px solid #333333;
    outline-offset: 3px;
}

.zx_hd2_phone_button:active {
    transform: translateY(-1px);
}