/**
 * Modern Custom Header Styles
 * Fully Responsive & Modern Design
 */

/* ============================================
   HEADER VARIABLES
   ============================================ */
:root {
    --header-bg: #0d3050;
    --header-text: #ffffff;
    --header-primary: #3AB8AE;
    --header-secondary: #0d3050;
    --header-hover: #3AB8AE;
    --header-border: rgba(255, 255, 255, 0.15);
    --header-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --header-height: 85px;
    --topbar-bg: rgba(0, 0, 0, 0.3);
    --topbar-height: 40px;
    --announcement-bg: #0d3050;
    --announcement-height: 50px;
}

.mobile-menu-search {
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.95);
}

.mobile-menu-search form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-search .search-field {
    flex: 1;
    height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(23, 83, 143, 0.18);
    background: #ffffff;
    color: #0d3050;
    font-size: 14px;
}

.mobile-menu-search .search-field::placeholder {
    color: rgba(23, 83, 143, 0.6);
}

.mobile-menu-search .search-submit {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: #0d3050;
    color: #ffffff;
}

.mobile-quick-actions {
    padding: 8px 16px 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.mobile-quick-actions .qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 6px;
    padding: 10px 6px;
    background: #ffffff;
    border: 1px solid rgba(23, 83, 143, 0.12);
    border-radius: 10px;
    color: #0d3050;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mobile-quick-actions .qa-btn svg {
    stroke: currentColor;
}

.mobile-quick-actions .qa-btn:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(23, 83, 143, 0.12);
    transform: translateY(-1px);
}

@media (max-width: 380px) {
    .mobile-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 320px) {
    .mobile-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    :root {
        --header-height: 65px;
        --announcement-height: 50px;
        --topbar-height: 40px;
    }
}

/* ============================================
   RESET & BASE
   ============================================ */
.custom-header * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   PAGE PROGRESS BAR
   ============================================ */
.page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: #0d3050;
    width: 0%;
    z-index: 10000;
    transition: width 0.1s ease;
    animation: progressGradient 3s linear infinite;
    box-shadow: 0 0 10px rgba(58, 184, 174, 0.5);
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.custom-header a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.custom-header ul {
    list-style: none;
}

.custom-header button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

/* ============================================
   CONTAINER
   ============================================ */
.custom-header .container {
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   ANNOUNCEMENT BAR - FIXED FOR FULL VISIBILITY
   ============================================ */
.header-announcement-bar {
    background: var(--announcement-bg);
    color: white;
    font-size: 13px;
    min-height: var(--announcement-height);
    height: auto !important;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    overflow: visible !important;
    z-index: 100000;
    padding: 0 !important;
    line-height: 1.5;
    /* NO TRANSITIONS - Prevents visual glitches */
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.header-announcement-bar .container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--announcement-height);
    padding: 8px 20px !important;
}

.header-announcement-bar.hidden {
    height: 0;
    opacity: 0;
    visibility: hidden;
    display: none;
}

/* When announcement bar is hidden, adjust top bar position */
body:has(.header-announcement-bar.hidden) .header-top-bar {
    top: 0;
}

/* When announcement bar is hidden, adjust main header position */
body:has(.header-announcement-bar.hidden) .header-main {
    top: var(--topbar-height);
}

/* Fallback: JS adds body.has-announcement-hidden for browsers lacking :has */
body.has-announcement-hidden .header-top-bar {
    top: 0;
}
body.has-announcement-hidden .header-main {
    top: var(--topbar-height);
}

.announcement-slider {
    flex: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-item {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 0;
    line-height: 1.5;
    min-height: 26px;
}

.announcement-item.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.announcement-item span {
    display: inline-block;
    line-height: 1.5;
}

.announcement-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #ffffff;
    margin-right: 8px;
}

