/**
 * ============================================
 * MEGA MENU STYLES (Optimized)
 * ============================================
 * Add this to your theme's CSS or enqueue as separate file
 */

/* ============================================
   YAMM Base Mega Menu Styles
   ============================================ */
.yamm .dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    padding: 20px;
    border: none;
    box-shadow: 0 6px 12px rgba(0,0,0,0.175);
    border-radius: 0;
}

.yamm .dropdown.yamm-fw .dropdown-menu {
    left: 0;
    right: 0;
}

.yamm .nav > li > .dropdown-menu {
    margin-top: 0;
}

/* Stop propagation on mega menu clicks */
.yamm .dropdown-menu {
    pointer-events: auto;
}

/* Center mega menu content inside container */
.infoera-megamenu .dropdown-menu > li {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   Custom Grid Columns
   ============================================ */
.col-sm-15 {
    width: 20%; /* 100% / 5 columns */
    float: left;
    padding: 0 15px;
}

.col-sm-45 {
    width: 75%; /* 4 columns out of 5 */
    float: left;
    padding: 0 15px;
}

/* ============================================
   Mega Menu Offer Titles
   ============================================ */
.infoera-offer-title {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.infoera-offer-title h3 {
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 15px;
    margin-top: 0;
}

.infoera-offer-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.infoera-offer-title a:hover {
    color: #0a7db8;
}

/* ============================================
   Mega Menu Lists
   ============================================ */
.infoera-offer-list {
    padding: 15px 10px;
}

.infoera-offer-list > span {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

/* ============================================
   Mega Menu Columns
   ============================================ */
.infoera-megamenu-column {
    list-style: none;
    padding: 0;
    margin: 0;
}

.infoera-megamenu-column li {
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
}

.infoera-megamenu-column li:last-child {
    border-bottom: none;
}

.infoera-megamenu-column a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: all 0.3s ease;
    font-size: 14px;
}

.infoera-megamenu-column a:hover {
    color: #0a7db8;
    padding-left: 5px;
}

/* Submenu items in mega menu columns */
.infoera-megamenu-column .sub-menu,
.infoera-megamenu-column .is-hidden {
    padding-left: 15px;
    margin-top: 5px;
}

.infoera-megamenu-column .sub-menu li,
.infoera-megamenu-column .is-hidden li {
    padding: 3px 0;
}

.infoera-megamenu-column .sub-menu a,
.infoera-megamenu-column .is-hidden a {
    font-size: 13px;
    color: #777;
}

/* Go back button for mobile mega menu navigation */
.infoera-megamenu-column .go-back a:before {
    content: "← ";
}

/* ============================================
   Mega Menu Button Row
   ============================================ */
.infoera-btn-row {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    clear: both;
}

.infoera-btn-row .btn-primary {
    padding: 10px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   First Level Menu Items
   ============================================ */
.infoera-first-level-item {
    font-weight: 500;
    position: relative;
}

/* ============================================
   Dropdown & Mega Menu Behavior
   ============================================ */

/* IMPORTANT: Remove hover behavior - use click only */
/* Bootstrap 3 uses 'open' class, Bootstrap 4+ uses 'show' class */

/* Hide dropdowns by default */
.dropdown-menu {
    display: none;
    margin-top: 0;
    border-radius: 0;
    border: none;
    box-shadow: 0 6px 12px rgba(0,0,0,0.175);
}

/* Show dropdown when parent has 'open' class (Bootstrap 3) */
.dropdown.open > .dropdown-menu,
.infoera-megamenu.open > .dropdown-menu {
    display: block !important;
}

/* Show dropdown when it has 'show' class (Bootstrap 4+) */
.dropdown-menu.show {
    display: block !important;
}

/* Mega menu specific dropdown - FULL WIDTH across entire viewport */
.infoera-megamenu > .dropdown-menu {
    position: fixed !important;
    width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #fff;
    z-index: 1000;
}

.infoera-megamenu.yamm-fw > .dropdown-menu {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
}

/* Add white background and padding to mega menu */
.infoera-megamenu .dropdown-menu {
    background-color: #fff;
    padding: 30px 0;
}

/* Regular dropdowns stay relative to parent */
.navbar-nav > li.dropdown:not(.infoera-megamenu) > .dropdown-menu {
    position: absolute;
}

/* ============================================
   Search Button in Navigation
   ============================================ */
.infoera-search-btn {
    cursor: pointer;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.infoera-search-btn:hover {
    color: #0a7db8;
}

.infoera-search-btn.search-is-visible {
    color: #0a7db8;
}

/* ============================================
   Mobile Navigation & Mega Menu
   ============================================ */
@media (max-width: 768px) {
    /* Reset column widths */
    .col-sm-15,
    .col-sm-45 {
        width: 100%;
        float: none;
    }

    /* Make dropdown static on mobile */
    .yamm .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
    }

    .infoera-megamenu > .dropdown-menu {
        position: static;
    }

    /* Stack mega menu columns */
    .infoera-offer-list {
        margin-bottom: 20px;
    }

    /* Mobile mega menu navigation */
    .infoera-megamenu-column .is-hidden {
        display: none !important;
    }

    .infoera-megamenu-column .has-children > a:after {
        content: " →";
        float: right;
    }

    .infoera-megamenu-column .go-back {
        background: #f5f5f5;
        font-weight: bold;
        border-bottom: 2px solid #ddd;
    }
}

/* ============================================
   Tablet Adjustments
   ============================================ */
@media (min-width: 769px) and (max-width: 991px) {
    .col-sm-15 {
        width: 33.33%; /* 3 columns on tablet */
    }

    .col-sm-45 {
        width: 66.66%;
    }
}

/* ============================================
   Additional Mega Menu States
   ============================================ */
.moves-out {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.has-children.selected > a {
    font-weight: bold;
    color: #0a7db8;
}

/* Hide submenu by default in mega menu */
.infoera-megamenu .is-hidden {
    display: none;
}

/* ============================================
   Accessibility Improvements
   ============================================ */
.dropdown-menu a:focus,
.infoera-megamenu-column a:focus {
    outline: 2px solid #0a7db8;
    outline-offset: 2px;
}

/* ============================================
   Animation & Transitions
   ============================================ */
/* Removed hover-based animations - using Bootstrap's default click behavior */

/* ============================================
   Fix for Bootstrap 3 Compatibility
   ============================================ */
@media (min-width: 768px) {
    .navbar-nav > li > .dropdown-menu {
        margin-top: 0;
    }
}