/* AlloDentiste Top Navigation Widget Styles */

.allo-top-navigation-widget {
    width: 100%;
    position: relative;
}

.allo-top-navigation-widget.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9998;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.top-navigation {
    background-color: #FFFFFF;
    border-bottom: 1px solid #EEEEEE;
    padding: 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    gap: 100px;
    position: relative;
}

/* Logo */
.nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.nav-logo img {
    width: 180px;
    height: auto;
    display: block;
    animation: logo-write-on 1.1s cubic-bezier(0.25, 0.1, 0.15, 1.0) 0.15s both;
    will-change: clip-path;
}

@keyframes logo-write-on {
    from {
        clip-path: inset(0 100% 0 0);
        opacity: 0.6;
    }
    10% {
        opacity: 1;
    }
    to {
        clip-path: inset(0 0% 0 0);
        opacity: 1;
    }
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1A1A1A;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 10px 0;
}

.nav-link:hover {
    color: #00A1AD;
}

.dropdown-icon {
    transition: transform 0.3s ease;
    margin-top: 2px;
}

.nav-item.has-dropdown > .nav-link:hover .dropdown-icon,
.nav-item.has-dropdown.open > .nav-link .dropdown-icon {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    list-style: none;
    margin: 0;
    padding: 15px 0;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #FFFFFF;
    border: 1px solid #EEEEEE;
    border-radius: 8px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 10px;
}

.nav-item.has-dropdown:hover > .submenu,
.nav-item.has-dropdown.open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-item {
    margin: 0;
}

.submenu-link {
    display: block;
    padding: 12px 20px;
    color: #1A1A1A;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.submenu-link:hover {
    background-color: #F5F5F5;
    color: #00A1AD;
    padding-left: 24px;
}

/* Multi-level Submenu Support */
.submenu-item.has-dropdown {
    position: relative;
}

.submenu-item.has-dropdown > .submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* All nested submenus (2nd level inside 1st level, 3rd inside 2nd, etc.) */
.submenu .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 10px;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 15px 0;
    background-color: #FFFFFF;
    border: 1px solid #EEEEEE;
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

/* Show nested submenus on hover */
.submenu-item.has-dropdown:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Actions Container */
.mobile-actions {
    display: none;
}

/* Mobile Phone Icon */
.mobile-phone-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 10px;
    color: #1A1A1A;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-phone-icon:hover {
    color: #00A1AD;
}

.mobile-phone-icon svg {
    width: 22px;
    height: 22px;
}

/* Hamburger Menu */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px 8px;
    margin-right: -8px;
    background: none !important;
    background-color: transparent !important;
    border: none;
    color: #1A1A1A !important;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.hamburger-toggle:hover,
.hamburger-toggle:focus,
.hamburger-toggle:active {
    background: none !important;
    background-color: transparent !important;
    color: #00A1AD !important;
}

/* Hamburger bars wrapper — isolates bars from label in flex layout */
.hamburger-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.hamburger-bars span {
    width: 28px;
    height: 3px;
    background-color: #1A1A1A;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger-toggle:hover .hamburger-bars span,
.hamburger-toggle:focus .hamburger-bars span {
    background-color: #00A1AD;
}

/* Active (X) state */
.hamburger-toggle.active .hamburger-bars span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-toggle.active .hamburger-bars span:nth-child(2) {
    opacity: 0;
}

.hamburger-toggle.active .hamburger-bars span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.hamburger-toggle.active:hover .hamburger-bars span {
    background-color: #00A1AD;
}

/* Label under hamburger/phone icons */
.mobile-action-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    color: #1A1A1A !important;
    display: block;
    width: auto;
    height: auto;
    background: none !important;
    background-color: transparent !important;
    border-radius: 0;
    transition: color 0.3s ease;
}

.mobile-phone-icon:hover .mobile-action-label,
.hamburger-toggle:hover .mobile-action-label,
.hamburger-toggle:focus .mobile-action-label,
.hamburger-toggle:active .mobile-action-label {
    color: #00A1AD !important;
}

/* Hide mobile-injected elements on desktop so they don't bleed out of the
   media-query scope if the browser is resized back to a wide viewport. */
