/*
Theme Name: MH Alerts Pro SEO Edition
Theme URI: https://mhalerts.com
Author: Automation Pipeline
Description: Ultimate SEO theme with Page Layout Controls, Fixed Breadcrumbs, Category Boards, and Custom Templates.
Version: 12.2.0
Text Domain: mhalerts-pro
*/

/* VARIABLES */
:root {
    --bg-color: #f4f7f6;
    --surface-color: #ffffff;
    --footer-bg: #03081F;
    --text-primary: #1A1A2E;
    --text-secondary: #6B7280;
    --accent: #FFD600; 
    --accent-glow: rgba(255, 214, 0, 0.4);
    --primary: #081B4B; 
    --border-color: #e5e7eb;
    
    --logo-width-desktop: 250px;
    --logo-width-mobile: 180px;
    --footer-logo-width: 250px;
    --title-size: 28px;
    --header-dir: row;
    --header-justify: space-between;
}

* { box-sizing: border-box; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }

body { 
    margin: 0; font-family: 'Yantramanav', 'Noto Sans Devanagari', sans-serif; 
    background-color: var(--bg-color); color: var(--text-primary); 
    line-height: 1.6; overflow-x: hidden; 
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}
a { text-decoration: none; color: var(--primary); transition: 0.2s; }

@media print { body { display: none !important; } }

/* HEADER LAYOUT */
.site-header { background: var(--surface-color); padding: 15px 5%; display: flex; flex-wrap: wrap; flex-direction: var(--header-dir); justify-content: var(--header-justify); align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: -1px; z-index: 1000; border-bottom: 3px solid var(--accent); }
.site-branding { display: flex; align-items: center; justify-content: center; }
.site-branding a { font-size: var(--title-size); font-weight: 900; color: var(--primary); display: flex; align-items: center; gap: 8px; line-height: 1.1; }
.site-branding span { color: var(--accent); }
.site-branding img.custom-logo { width: var(--logo-width-desktop); max-width: 100%; height: auto; object-fit: contain; }

