/* ──────────────────────────────────────────────────────────────────────
   DEON mega-menu — shared styles for "For Your Business ▾" and
   "By City ▾" dropdowns. Injected client-side by /mega-menu.js into both
   the marketing/legal header (.legal-nav-buttons) and the chat homepage
   header (.header-nav). Mobile collapses every grid to a single column.
   ────────────────────────────────────────────────────────────────────── */

.deon-mega-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Trigger button — match Company ▾ font in each context. */
.legal-nav-buttons .deon-mega-trigger {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text-secondary, rgba(255,255,255,0.75));
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.header-nav .deon-mega-trigger {
    background: none;
    border: 0;
    color: var(--text-secondary, rgba(255,255,255,0.75));
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 0.3s ease;
    position: relative;
}

.legal-nav-buttons .deon-mega-trigger:hover,
.header-nav .deon-mega-trigger:hover {
    color: var(--text-primary, #fff);
}

.deon-mega-caret {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.85;
}

/* Mega-menu panel — hover-open like Company ▾, plus click toggle for keyboard. */
.deon-mega-panel {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(26, 26, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px 22px 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 200;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    margin-top: 4px;
    box-sizing: border-box;
}

.deon-mega-wrapper:hover > .deon-mega-panel,
.deon-mega-wrapper.is-open > .deon-mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.deon-mega-industries { width: 500px; max-width: calc(100vw - 32px); }
.deon-mega-cities     { width: 900px; max-width: calc(100vw - 32px); }

/* Subtitle line above the grid (anti-confusion framing on cities menu). */
.deon-mega-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 14px 0;
    line-height: 1.45;
}

.deon-mega-grid {
    display: grid;
    gap: 22px 28px;
}
.deon-mega-industries .deon-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.deon-mega-cities     .deon-mega-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.deon-mega-col-header {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px 0;
}

.deon-mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.deon-mega-link {
    display: block;
    padding: 7px 10px;
    margin: 0 -10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease;
}

.deon-mega-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.deon-mega-venue {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.deon-mega-footer {
    margin: 16px -22px 0;
    padding: 12px 22px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.deon-mega-footer a {
    font-size: 13px;
    font-weight: 500;
    color: #3AAFD4;
    text-decoration: none;
}
.deon-mega-footer a:hover { text-decoration: underline; }

/* Light mode — mirror legal-nav-dropdown light treatment. */
body.light-mode .legal-nav-buttons .deon-mega-trigger,
body.light-mode .header-nav .deon-mega-trigger {
    color: #59616E;
}
body.light-mode .legal-nav-buttons .deon-mega-trigger:hover,
body.light-mode .header-nav .deon-mega-trigger:hover {
    color: #1A1A1E;
}
body.light-mode .deon-mega-panel {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}
body.light-mode .deon-mega-subtitle { color: #7E8795; }
body.light-mode .deon-mega-col-header { color: #7E8795; }
body.light-mode .deon-mega-link { color: #1A1A1E; }
body.light-mode .deon-mega-link:hover { background: rgba(0, 0, 0, 0.04); color: #000; }
body.light-mode .deon-mega-venue { color: #7E8795; }
body.light-mode .deon-mega-footer { border-top-color: rgba(0, 0, 0, 0.1); }
body.light-mode .deon-mega-footer a { color: #1A7A9E; }

/* Tablet / smaller — collapse cities menu to 2 columns then 1. */
@media (max-width: 1100px) {
    .deon-mega-cities .deon-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    /* Avoid clipping at the right edge of the viewport. */
    .deon-mega-panel {
        left: auto;
        right: 0;
    }
    .deon-mega-industries,
    .deon-mega-cities {
        width: calc(100vw - 32px);
        max-width: 380px;
    }
    .deon-mega-industries .deon-mega-grid,
    .deon-mega-cities .deon-mega-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