.announcement-close {
    position: absolute;
    right: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.announcement-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   TOP BAR
   ============================================ */
.header-top-bar {
    background: rgba(13, 48, 80, 0.98);
    border-bottom: 1px solid rgba(58, 184, 174, 0.2);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: var(--announcement-height);
    z-index: 99999;
}

.header-top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle fill="rgba(58,184,174,0.03)" cx="50" cy="50" r="40"/></svg>');
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.header-top-bar .container {
    position: relative;
    z-index: 1;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.top-bar-left {
    display: flex;
    gap: 24px;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.top-bar-item:hover {
    color: var(--header-primary);
    transform: translateX(3px);
}

.top-bar-item svg {
    width: 15px;
    height: 15px;
    color: #3AB8AE;
    transition: all 0.3s ease;
}

.top-bar-item:hover svg {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(58, 184, 174, 0.6));
}

.top-bar-right {
    display: flex;
    gap: 16px;
}

.top-bar-link {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
}

.top-bar-link:hover {
    color: var(--header-primary);
    background: rgba(58, 184, 174, 0.1);
    transform: translateY(-2px);
}

.top-bar-link svg {
    width: 14px;
    height: 14px;
    color: #3AB8AE;
    transition: all 0.3s ease;
}

.top-bar-link:hover svg {
    transform: rotate(360deg);
}

/* ============================================
   MAIN HEADER
   ============================================ */
.header-main {
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    position: sticky;
    top: calc(var(--announcement-height) + var(--topbar-height));
    z-index: 99998;
    height: var(--header-height);
    display: flex;
    align-items: center;
    /* NO TRANSITIONS - Prevents blanking */
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

/* DISABLED: Hide functionality removed to prevent blanking */
.header-main.header-hidden {
    /* transform: translateY(-100%); - DISABLED */
    transform: translate3d(0, 0, 0) !important; /* Keep visible with GPU acceleration */
}

.header-main.header-visible {
    transform: translate3d(0, 0, 0) !important; /* Keep visible with GPU acceleration */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

/* ============================================
   LOGO
   ============================================ */
.header-logo {
    flex-shrink: 0;
    z-index: 10;
}

.header-logo .logo-link {
    display: flex;
    align-items: center;
}

.header-logo img,
.header-logo-img {
    max-height: 55px;
    width: auto;
    display: block;
    filter: brightness(1.1);
}

.header-logo .site-name {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   NAVIGATION
   ============================================ */
.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.main-menu > li > a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--header-text);
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.main-menu > li > a:hover {
    background: rgba(58, 184, 174, 0.15);
    color: var(--header-primary);
}

.main-menu > li.current-menu-item > a,
.main-menu > li.current_page_item > a {
    color: var(--header-primary);
    background: rgba(58, 184, 174, 0.15);
}

/* Dropdown Menu */
.main-menu li.menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #ffffff;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.main-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.main-menu ul.sub-menu {
    position: fixed !important;
    top: auto;
    left: auto;
    min-width: 240px;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999999 !important;
}

.main-menu li.menu-item-has-children:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu ul.sub-menu li {
    width: 100%;
}

.main-menu ul.sub-menu a {
    display: block;
    padding: 10px 16px;
    color: #333 !important;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.main-menu ul.sub-menu a:hover {
    background: rgba(23, 83, 143, 0.08);
    color: #0d3050 !important;
}

/* ============================================
   HEADER ACTIONS
   ============================================ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--header-text);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    text-decoration: none !important;
    outline: none !important;
}

.header-action-btn::after,
.header-action-btn::before {
    display: none !important;
}

.header-action-btn:hover {
    background: rgba(58, 184, 174, 0.15);
    color: var(--header-primary);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 15px rgba(58, 184, 174, 0.3);
    text-decoration: none !important;
    border-bottom: none !important;
}

.header-action-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.header-action-btn:focus {
    outline: none !important;
    border: none !important;
    text-decoration: none !important;
}

.header-action-btn svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    color: #ffffff;
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 2 !important;
    pointer-events: none;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.header-action-btn svg circle,
.header-action-btn svg path,
.header-action-btn svg line {
    stroke: #ffffff !important;
    fill: none !important;
    opacity: 1 !important;
}

/* Cart Count Badge */
.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ff6348;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 4px;
    animation: cartBounce 0.5s ease, cartPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

@keyframes cartPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 71, 87, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 71, 87, 0.8); }
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Search Toggle Button - Simple Text Icon */
.header-actions .search-toggle {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 10;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: #ffffff !important;
    background: transparent !important;
}

.header-actions .search-toggle:hover {
    background: transparent !important;
}

/* Show SVG icon - same style as Account/Cart */
.header-actions .search-toggle svg {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure button is clickable */
button.search-toggle {
    pointer-events: auto !important;
    outline: none !important;
    cursor: pointer !important;
}

/* Mobile Menu Toggle (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    position: relative;
    z-index: 99999;
}

.mobile-menu-toggle svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    stroke: #ffffff !important;
}

.mobile-menu-toggle svg line {
    stroke: #ffffff !important;
    stroke-width: 2 !important;
}

/* CRITICAL: Force show on mobile */
@media only screen and (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 99999 !important;
    }
}

/* ============================================
   SEARCH BAR
   ============================================ */
.header-search-bar {
    background: #0d3050;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.header-search-bar.active {
    max-height: 100px;
    padding: 20px 0;
}

.header-search-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-field {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    color: #333;
}

.search-field:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    background: white;
}

