/* ============================================================
   COMMON HEADER FIX - Works for both product_header and homepage
   Unique CSS classes to ensure proper styling
   ============================================================ */

/* Ensure header appears above site-nav menu on blog pages (site-nav has z-index: 1000) */
/* Use maximum z-index values to ensure dropdown appears above all elements */
body .product_header,
body header.product_header,
.product_header,
header.product_header {
    z-index: 2147483647 !important;
    position: relative !important;
    overflow: visible !important;
}

body .product_header .product_header_bar,
body header.product_header .product_header_bar,
.product_header .product_header_bar,
header.product_header .product_header_bar {
    z-index: 2147483647 !important;
    position: relative !important;
    overflow: visible !important;
}

body .product_header .product_top_nav,
body header.product_header .product_top_nav,
.product_header .product_top_nav,
header.product_header .product_top_nav {
    z-index: 2147483647 !important;
    position: relative !important;
    overflow: visible !important;
}

body .product_header .product_header_left,
body header.product_header .product_header_left,
.product_header .product_header_left,
header.product_header .product_header_left {
    z-index: 2147483647 !important;
    position: relative !important;
    overflow: visible !important;
}

/* Ensure product_nav_dropdown container is above everything */
body .product_header .product_nav_dropdown,
body header.product_header .product_nav_dropdown,
.product_header .product_nav_dropdown,
header.product_header .product_nav_dropdown {
    z-index: 2147483647 !important;
    position: relative !important;
    overflow: visible !important;
}

/* Logo Styling - Square with no border-radius (matching product_header.php inline styles exactly) */
/* Must override product_header.php inline styles and product_styles.css */
/* Use combined selector (.product_logo_img.gc_header_logo_fixed) for higher specificity than .product_logo_img */
body .product_header .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
body .product_header .product_logo_img.gc_header_logo_fixed,
body .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
body .product_logo_img.gc_header_logo_fixed,
.product_header .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
.product_header .product_logo_img.gc_header_logo_fixed,
.product_logo_wrap .product_logo_img.gc_header_logo_fixed,
.product_logo_img.gc_header_logo_fixed,
body .product_header .product_logo_wrap .gc_header_logo_fixed,
body .product_header .gc_header_logo_fixed,
body .product_logo_wrap .gc_header_logo_fixed,
body .gc_header_logo_fixed,
.product_header .product_logo_wrap .gc_header_logo_fixed,
.product_header .gc_header_logo_fixed,
.product_logo_wrap .gc_header_logo_fixed,
.gc_header_logo_fixed {
    height: 36px !important;
    width: auto !important;
    max-width: 120px !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    display: block !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    body .product_header .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
    body .product_header .product_logo_img.gc_header_logo_fixed,
    body .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
    body .product_logo_img.gc_header_logo_fixed,
    .product_header .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
    .product_header .product_logo_img.gc_header_logo_fixed,
    .product_logo_wrap .product_logo_img.gc_header_logo_fixed,
    .product_logo_img.gc_header_logo_fixed,
    body .product_header .product_logo_wrap .gc_header_logo_fixed,
    body .product_header .gc_header_logo_fixed,
    body .product_logo_wrap .gc_header_logo_fixed,
    body .gc_header_logo_fixed,
    .product_header .product_logo_wrap .gc_header_logo_fixed,
    .product_header .gc_header_logo_fixed,
    .product_logo_wrap .gc_header_logo_fixed,
    .gc_header_logo_fixed {
        height: 30px !important;
        width: auto !important;
        max-width: 100px !important;
    }
}

/* Dropdown Menu - Hidden by default, shown on hover */
/* Maximum z-index to appear above site-nav menu (z-index: 1000) and all other elements */
/* Reduced gap and added padding-top to create seamless hover bridge */
body .product_header .gc_nav_dropdown_menu_fixed,
body header.product_header .gc_nav_dropdown_menu_fixed,
body .product_nav_dropdown .gc_nav_dropdown_menu_fixed,
body .gc_nav_dropdown_menu_fixed,
.product_header .gc_nav_dropdown_menu_fixed,
header.product_header .gc_nav_dropdown_menu_fixed,
.product_nav_dropdown .gc_nav_dropdown_menu_fixed,
.gc_nav_dropdown_menu_fixed,
body .product_header .product_nav_dropdown_menu.gc_nav_dropdown_menu_fixed,
.product_header .product_nav_dropdown_menu.gc_nav_dropdown_menu_fixed {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-10px) !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    min-width: 200px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transition: opacity 0.2s ease 0s, visibility 0.2s ease 0s, transform 0.2s ease 0s !important;
    z-index: 2147483647 !important;
    padding: 18px 0 8px 0 !important;
    margin-top: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    max-height: 0 !important;
}

/* Arrow pointer above dropdown menu - positioned within top padding for hover bridge */
body .product_header .gc_nav_dropdown_menu_fixed::before,
body header.product_header .gc_nav_dropdown_menu_fixed::before,
body .gc_nav_dropdown_menu_fixed::before,
.product_header .gc_nav_dropdown_menu_fixed::before,
header.product_header .gc_nav_dropdown_menu_fixed::before,
.gc_nav_dropdown_menu_fixed::before {
    content: '' !important;
    position: absolute !important;
    top: 9px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 8px solid transparent !important;
    border-right: 8px solid transparent !important;
    border-bottom: 6px solid #ffffff !important;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1)) !important;
    z-index: 2147483647 !important;
    pointer-events: none !important;
}

/* Create invisible hover bridge above menu - extends upward to close the gap */
/* This pseudo-element bridges the gap between trigger and menu */
/* When dropdown is visible, show the bridge to maintain hover state */
body .product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
body header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
body .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
.gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after {
    content: '' !important;
    position: absolute !important;
    top: -18px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    min-width: 200px !important;
    height: 18px !important;
    background: transparent !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
    display: block !important;
}

