/**
 * Mega Menu Styles for HOCR
 * Three-column dropdown menu for navigation items
 */

/* Mega menu container */
.shop-main-navigation .wp-block-navigation__container {
    position: relative;
}

/* Menu items with mega menu */
.shop-main-navigation .wp-block-navigation-item {
    position: static;
}

.shop-main-navigation .wp-block-navigation__container {
    position: static;
}

/* Increase hover area for menu items */
.shop-main-navigation .wp-block-navigation-item > a {
    display: block;
    padding: 0.5rem 1rem;
}

/* Mega menu dropdown */
.mega-menu-dropdown {
    position: fixed;
    top: var(--menu-offset-y, auto);
    left: var(--menu-offset-x, 50%);
    transform: translateY(-10px);
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    padding: 2.5rem 0;
    max-width: 1000px;
    width: 90%;
}

/* Position mega menu below the navigation bar */
.shop-navigation-bar {
    position: relative;
}

.has-mega-menu .mega-menu-dropdown {
    margin-top: 0;
}

/* Show mega menu on hover */
.wp-block-navigation-item:hover .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega menu content wrapper */
.mega-menu-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Mega menu column */
.mega-menu-column {
    padding: 0;
}

.mega-menu-column h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: #3d3d3d;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 0.75rem;
}

/* Mega menu links */
.mega-menu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-column ul li {
    margin-bottom: 0.75rem;
}

.mega-menu-column ul li a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    display: block;
    padding: 0.25rem 0;
}

.mega-menu-column ul li a:hover {
    color: #000;
    padding-left: 5px;
}

/* Special styling for "Shop All" and featured links */
.mega-menu-column ul li.shop-all a {
    font-weight: 600;
    color: #3d3d3d;
}

.mega-menu-column ul li.new-items a {
    color: #ff6b35;
    font-weight: 500;
}

/* Blog posts in mega menu */
.mega-menu-blog-post {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.mega-menu-blog-post:last-child {
    border-bottom: none;
}

.mega-menu-blog-date {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.5rem;
    display: block;
}

.mega-menu-blog-post a {
    color: #3d3d3d;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
    transition: color 0.2s ease;
}

.mega-menu-blog-post a:hover {
    color: #ff6b35;
}

/* Ensure parent menu items with mega menu have dropdown indicator */
.has-mega-menu > a::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    vertical-align: middle;
}

/* Hamburger Menu Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10001;
}

.mobile-menu-toggle .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    height: 22px;
}

.mobile-menu-toggle .hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #3d3d3d;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger animation when open */
.mobile-menu-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
}

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

.mobile-menu-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
}

/* Mobile Menu Panel */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: #ffffff;
    box-shadow: none;
    transition: right 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    padding: 5rem 2rem 2rem;
}

.mobile-menu-panel.active {
    right: 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

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

/* Mobile Menu Sections */
.mobile-menu-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.mobile-menu-section:last-child {
    border-bottom: none;
}

.mobile-menu-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 1rem;
}

.mobile-menu-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-section ul li {
    margin-bottom: 0.75rem;
}

.mobile-menu-section ul li a {
    color: #3d3d3d;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.mobile-menu-section ul li a:hover {
    color: #ff6b35;
}

/* Main nav items in mobile menu */
.mobile-main-nav-item {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Expandable submenu for mobile */
.mobile-submenu-toggle {
    margin-left: auto;
    font-size: 1.2rem;
    color: #999;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .mega-menu-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Show hamburger button */
    .mobile-menu-toggle {
        display: block !important;
    }

    /* Hide desktop header-top and navigation on mobile */
    .header-top,
    .shop-navigation-bar {
        display: none !important;
    }

    .shop-main-navigation {
        display: none !important;
    }

    /* Hide mega menu on mobile */
    .mega-menu-dropdown {
        display: none;
    }

    /* Header-middle: Convert to grid layout */
    .header-middle {
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5rem 1rem;
        align-items: center;
        padding: 1rem !important;
    }

    /* Hamburger - top left, flush to edge */
    .header-middle .mobile-menu-toggle {
        grid-column: 1;
        grid-row: 1;
        order: 1;
        justify-self: start;
        margin: 0;
        padding-left: 0;
    }

    /* Columns container - rearrange children */
    .header-middle .wp-block-columns {
        display: contents !important;
    }

    /* Logo column - top center */
    .header-middle .wp-block-columns > .wp-block-column:nth-child(1) {
        grid-column: 2;
        grid-row: 1;
        order: 2;
        justify-self: center;
        flex-basis: auto !important;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .header-middle .wp-site-logo {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .header-middle .wp-site-logo img {
        width: 150px;
        height: auto;
    }

    /* Wishlist column - top right, flush to edge */
    .header-middle .wp-block-columns > .wp-block-column:nth-child(3) {
        grid-column: 3;
        grid-row: 1;
        order: 3;
        justify-self: end;
        margin: 0;
        flex-basis: auto !important;
    }

    /* Search column - row 2, full width with left and right padding */
    .header-middle .wp-block-columns > .wp-block-column:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
        order: 4;
        width: 100%;
        padding: 0 0 !important;
        flex-basis: 100% !important;
    }

    .header-middle .wp-block-columns > .wp-block-column:nth-child(2) .searchbar {
        width: 100%;
    }
}

/* Full width mega menu overlay effect - REMOVED */
.shop-navigation-bar {
    position: relative;
}

/* Overlay disabled - no dark background */
.mega-menu-overlay {
    display: none;
}