@media (min-width: 769px) {
    .mobile-nav-header,
    .mobile-nav-slider {
        display: none !important;
    }

    /* Ensure the nav-menu is never left in the open/transformed state */
    .nav-menu {
        transform: none !important;
        position: static !important;
        overflow: visible !important;
        max-height: none !important;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        gap: 30px;
    }
    
    .nav-menu {
        gap: 30px;
    }
    
    .nav-link {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        min-height: 70px;
        gap: 20px;
        padding: 0 15px;
    }

    .nav-logo img {
        width: 150px;
    }

    .mobile-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .hamburger-toggle {
        display: flex;
    }

    /* ── Full-screen mobile nav drawer ─────────────────────────── */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #FFFFFF;
        z-index: 9999;
        overflow: hidden;
        max-height: none;
        padding: 0;
        flex: none;
        display: flex !important;
        flex-direction: column;
        align-items: stretch; /* override desktop align-items: center */
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        /* list styles reset */
        gap: 0;
        border: none;
    }

    .nav-menu.open {
        transform: translateX(0);
        max-height: none;
        padding: 0;
    }

    /* Hide original list items — replaced by JS-built boxes */
    .nav-menu > .nav-item,
    .nav-menu > li {
        display: none !important;
    }

    /* Hide all submenus (handled by panel drill-down) */
    .submenu,
    .mega-menu-panel {
        display: none !important;
    }

    /* ── Mobile nav header: back · title · close ───────────────── */
    .mobile-nav-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        border-bottom: 1px solid #EBEBEB;
        min-height: 62px;
        flex-shrink: 0;
        background: #FFFFFF;
    }

    .mobile-nav-back,
    .mobile-nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1.5px solid #E5E5E5;
        background: #FAFAFA;
        cursor: pointer;
        color: #444444;
        flex-shrink: 0;
        transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
        padding: 0;
    }

    .mobile-nav-back:hover,
    .mobile-nav-close:hover {
        border-color: #00A1AD;
        color: #00A1AD;
        background: #F0FAFB;
    }

    .mobile-nav-back.hidden {
        display: none;
    }

    .mobile-nav-title {
        font-size: 18px;
        font-weight: 700;
        color: #1A1A1A;
        flex: 1;
        letter-spacing: -0.01em;
    }

    .mobile-nav-logo {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-decoration: none;
        padding: 0;
    }

    .mobile-nav-logo img {
        height: 22px;
        width: auto;
        display: block;
        object-fit: contain;
    }

    /* ── Slider: clips the sliding panels ─────────────────────── */
    .mobile-nav-slider {
        flex: 1;
        overflow: hidden;
        position: relative;
    }

    /* ── Individual panel: 2-column card grid ─────────────────── */
    .mobile-nav-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        padding: 20px 14px 32px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-content: start;
        background: #F2F3F6;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    .mobile-nav-panel.active {
        transform: translateX(0);
    }

    .mobile-nav-panel.exit-left {
        transform: translateX(-100%);
    }

    /* ── Each nav box ─────────────────────────────────────────── */
    .mobile-nav-box {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        text-align: left;
        padding: 16px 16px 14px;
        border-radius: 18px;
        border: none;
        background: #FFFFFF;
        color: #1A1A1A;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.05),
            0 4px 14px rgba(0, 0, 0, 0.07);
        transition:
            box-shadow 0.22s ease,
            color 0.22s ease,
            background-color 0.22s ease,
            transform 0.18s ease;
        min-height: 90px;
        width: 100%;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
        line-height: 1.3;
        letter-spacing: -0.015em;
        position: relative;
        overflow: hidden;
    }

    /* When an icon is present: push icon to top, label to bottom */
    .mobile-nav-box.has-icon {
        justify-content: space-between;
        min-height: 110px;
    }

    /* Icon wrapper */
    .mobile-nav-box-icon {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        color: #00A1AD;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.22s ease;
    }

    .mobile-nav-box-icon svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .mobile-nav-box:hover .mobile-nav-box-icon,
    .mobile-nav-box:active .mobile-nav-box-icon {
        color: #007b87;
    }

    /* Label text — inherits font from the box */
    .mobile-nav-box-label {
        display: block;
        width: 100%;
    }

    /* Subtle top-left accent stripe */
    .mobile-nav-box::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #00A1AD 0%, #00c8d7 100%);
        border-radius: 18px 18px 0 0;
        opacity: 0;
        transition: opacity 0.22s ease;
    }

    .mobile-nav-box:hover,
    .mobile-nav-box:active {
        color: #00A1AD;
        background-color: #F0FAFB;
        transform: translateY(-2px);
        box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.06),
            0 10px 28px rgba(0, 161, 173, 0.16),
            0 0 0 1.5px rgba(0, 161, 173, 0.22);
    }

    .mobile-nav-box:hover::before,
    .mobile-nav-box:active::before {
        opacity: 1;
    }

    /* Arrow badge — bottom-right corner for sub-menu items */
    .mobile-nav-box-arrow {
        position: absolute;
        bottom: 12px;
        right: 14px;
        width: 18px;
        height: 18px;
        color: #D0D0D0;
        transition: color 0.22s ease, transform 0.22s ease;
        top: auto;
        margin-left: 0;
    }

    .mobile-nav-box:hover .mobile-nav-box-arrow,
    .mobile-nav-box:active .mobile-nav-box-arrow {
        color: #00A1AD;
        transform: translate(3px, -2px);
    }
}