/* Keep dropdown visible when hovering over the menu itself or its container */
/* Menu positioned at top: 100% (no gap) with padding-top creating seamless hover bridge */
body .product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed,
body header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed,
body .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed,
.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed,
header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed,
.gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed,
body .product_header .product_nav_dropdown:hover .gc_nav_dropdown_menu_fixed,
.product_header .product_nav_dropdown:hover .gc_nav_dropdown_menu_fixed,
body .product_header .gc_nav_dropdown_menu_fixed:hover,
body header.product_header .gc_nav_dropdown_menu_fixed:hover,
body .gc_nav_dropdown_menu_fixed:hover,
.product_header .gc_nav_dropdown_menu_fixed:hover,
header.product_header .gc_nav_dropdown_menu_fixed:hover,
.gc_nav_dropdown_menu_fixed:hover,
body .product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed:hover,
body header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed:hover,
body .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed:hover,
.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed:hover,
header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed:hover,
.gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed:hover {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transform: translateX(-50%) translateY(0) !important;
    overflow: visible !important;
    pointer-events: auto !important;
    height: auto !important;
    width: auto !important;
    max-height: 500px !important;
    min-width: 200px !important;
    z-index: 2147483647 !important;
    transition: opacity 0.2s ease 0s, visibility 0.2s ease 0s, transform 0.2s ease 0s !important;
}

/* Show hover bridge when dropdown is visible - creates seamless hover area */
/* This ensures ::after pseudo-element is visible when dropdown is shown to bridge any gap */
body .product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
body header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
body .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
header.product_header .gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
.gc_nav_dropdown_fixed:hover .gc_nav_dropdown_menu_fixed::after,
body .product_header .gc_nav_dropdown_menu_fixed:hover::after,
body header.product_header .gc_nav_dropdown_menu_fixed:hover::after,
body .gc_nav_dropdown_menu_fixed:hover::after,
.product_header .gc_nav_dropdown_menu_fixed:hover::after,
header.product_header .gc_nav_dropdown_menu_fixed:hover::after,
.gc_nav_dropdown_menu_fixed:hover::after {
    display: block !important;
}

.gc_nav_dropdown_menu_fixed a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-bottom: 1px solid #f3f4f6 !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    position: relative !important;
}

.gc_nav_dropdown_menu_fixed a:last-child {
    border-bottom: none !important;
}

.gc_nav_dropdown_menu_fixed a::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 3px !important;
    background: #2563eb !important;
    transform: scaleY(0) !important;
    transition: transform 0.2s ease !important;
}

.gc_nav_dropdown_menu_fixed a:hover {
    background: linear-gradient(to right, #eff6ff 0%, #f3f4f6 100%) !important;
    color: #2563eb !important;
    padding-left: 24px !important;
    transform: translateX(4px) !important;
}

.gc_nav_dropdown_menu_fixed a:hover::before {
    transform: scaleY(1) !important;
}

.gc_nav_dropdown_menu_fixed a:active {
    background: #e5e7eb !important;
    transform: translateX(2px) !important;
}

/* Dropdown Toggle - Ensure proper styling */
/* Maximum z-index to ensure dropdown appears above site-nav menu and all elements */
/* Add padding-bottom to create hover bridge between trigger and menu */
body .product_header .gc_nav_dropdown_fixed,
body header.product_header .gc_nav_dropdown_fixed,
body .product_nav_dropdown.gc_nav_dropdown_fixed,
body .gc_nav_dropdown_fixed,
.product_header .gc_nav_dropdown_fixed,
header.product_header .gc_nav_dropdown_fixed,
.product_nav_dropdown.gc_nav_dropdown_fixed,
.gc_nav_dropdown_fixed {
    position: relative !important;
    overflow: visible !important;
    z-index: 2147483647 !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding-bottom: 18px !important;
    margin-bottom: -18px !important;
}

/* Ensure dropdown container maintains hover state when menu is visible */
body .product_header .gc_nav_dropdown_fixed:hover,
body header.product_header .gc_nav_dropdown_fixed:hover,
body .gc_nav_dropdown_fixed:hover,
.product_header .gc_nav_dropdown_fixed:hover,
header.product_header .gc_nav_dropdown_fixed:hover,
.gc_nav_dropdown_fixed:hover {
    padding-bottom: 18px !important;
}

.gc_nav_dropdown_toggle_fixed {
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    border-bottom: 2px solid transparent !important;
    position: relative !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 6px 0 !important;
    transition: color 0.2s !important;
}

.gc_nav_dropdown_toggle_fixed:hover {
    border-bottom-color: transparent !important;
    color: #e0e0e0 !important;
}

.gc_nav_dropdown_fixed:hover .gc_nav_dropdown_toggle_fixed {
    color: #e0e0e0 !important;
}

.gc_nav_dropdown_toggle_fixed svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-left: 6px !important;
    flex-shrink: 0 !important;
}

.gc_nav_dropdown_fixed:hover .gc_nav_dropdown_toggle_fixed svg {
    transform: rotate(180deg) !important;
}

/* Ensure site-nav menu has lower z-index than header dropdown */
/* This ensures dropdown appears above the site-nav menu below header */
body .site-nav,
body nav.site-nav,
.site-nav,
nav.site-nav {
    z-index: 999 !important;
    position: relative !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .gc_nav_dropdown_menu_fixed {
        min-width: 180px !important;
        padding: 6px 0 !important;
    }
    
    .gc_nav_dropdown_menu_fixed a {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    .gc_nav_dropdown_menu_fixed a:hover {
        padding-left: 20px !important;
        transform: translateX(2px) !important;
    }
}