.header-auth-container { margin-left: 20px; }
.header-auth-btn { background: var(--primary); color: #fff !important; padding: 8px 18px; border-radius: 6px; font-weight: 700; font-size: 16px; border: 2px solid var(--primary); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.header-auth-btn:hover { background: var(--accent); color: #000 !important; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.main-navigation { display: flex; align-items: center; }
.menu-wrapper { display: flex; align-items: center; }
.primary-menu { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.primary-menu li a { color: var(--text-primary); font-weight: 700; font-size: 18px; padding: 5px 10px; border-radius: 6px; }
.primary-menu li a:hover { background: var(--bg-color); color: var(--primary); }
.menu-toggle { display: none; background: transparent; color: var(--primary); border: none; padding: 5px; cursor: pointer; align-items: center; justify-content: center; }
.mobile-search { display: none; }

.progress-container { width: 100%; height: 5px; background: transparent; position: absolute; bottom: -5px; left: 0; }
.progress-bar { height: 5px; background: var(--accent); width: 0%; box-shadow: 0 0 15px var(--accent-glow); transition: width 0.1s; }

.news-ticker { background: #fff; display: flex; align-items: center; border-bottom: 1px solid var(--border-color); font-weight: 700; font-size: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.ticker-label { background: #E63946; color: #fff; padding: 8px 15px; white-space: nowrap; font-weight: 900; position: relative; z-index: 2; }
.news-ticker marquee { padding: 8px 0; color: var(--text-primary); flex-grow: 1; }
.news-ticker a { color: var(--primary); margin-right: 30px; }
.news-ticker a:hover { color: #E63946; text-decoration: underline; }

.ad-space { text-align: center; margin: 20px auto; min-height: 90px; background: rgba(0,0,0,0.02); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-color); color: #aaa; font-size: 12px; width: 100%; max-width: 100%; overflow: hidden; box-sizing: border-box; }

.breadcrumbs { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 20px; padding: 10px 15px; background: #fff; border-radius: 8px; border: 1px solid var(--border-color); }
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { color: #E63946; }
.breadcrumbs .current { color: #E63946; }

.hero-section { background: linear-gradient(135deg, var(--primary), #1A3673); color: #fff; padding: 40px 20px; text-align: center; border-bottom: 5px solid var(--accent); position: relative; overflow: hidden; width: 100%; }
.hero-section h1 { font-size: 38px; font-weight: 900; margin: 0 0 10px 0; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.hero-section p { font-size: 18px; color: #cbd5e1; margin: 0; max-width: 800px; margin: 0 auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; width: 100%; box-sizing: border-box; }
.section-title { font-size: 26px; font-weight: 900; border-left: 6px solid #E63946; padding-left: 15px; margin-bottom: 25px; display: flex; align-items: center; gap: 10px; }

.quick-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-bottom: 40px; }
.quick-link-box { background: #fff; border: 2px solid var(--border-color); padding: 15px; text-align: center; border-radius: 12px; font-weight: 900; font-size: 18px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); color: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 80px; line-height: 1.2; }
.quick-link-box:hover { border-color: var(--accent); background: var(--primary); color: #fff; transform: translateY(-3px); box-shadow: 0 10px 20px var(--accent-glow); }

/* HOMEPAGE CATEGORY BOARDS GRID (2x2 Layout) */
.category-boards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-bottom: 40px; }
.board-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.04); display: flex; flex-direction: column; }
.board-header { padding: 14px 20px; font-weight: 900; font-size: 19px; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.board-header.bg-jobs { background: #081B4B; border-bottom: 3px solid #FFD600; }
.board-header.bg-quiz { background: #7C3AED; border-bottom: 3px solid #C4B5FD; }
.board-header.bg-news { background: #DC2626; border-bottom: 3px solid #FCA5A5; }
.board-header.bg-yojna { background: #2563EB; border-bottom: 3px solid #93C5FD; }
.board-header a { color: #fff; font-size: 13px; font-weight: 700; background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 4px; text-decoration: none; }
.board-header a:hover { background: #fff; color: #000; }
.board-list { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.board-list li { border-bottom: 1px solid var(--border-color); padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.board-list li:last-child { border-bottom: none; }
.board-list li a { font-weight: 700; color: var(--text-primary); font-size: 15px; line-height: 1.4; display: block; }
.board-list li a:hover { color: #E63946; }
.board-new-badge { font-size: 11px; background: #E63946; color: #fff; padding: 2px 6px; border-radius: 4px; font-weight: 900; white-space: nowrap; }

/* CARDS */
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.job-card { background: var(--surface-color); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); display: flex; flex-direction: column; width: 100%; box-sizing: border-box; }
.job-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--primary); }
.job-card img { width: 100%; height: auto; border-bottom: 1px solid var(--border-color); }
.job-card-content { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.job-card h3 { font-size: 19px; margin: 0 0 10px 0; font-weight: 800; line-height: 1.3; }
.job-card a.read-more { margin-top: auto; display: block; background: var(--primary); color: #fff; text-align: center; padding: 10px; border-radius: 6px; font-weight: 700; font-size: 16px; border-bottom: 3px solid #051029; }
.job-card a.read-more:hover { background: var(--accent); color: #000; border-bottom-color: #cca800; }

/* PAGINATION */
.pagination { text-align: center; margin-top: 40px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; padding: 10px 18px; background: var(--surface-color); color: var(--primary); font-weight: 700; border-radius: 8px; border: 1px solid var(--border-color); }
.pagination a:hover { background: var(--accent); border-color: var(--accent); color: #000; }
.pagination span.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* SINGLE POST CORE */
.single-container { margin: 20px auto; background: var(--surface-color); padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); width: 100%; box-sizing: border-box; }

/* PAGE LAYOUT OPTIONS (META BOX SETTINGS) */
.layout-full-width { max-width: 100% !important; margin: 0 !important; border-radius: 0 !important; border: none !important; box-shadow: none !important; padding: 30px 5% !important; }
.layout-boxed { max-width: 900px !important; margin: 30px auto !important; }

.single-container img { max-width: 100%; height: auto; border-radius: 10px; margin-bottom: 20px; display: block; }
.entry-title { font-size: 32px; font-weight: 900; margin-bottom: 15px; line-height: 1.3; color: var(--primary); word-wrap: break-word; }
.entry-meta { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed var(--border-color); font-weight: 700; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.entry-content { font-size: 18px; line-height: 1.7; word-wrap: break-word; overflow-x: hidden; }
.entry-content h2, .entry-content h3 { color: var(--primary); margin-top: 25px; padding-bottom: 5px; }
.entry-content table { width: 100% !important; max-width: 100%; overflow-x: auto; display: block; }

/* CATEGORY SPECIFIC HEADERS */
.cat-header-box { padding: 20px; border-radius: 10px; color: white; margin-bottom: 25px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.1); position: relative; overflow: hidden; }
.cat-header-box h1 { margin: 10px 0 5px 0; color: #fff; font-size: 30px; position: relative; z-index: 2; text-shadow: 1px 1px 3px rgba(0,0,0,0.3); }
.cat-header-box p { margin: 0; font-size: 16px; opacity: 0.95; position: relative; z-index: 2; font-weight: 500; }
.cat-header-icon { font-size: 35px; position: relative; z-index: 2; line-height: 1; display: inline-block; padding: 10px; background: rgba(255,255,255,0.2); border-radius: 50%; }

/* CUSTOM FORM STYLES (LOGIN/REGISTER/CONTACT) */
.custom-form-wrapper { max-width: 500px; margin: 0 auto; background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); border: 2px solid var(--primary); width: 100%; box-sizing: border-box; }
.custom-form-wrapper input[type="text"], .custom-form-wrapper input[type="password"], .custom-form-wrapper input[type="email"], .custom-form-wrapper textarea { width: 100%; padding: 12px; margin-top: 8px; margin-bottom: 20px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 16px; font-family: inherit; box-sizing: border-box; }
.custom-form-wrapper input[type="text"]:focus, .custom-form-wrapper input[type="password"]:focus, .custom-form-wrapper input[type="email"]:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(8, 27, 75, 0.1); }
.custom-form-wrapper input[type="submit"], .custom-form-wrapper button { background: var(--primary); color: #fff; border: none; padding: 12px 25px; font-size: 18px; font-weight: 900; border-radius: 6px; cursor: pointer; width: 100%; transition: 0.3s; box-sizing: border-box; }
.custom-form-wrapper input[type="submit"]:hover, .custom-form-wrapper button:hover { background: var(--accent); color: #000; }
.custom-form-wrapper label { font-weight: 700; color: var(--primary); display: block; }

.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn { padding: 6px 12px; border-radius: 5px; font-weight: 700; color: #fff !important; font-size: 13px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.share-wa { background: #25D366; }
.share-fb { background: #1877F2; }
.share-tg { background: #0088cc; }

.disclaimer-warning { background: #fff0f0; border-left: 5px solid #E63946; padding: 15px 20px; border-radius: 8px; margin: 25px 0; font-size: 16px; font-weight: 700; color: #d32f2f; line-height: 1.5; word-wrap: break-word; }

.join-community-box { background: #FFF9F2; border: 2px dashed #FFD600; border-radius: 12px; padding: 25px; text-align: center; margin: 30px 0; box-shadow: 0 8px 20px rgba(255, 214, 0, 0.15); }
.join-community-box h3 { color: #E63946; margin-top: 0; font-size: 24px; font-weight: 900; line-height: 1.3; }
.join-community-box p { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; line-height: 1.4; }
.join-buttons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.btn-wa, .btn-tg { padding: 12px 25px; border-radius: 50px; font-weight: 900; font-size: 16px; color: #fff !important; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn-wa { background: linear-gradient(135deg, #25D366, #128C7E); border-bottom: 3px solid #075E54; }
.btn-tg { background: linear-gradient(135deg, #0088cc, #005A9E); border-bottom: 3px solid #003F6E; }

/* 3-COLUMN FOOTER STYLES */
.site-footer { background: var(--footer-bg); color: #cbd5e1; padding: 60px 5% 30px; margin-top: 60px; text-align: left; font-family: 'Noto Sans Devanagari', sans-serif; overflow-x: hidden; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; max-width: 1200px; margin: 0 auto; }
.footer-col-1 img { width: var(--footer-logo-width); max-width: 100%; height: auto; margin-bottom: 20px; background: #fff; padding: 10px; border-radius: 8px; } 
.footer-about { font-size: 16px; line-height: 1.6; margin-bottom: 25px; color: #f8fafc; font-weight: 500; }
.footer-social { display: flex; gap: 15px; flex-wrap: wrap; }
.footer-social a { color: #fff; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; transition: 0.3s; }
.footer-social a:hover { color: var(--accent); }
.footer-social svg { width: 22px; height: 22px; fill: currentColor; }

.footer-col h3 { color: #ffffff; font-size: 24px; font-weight: 700; margin-top: 0; margin-bottom: 25px; }
.footer-menu { list-style: none; padding: 0; margin: 0; }
.footer-menu li { margin-bottom: 15px; }
.footer-menu li a { color: #f8fafc; font-size: 17px; font-weight: 500; transition: 0.2s; word-wrap: break-word; }
.footer-menu li a:hover { color: var(--accent); text-decoration: underline; }

.footer-bottom { max-width: 1200px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 500; color: #f8fafc; flex-wrap: wrap; gap: 15px; }
.footer-bottom a { color: #f8fafc; }
.footer-bottom a:hover { color: var(--accent); }

.mobile-fixed-footer { display: none; }

@media (max-width: 768px) {
    body { padding-bottom: 90px; }
    .site-branding img.custom-logo { width: var(--logo-width-mobile); }
    .site-header { justify-content: space-between; position: sticky; top: 0; z-index: 9999; padding: 10px 5%; } 
    .header-auth-btn { padding: 6px 12px; font-size: 14px; }
    .menu-toggle { display: flex; }
    .menu-wrapper { position: absolute; top: 100%; left: 0; width: 100%; background: var(--surface-color); box-shadow: 0 15px 30px rgba(0,0,0,0.15); border-top: 1px solid var(--border-color); flex-direction: column; padding: 20px; gap: 15px; display: none; }
    .menu-wrapper.active { display: flex; animation: slideDown 0.3s ease forwards; }
    .mobile-search { display: flex; width: 100%; margin-bottom: 10px; }
    .search-form { display: flex; width: 100%; }
    .search-field { flex: 1; padding: 12px 15px; border: 2px solid var(--border-color); border-radius: 8px 0 0 8px; font-size: 16px; width: 100%; }
    .search-submit { padding: 0 15px; font-size: 18px; }
    .primary-menu { display: flex; width: 100%; flex-direction: column; gap: 8px; }
    .primary-menu li a { display: block; padding: 12px 15px; font-size: 16px; }
    .header-auth-container { margin-left: 0; margin-top: 10px; width: 100%; }
    .header-auth-btn { padding: 12px 15px; font-size: 16px; width: 100%; justify-content: center; }
    .news-ticker { font-size: 14px; flex-wrap: wrap; }
    .ticker-label { width: 100%; text-align: center; border-radius: 0; }
    .news-ticker marquee { padding: 8px 10px; }
    .hero-section { padding: 30px 15px; }
    .hero-section h1 { font-size: 26px; line-height: 1.3; }
    .container { padding: 20px 15px; }
    .single-container { margin: 15px auto; padding: 20px 15px; border-radius: 8px; }
    .entry-title { font-size: 24px !important; line-height: 1.4; }
    .cat-header-box h1 { font-size: 22px !important; }
    .cat-header-box { padding: 15px; }
    .entry-content { font-size: 16px; line-height: 1.6; overflow-wrap: break-word; word-wrap: break-word; }
    .category-boards-grid { grid-template-columns: 1fr; }
    .quick-links-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .footer-top { grid-template-columns: 1fr; gap: 30px; text-align: left; }
    .footer-bottom { flex-direction: column; text-align: center; justify-content: center; gap: 10px; }
    .mobile-fixed-footer { display: flex; position: fixed; bottom: 0; left: 0; right: 0; width: 100%; background: var(--surface-color); box-shadow: 0 -4px 15px rgba(0,0,0,0.1); z-index: 1000; justify-content: space-around; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 2px solid var(--accent); }
    .mobile-fixed-footer a { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 12px; font-weight: 700; text-decoration: none; width: 33%; }
    .mobile-fixed-footer a svg { width: 22px; height: 22px; margin-bottom: 4px; fill: currentColor; }
    .mobile-fixed-footer a.home-link { color: var(--primary); }
    .mobile-fixed-footer a.wa-link { color: #25D366; }
    .mobile-fixed-footer a.tg-link { color: #0088cc; }
    .site-footer { padding-bottom: 90px; }
}

/* =========================================================
   PREMIUM DROPDOWN, MEGA MENU & MOBILE FIX
   ========================================================= */

/* 1. Fix the Parent Menu Item & Auto-Add Arrow */
.primary-menu li {
    position: relative;
}

/* Automatically add an arrow to items with a dropdown */
.primary-menu li.menu-item-has-children > a::after {
    content: " ▾";
    font-size: 14px;
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Flip the arrow upside down on hover */
.primary-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* =========================================================
   2. DESKTOP STYLES (Floating Dropdown)
   ========================================================= */
@media (min-width: 769px) {
    .primary-menu li ul.sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #ffffff;
        box-shadow: 0 10px 30px rgba(8, 27, 75, 0.15); /* Premium deep shadow */
        border-radius: 12px;
        padding: 10px 0;
        min-width: 260px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid #e5e7eb;
        z-index: 9999;
        list-style: none !important;
        margin: 0 !important;
    }

    /* Smart alignment for last items so they don't overflow the screen */
    .primary-menu li:last-child ul.sub-menu,
    .primary-menu li:nth-last-child(2) ul.sub-menu {
        left: auto;
        right: 0;
    }

    /* Hover Animation */
    .primary-menu li:hover > ul.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Clean List Items */
    .primary-menu li ul.sub-menu li {
        list-style: none !important;
        padding: 0;
        margin: 0;
        border-bottom: 1px solid #f4f7f6;
        position: relative;
    }

    .primary-menu li ul.sub-menu li:last-child {
        border-bottom: none;
    }

    /* Link Styling & Sliding Hover Effect */
    .primary-menu li ul.sub-menu li a {
        padding: 12px 20px;
        font-weight: 600;
        font-size: 15px;
        border-radius: 0;
        display: block;
        color: #1A1A2E;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .primary-menu li ul.sub-menu li a:hover {
        background: #f8fafc;
        color: #081B4B; 
        padding-left: 28px;
    }

    /* Multi-Column Mega Menu (Desktop Only) */
    .primary-menu li.mega-menu ul.sub-menu {
        min-width: 500px;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        padding: 15px;
        gap: 10px;
    }

    .primary-menu li.mega-menu ul.sub-menu li {
        border-bottom: none;
    }

    .primary-menu li.mega-menu ul.sub-menu li a {
        border-radius: 8px;
        padding: 10px 15px;
    }

    .primary-menu li.mega-menu ul.sub-menu li a:hover {
        background: #f4f7f6;
        padding-left: 15px;
        transform: translateX(5px);
    }
}

/* =========================================================
   3. MOBILE STYLES (Smooth Stacked Accordion)
   ========================================================= */
@media (max-width: 768px) {
    /* Reset absolute positioning for mobile */
    .primary-menu li ul.sub-menu {
        position: static;
        display: none; /* Hidden by default */
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px; /* Indent the dropdown visually */
        margin: 0 !important;
        list-style: none !important;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    /* Show dropdown when tapping on mobile */
    .primary-menu li.menu-item-has-children:hover > ul.sub-menu,
    .primary-menu li.menu-item-has-children:focus-within > ul.sub-menu {
        display: block !important;
    }

    .primary-menu li ul.sub-menu li {
        border-bottom: 1px solid #e5e7eb;
    }

    .primary-menu li ul.sub-menu li a {
        padding: 12px 15px;
        font-size: 15px;
        font-weight: 600;
        display: block;
        color: #1A1A2E;
    }

    /* Disable the Mega Menu Grid on Mobile so it stacks nicely */
    .primary-menu li.mega-menu ul.sub-menu {
        min-width: 100%;
        display: none !important; /* Let the hover/focus rule show it as a standard block */
    }
    .primary-menu li.mega-menu:hover > ul.sub-menu,
    .primary-menu li.mega-menu:focus-within > ul.sub-menu {
        display: block !important;
    }
}

/* =========================================================
   MOBILE MENU SCROLL FIX 
   ========================================================= */
@media (max-width: 768px) {
    .menu-wrapper {
        /* Restricts the menu height so it doesn't bleed off the screen */
        max-height: calc(100vh - 70px); 
        
        /* Enables smooth vertical scrolling inside the menu */
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iPhones */
        
        /* Adds extra space at the bottom so the last item is never hidden */
        padding-bottom: 50px !important; 
    }
    
    /* Ensure the search bar inside mobile menu doesn't get squished */
    .mobile-search {
        flex-shrink: 0; 
    }
}