@media (max-width: 480px) {
    .nav-container {
        min-height: 60px;
        gap: 15px;
        padding: 0 12px;
    }

    .nav-logo img {
        width: 130px;
    }

    .mobile-nav-panel {
        padding: 14px 10px 24px;
        gap: 9px;
    }

    .mobile-nav-box {
        padding: 14px 14px 12px;
        font-size: 13px;
        min-height: 80px;
        border-radius: 16px;
    }
}

/* ============================================================
   Mega Menu — Desktop Only
   Activate by adding CSS class "mega-menu" to the top-level
   nav item in WP Admin → Appearance → Menus → Screen Options
   (enable CSS Classes), then typing "mega-menu" in the field.
   Depth-2 children become column headers, depth-3 become links.
   ============================================================ */

/* Ensure regular dropdowns stay anchored to their nav-item */
.nav-item.has-dropdown {
    position: relative;
}

/* Mega item must NOT create a containing block so the panel
   escapes to .nav-container (position: relative) */
.nav-item.has-mega-menu {
    position: static;
}

.mega-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-top: 2px solid #00A1AD;
    border-bottom: 1px solid #EEEEEE;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
    padding: 32px 40px;
    /* Small delay on leave so panel doesn't flicker when
       moving the mouse from the nav-link down into the panel */
    transition-delay: 0s;
}

.nav-item.has-mega-menu:hover > .mega-menu-panel,
.nav-item.has-mega-menu.open > .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.05s;
}

/* Multi-column layout — items flow top-to-bottom, filling each column
   before starting the next, so short columns don't leave row gaps */
.mega-menu-grid {
    columns: 190px;
    column-gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Column header (depth-2 item) */
.mega-col {
    break-inside: avoid;
    display: block;
    width: 100%;
    margin-bottom: 28px;
}

.mega-col-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #00A1AD;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #EEEEEE;
    transition: color 0.2s ease;
}

.mega-col-header:hover {
    color: #007a85;
}

.mega-col-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #f0fafb;
    border-radius: 6px;
    color: #00A1AD;
    transition: background 0.2s ease;
}

.mega-col-header-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.mega-col-header:hover .mega-col-header-icon {
    background: #d6f0f3;
}

/* Links under each column (depth-3 items) */
.mega-col-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mega-col-link {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #444444;
    text-decoration: none;
    padding: 6px 0 6px 0;
    border-left: 2px solid transparent;
    padding-left: 8px;
    transition: color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
}

.mega-col-link:hover {
    color: #00A1AD;
    border-left-color: #00A1AD;
    padding-left: 12px;
}

/* Mega menu hidden on mobile — handled in the 768px breakpoint above */
