/* Mega menu header — see includes/mega-menu.php. Self-contained (mm-* classes). */
.mm-header {
    --mm-brand: #667eea;
    --mm-brand-2: #764ba2;
    --mm-brand-soft: #f3f4fe;
    --mm-ink: #111827;
    --mm-text: #374151;
    --mm-muted: #6b7280;
    --mm-line: #e8eaf2;
    --mm-bg: #ffffff;
    --mm-h: 68px;

    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--mm-bg);
    border-bottom: 1px solid var(--mm-line);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.mm-header *, .mm-header *::before, .mm-header *::after { box-sizing: border-box; }
.mm-header ul { list-style: none; margin: 0; padding: 0; }
.mm-header p { margin: 0; }

.mm-bar {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--mm-h);
    display: flex;
    align-items: center;
    gap: 28px;
}

.mm-logo {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--mm-brand);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* ---------- Desktop nav ---------- */
.mm-nav { flex: 1; height: 100%; }
.mm-top { display: flex; align-items: center; gap: 2px; height: 100%; }
.mm-item { height: 100%; display: flex; align-items: center; }

.mm-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mm-text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.mm-trigger:hover,
.mm-item.is-open > .mm-trigger { background: var(--mm-brand-soft); color: var(--mm-ink); }
.mm-trigger.is-current { color: var(--mm-brand); font-weight: 600; }
.mm-trigger:focus-visible,
.mm-header a:focus-visible,
.mm-burger:focus-visible,
.mm-acc-trigger:focus-visible { outline: 2px solid var(--mm-brand); outline-offset: 2px; }
.mm-chev { transition: transform .2s ease; color: var(--mm-muted); }
.mm-item.is-open > .mm-trigger .mm-chev { transform: rotate(180deg); color: var(--mm-brand); }

/* Panel: full-width sheet under the bar */
.mm-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--mm-bg);
    border-top: 1px solid var(--mm-line);
    box-shadow: 0 24px 48px -16px rgba(17, 24, 39, .18);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
    pointer-events: none;
}
.mm-item.is-open > .mm-panel,
/* No-JS fallback: hover and keyboard focus */
.mm-header:not(.mm-js) .mm-item:hover > .mm-panel,
.mm-header:not(.mm-js) .mm-item:focus-within > .mm-panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .16s ease, transform .16s ease;
    pointer-events: auto;
}

.mm-panel-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 20px 32px;
    display: grid;
    grid-template-columns: repeat(var(--mm-cols), minmax(0, 1fr));
    gap: 8px 32px;
}
.mm-panel-inner.has-feature { grid-template-columns: repeat(var(--mm-cols), minmax(0, 1fr)) 300px; }

.mm-heading {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mm-muted);
    padding: 0 12px 10px;
}
.mm-links a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color .12s ease;
}
.mm-links a:hover { background: var(--mm-brand-soft); }
.mm-link-title { display: block; font-size: 14.5px; font-weight: 600; color: var(--mm-ink); line-height: 1.35; }
.mm-link-desc { display: block; font-size: 13px; color: var(--mm-muted); line-height: 1.4; margin-top: 2px; }
.mm-links a:hover .mm-link-title,
.mm-links a[aria-current="page"] .mm-link-title { color: var(--mm-brand); }
.is-compact .mm-links a { padding: 7px 12px; }
.is-compact .mm-link-title { font-weight: 500; color: var(--mm-text); }

.mm-feature {
    align-self: start;
    border-radius: 14px;
    padding: 22px;
    background: linear-gradient(145deg, #eef0fe 0%, #f6effd 100%);
    border: 1px solid #e3e6fb;
}
.mm-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mm-brand-2); }
.mm-feature-title { font-family: 'Poppins', 'Inter', sans-serif; font-size: 19px; font-weight: 700; color: var(--mm-ink); margin-top: 6px !important; line-height: 1.3; }
.mm-feature-text { font-size: 14px; color: var(--mm-text); line-height: 1.55; margin-top: 8px !important; }
.mm-feature-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--mm-brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease;
}
.mm-feature-cta:hover { background: #5a6fe0; }
.mm-feature-foot { display: block; margin-top: 12px; font-size: 13.5px; font-weight: 500; color: var(--mm-brand); text-decoration: none; }
.mm-feature-foot:hover { text-decoration: underline; }

/* ---------- Right-side actions ---------- */
.mm-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.mm-contact { color: var(--mm-text); font-size: 15px; font-weight: 500; text-decoration: none; }
.mm-contact:hover { color: var(--mm-brand); }
.mm-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--mm-brand) 0%, var(--mm-brand-2) 100%);
    color: #fff !important;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(102, 126, 234, .28);
    transition: transform .15s ease, box-shadow .15s ease;
}
.mm-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(102, 126, 234, .36); }

/* ---------- Mobile ---------- */
.mm-burger {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    padding: 12px 11px;
    flex-direction: column;
    justify-content: space-between;
}
.mm-burger span { display: block; height: 2px; border-radius: 2px; background: var(--mm-ink); transition: transform .2s ease, opacity .2s ease; }
.mm-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mm-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mm-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mm-drawer {
    position: fixed;
    top: var(--mm-h);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--mm-bg);
    border-top: 1px solid var(--mm-line);
    padding: 8px 16px 120px; /* clear floating chat/WhatsApp bubbles */
}
.mm-drawer[hidden] { display: none; }
.mm-acc { border-bottom: 1px solid var(--mm-line); }
.mm-acc-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--mm-ink);
    cursor: pointer;
}
.mm-acc-trigger[aria-expanded="true"] .mm-chev { transform: rotate(180deg); color: var(--mm-brand); }
.mm-acc-panel { padding: 0 4px 14px; }
.mm-acc-panel .mm-heading { padding: 10px 0 4px; }
.mm-acc-panel a { display: block; padding: 9px 0; color: var(--mm-text); font-size: 15px; text-decoration: none; }
.mm-acc-panel a[aria-current="page"] { color: var(--mm-brand); font-weight: 600; }
.mm-drawer-link { display: block; padding: 16px 4px; border-bottom: 1px solid var(--mm-line); color: var(--mm-ink); font-size: 16px; font-weight: 600; text-decoration: none; }
.mm-drawer-actions { display: grid; gap: 12px; margin-top: 20px; }
.mm-drawer-actions .mm-cta { padding: 14px 18px; font-size: 15.5px; }
.mm-drawer-wa { text-align: center; padding: 12px; border: 1px solid #25d366; border-radius: 8px; color: #128c7e; font-weight: 600; text-decoration: none; }
html.mm-lock, html.mm-lock body { overflow: hidden; }

@media (max-width: 1080px) {
    .mm-nav, .mm-actions { display: none; }
    .mm-burger { display: flex; }
}
@media (min-width: 1081px) {
    .mm-drawer { display: none !important; }
}
@media (max-width: 1240px) and (min-width: 1081px) {
    .mm-bar { gap: 16px; }
    .mm-trigger { padding: 8px 9px; font-size: 14.5px; }
    .mm-panel-inner.has-feature { grid-template-columns: repeat(var(--mm-cols), minmax(0, 1fr)) 260px; }
}
@media (prefers-reduced-motion: reduce) {
    .mm-header * { transition: none !important; }
}