.search-field::placeholder {
    color: #999;
}

.search-submit,
.search-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: white;
    color: #0d3050;
    border: none;
    cursor: pointer;
}

.search-submit:hover {
    background: #f0f0f0;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.search-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

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

.mobile-menu {
    position: fixed !important;
    top: 0 !important;
    right: -100%;
    width: 340px;
    max-width: 90%;
    height: 100vh !important;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

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

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    background: #0d3050;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.mobile-menu-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-close svg {
    stroke: #ffffff;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.mobile-menu-nav {
    padding: 20px 16px;
}

.mobile-menu-list {
    display: flex;
    flex-direction: column;
}

.mobile-menu-list li {
    width: 100%;
}

.mobile-menu-list > li {
    margin-bottom: 6px;
}

.mobile-menu-list > li > a {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.mobile-menu-list > li > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #0d3050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu-list > li > a:hover::before,
.mobile-menu-list > li.current-menu-item > a::before {
    transform: translateX(0);
}

.mobile-menu-list > li > a:hover {
    background: #ffffff;
    color: #0d3050;
    box-shadow: 0 4px 12px rgba(23, 83, 143, 0.15);
    transform: translateX(4px);
}

.mobile-menu-list > li.current-menu-item > a {
    background: rgba(23, 83, 143, 0.08);
    color: #0d3050;
    box-shadow: 0 4px 12px rgba(23, 83, 143, 0.12);
}

/* Mobile Submenu */
.mobile-menu-list ul.sub-menu {
    padding-left: 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    border-left: 2px solid rgba(23, 83, 143, 0.15);
    display: none;
}

.mobile-menu-list li.submenu-open > ul.sub-menu {
    display: block;
    animation: slideDown 0.3s ease;
}

.mobile-menu-list ul.sub-menu li {
    margin-bottom: 4px;
}

.mobile-menu-list ul.sub-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #5a6c7d;
    border-radius: 8px;
    background: transparent;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-menu-list ul.sub-menu a::before {
    content: '•';
    margin-right: 10px;
    color: #3AB8AE;
    font-size: 18px;
}

.mobile-menu-list ul.sub-menu a:hover {
    background: rgba(23, 83, 143, 0.05);
    color: #0d3050;
    padding-left: 20px;
}

/* Submenu Toggle Arrow */
.mobile-menu-list .menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease;
}

.mobile-menu-list .menu-item-has-children.submenu-open > a::after {
    transform: translateY(-30%) rotate(-135deg);
}

/* Custom Scrollbar for Mobile Menu */
.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: #0d3050;
    border-radius: 10px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: #0d3050;
}

/* ============================================
   STICKY HEADER
   ============================================ */
