/* =====================================================
   LATTIA MEGA MENU
   public/css/megamenu.css
   =====================================================
   Uses existing CSS vars from newmarketing.css:
   --green-primary, --green-primary-light, --green-dark,
   --green-bg-lighter, --green-bg-light, --green-accent,
   --gray-50 through --gray-900, --shadow-*
   ===================================================== */


/* =====================
   STICKY NAV ADJUSTMENT
   ===================== */
   .navbar.sticky-top {
    z-index: 1040;
    box-shadow: none;
    transition: box-shadow 0.3s ease;
}

.navbar.sticky-top.is-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}


/* =====================
   DESKTOP MEGA TRIGGER
   ===================== */
.mega-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.mega-chevron {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
    margin-top: 1px;
}

.mega-chevron.is-rotated {
    transform: rotate(180deg);
}


/* =====================
   BACKDROP
   ===================== */
.mega-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    z-index: 1029;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.mega-menu-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}


/* =====================
   MEGA MENU PANEL
   ===================== */
.mega-menu {
    position: fixed;
    top: 73px; /* Navbar height */
    left: 0;
    right: 0;
    z-index: 1035;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 4px 20px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    max-height: calc(100vh - 73px);
    overflow-y: auto;
}

.mega-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-inner {
    display: flex;
    gap: 0;
    padding: 2rem 0;
}


/* =====================
   LEFT: FEATURE COLUMNS
   ===================== */
.mega-features {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding-right: 2rem;
    border-right: 1px solid var(--gray-200);
}

.mega-col {
    padding: 0 1rem;
}

.mega-col:first-child {
    padding-left: 0;
}

.mega-col-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-600);
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
}

.mega-col-header i {
    font-size: 0.75rem;
    color: var(--green-primary);
}


/* =====================
   FEATURE LINKS
   ===================== */
.mega-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.mega-link:hover {
    background: var(--green-bg-lighter);
    color: inherit;
    text-decoration: none;
}

.mega-link > i {
    font-size: 1rem;
    color: var(--green-primary);
    margin-top: 2px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.mega-link:hover > i {
    color: var(--green-dark);
}

.mega-link-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.mega-link-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-600);
    line-height: 1.3;
    margin-top: 1px;
}


/* =====================
   RIGHT: SIDEBAR
   ===================== */
.mega-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}


/* =====================
   PROMO CARD (Sidebar)
   ===================== */
.mega-promo {
    border-radius: 12px;
    overflow: hidden;
    background: var(--green-bg-lighter);
    border: 1px solid var(--green-accent);
}

.mega-promo-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.mega-promo-content {
    padding: 1rem;
}

.mega-promo-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--green-primary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.mega-promo-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.mega-promo-desc {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}


/* =====================
   BLOG SECTION (Sidebar)
   ===================== */
.mega-blog {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-blog-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.mega-blog-card:hover {
    background: var(--gray-50);
    text-decoration: none;
    color: inherit;
}

.mega-blog-card img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.mega-blog-placeholder-icon {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--green-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-blog-placeholder-icon i {
    font-size: 1.1rem;
    color: var(--green-primary);
}

.mega-blog-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.mega-blog-date {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-top: 2px;
}

.mega-blog-all {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--green-primary);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.mega-blog-all:hover {
    color: var(--green-dark);
    text-decoration: none;
}


/* =====================
   HIDE DESKTOP ON MOBILE
   ===================== */
@media (max-width: 991.98px) {
    .mega-menu,
    .mega-menu-backdrop,
    .mega-trigger .mega-chevron {
        display: none !important;
    }
    
    /* Hide the default Bootstrap collapse on mobile - we use our own */
    .navbar-collapse {
        display: none !important;
    }
}

@media (min-width: 992px) {
    /* Hide mobile elements on desktop */
    .mobile-menu,
    .mobile-menu-overlay,
    #mobileMenuToggle {
        display: none !important;
    }
}


/* =====================
   MOBILE OFF-CANVAS MENU
   ===================== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    z-index: 1060;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu.is-open {
    transform: translateX(0);
}


/* =====================
   MOBILE MENU HEADER
   ===================== */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.mobile-menu-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}


/* =====================
   MOBILE MENU BODY
   ===================== */
.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}


/* =====================
   MOBILE NAV LINKS
   ===================== */
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 0.75rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    background: var(--green-bg-lighter);
    color: var(--green-primary);
    text-decoration: none;
}

.mobile-nav-link i {
    color: var(--green-primary);
}


/* =====================
   MOBILE ACCORDION
   ===================== */
.mobile-accordion {
    margin-bottom: 0.25rem;
}

.mobile-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 0.75rem;
    background: none;
    border: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-accordion-trigger:hover {
    background: var(--green-bg-lighter);
    color: var(--green-primary);
}

.mobile-accordion-trigger span i {
    color: var(--green-primary);
}

.mobile-accordion-chevron {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.mobile-accordion-chevron.is-rotated {
    transform: rotate(180deg);
}


/* =====================
   MOBILE ACCORDION PANEL
   ===================== */
.mobile-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-accordion-panel.is-open {
    max-height: 1200px;
}


/* =====================
   MOBILE FEATURE GROUPS
   ===================== */
.mobile-feature-group {
    padding: 0.5rem 0 0.5rem 0.5rem;
    border-left: 2px solid var(--green-accent);
    margin-left: 1rem;
    margin-bottom: 0.5rem;
}

.mobile-feature-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-600);
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.25rem;
}

.mobile-feature-group-label i {
    color: var(--green-primary);
    font-size: 0.7rem;
}

.mobile-feature-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mobile-feature-link:hover,
.mobile-feature-link:active {
    background: var(--green-bg-lighter);
    color: var(--green-primary);
    text-decoration: none;
}


/* =====================
   MOBILE DIVIDER & CTA
   ===================== */
.mobile-menu-divider {
    margin: 0.75rem 0;
    border-color: var(--gray-200);
}

.mobile-menu-cta {
    padding: 0.5rem 0;
}


/* =====================
   MOBILE PROMO
   ===================== */
.mobile-promo {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem;
    background: var(--green-bg-lighter);
    border-radius: 10px;
    border: 1px solid var(--green-accent);
    margin-top: 0.75rem;
}

.mobile-promo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--green-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.mobile-promo strong {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.mobile-promo p {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.4;
}


/* =====================
   RESPONSIVE: LARGE DESKTOP
   ===================== */
@media (min-width: 1200px) {
    .mega-sidebar {
        width: 300px;
    }
}

/* Medium desktop: stack blog under promo */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .mega-features {
        grid-template-columns: repeat(4, 1fr);
    }

    .mega-sidebar {
        width: 240px;
    }

    .mega-link-desc {
        display: none;
    }

    .mega-promo-img {
        height: 90px;
    }
}


/* =====================
   SMALL MOBILE
   ===================== */
@media (max-width: 374px) {
    .mobile-menu {
        width: 100vw;
        max-width: 100vw;
    }
}