.custom-header.sticky {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets and below */
@media (max-width: 1024px) {
    .header-nav.desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .main-menu {
        gap: 4px;
    }
    
    .main-menu > li > a {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    /* Hide mega menu columns on mobile */
    .main-menu li.mega-menu > ul.sub-menu {
        grid-template-columns: 1fr;
    }
    
    /* Hide mini cart dropdown on mobile (tap to go to cart) */
    .mini-cart-dropdown {
        display: none;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --announcement-height: 38px;
    }
    
    .header-top-bar {
        display: none !important;
    }
    
    .custom-header {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .custom-header .container {
        padding: 0 16px;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .header-main {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0;
    }
    
    .header-main .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100% !important;
        gap: 8px;
    }
    
    /* Force mobile menu visible */
    .mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force desktop nav hidden */
    .header-nav.desktop-nav {
        display: none !important;
    }
    
    .header-logo {
        flex: 1;
        max-width: 150px;
    }
    
    .header-logo img {
        max-height: 40px;
        width: auto;
        height: auto;
    }
    
    .header-logo .site-name {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-actions {
        display: flex !important;
        gap: 4px;
        align-items: center;
        flex-shrink: 0;
    }
    
    .header-action-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .header-actions svg {
        width: 20px;
        height: 20px;
    }
    
    /* Ensure cart and search icons are visible */
    .cart-toggle,
    .search-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile Submenu Styles */
    .mobile-menu {
        width: 280px;
        top: 0 !important;
        height: 100vh !important;
    }
    
    /* Announcement bar adjustments */
    .announcement-item {
        font-size: 12px;
    }
    
    .announcement-item svg {
        width: 14px;
        height: 14px;
    }
    
    /* Mobile menu enhancements */
    .mobile-menu-list > li > a {
        font-size: 15px;
        padding: 14px 16px;
    }
    
    .mobile-menu-list ul.sub-menu {
        background: rgba(0, 0, 0, 0.02);
        border-radius: 8px;
        padding: 8px 0;
        margin-top: 8px;
    }
    
    .mobile-menu-list ul.sub-menu a {
        padding: 10px 16px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    :root {
        --header-height: 65px;
    }
    
    .custom-header .container {
        padding: 0 12px;
    }
    
    .header-main .container {
        gap: 6px;
    }
    
    .header-logo {
        max-width: 120px;
    }
    
    .header-logo img {
        max-height: 35px;
    }
    
    .header-logo .site-name {
        font-size: 16px;
    }
    
    .header-actions {
        gap: 2px;
    }
    
    .header-action-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px;
    }
    
    .header-actions svg {
        width: 18px;
        height: 18px;
    }
    
    .cart-count {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        padding: 2px 4px;
    }
    
    .mobile-menu-toggle {
        width: 36px !important;
        height: 36px !important;
    }
    
    .mobile-menu-toggle svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Mobile menu positioning for small screens */
    .mobile-menu {
        top: 0 !important;
        height: 100vh !important;
        width: 260px;
    }
}


/* ============================================
   MEGA MENU SUPPORT
   ============================================ */
.main-menu li.mega-menu {
    position: static;
}

.main-menu li.mega-menu > ul.sub-menu {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 24px;
    z-index: 9999999 !important;
}

.main-menu li.mega-menu ul.sub-menu > li {
    width: auto;
}

.main-menu li.mega-menu ul.sub-menu > li > a {
    font-weight: 700;
    font-size: 15px;
    color: var(--header-primary);
    padding: 8px 0;
    margin-bottom: 8px;
}

.main-menu li.mega-menu ul.sub-menu ul {
    padding-left: 0;
    margin-top: 8px;
}

.main-menu li.mega-menu ul.sub-menu ul li a {
    font-weight: 500;
    font-size: 13px;
    padding: 6px 0;
}

/* ============================================
   ENHANCED ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 0px rgba(58, 184, 174, 0));
    }
    50% { 
        filter: drop-shadow(0 0 8px rgba(58, 184, 174, 0.6));
    }
}

/* ============================================
   KEYBOARD SHORTCUT HINT
   ============================================ */
.search-toggle::after {
    content: 'Ctrl+K';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.search-toggle:hover::after {
    opacity: 1;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid var(--header-bg);
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.header-main {
    animation: fadeInUp 0.5s ease;
}

.mobile-menu.active {
    animation: slideInRight 0.3s ease;
}

.cart-count {
    animation: pulse 0.6s ease;
}

/* Smooth hover transitions */
.header-action-btn,
.main-menu > li > a,
.top-bar-item,
.top-bar-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple Effect */
.header-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(58, 184, 174, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.header-action-btn:active::before {
    width: 100px;
    height: 100px;
}

/* ============================================
   SCROLL EFFECTS - DISABLED TO PREVENT BLANKING
   ============================================ */
/* PROBLEM: These height changes caused infinite loop:
   1. .scrolled class added
   2. Height changes to 0
   3. Scroll position jumps
   4. .scrolled class removed
   5. Heights restore
   6. Scroll position jumps again
   7. Infinite loop = BLANKING EFFECT
*/

/*
.custom-header.scrolled .header-announcement-bar {
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.custom-header.scrolled .header-top-bar {
    height: 0;
    opacity: 0;
    overflow: hidden;
    border: none;
}

.custom-header.scrolled .header-main {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
*/

/* ALL SCROLL EFFECTS DISABLED - Header stays consistent */

/* ============================================
   UTILITY CLASSES
   ============================================ */
.no-scroll {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* iOS Safari fix for body scroll lock */
body.no-scroll {
    touch-action: none;
    -webkit-overflow-scrolling: auto;
}

/* ============================================
   MEGA MENU Z-INDEX FIX - ENSURE ABOVE ALL SECTIONS
   ============================================ */
.main-menu ul.sub-menu,
.main-menu li.mega-menu > ul.sub-menu,
.woodmart-navigation .sub-menu,
.woodmart-navigation .sub-menu-dropdown,
.dropdown-menu,
nav ul.sub-menu {
    z-index: 9999999 !important;
    position: fixed !important;
}

/* Ensure header and navigation have proper stacking context */
.site-header,
.header-main-content,
.main-navigation,
.main-menu {
    position: relative;
    z-index: 100000 !important;
}

/* Ensure sections don't overlap menus */
section,
.hero-slider-section,
.product-bundles-section,
main {
    position: relative;
    z-index: 1 !important;
}
