/**
 * 911MyWeb Navigation & Megamenu Styles
 * Bootstrap 5 Compatible
 * 
 * @package 911myweb
 * @version 4.0.0
 */

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */
.nav-911 {
    display: flex;
    align-items: center;
}

.nav-911 ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.nav-911 li {
    position: relative;
}

.nav-911 li.menu-item a {
    display: block;
    padding: 24px 20px;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-inter), sans-serif;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    letter-spacing: 0.3px;
}

.nav-911 li.menu-item a::after {
    content: "";
    position: absolute;
    bottom: 12px !important;
    left: 20px;
    width: 0;
    height: 1px !important;
    background-color: var(--brand-accent, #ff7e16) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-911 li:hover > a {
    background-color: rgba(255, 255, 255, 0.04);
    color: #fff !important;
    transform: translateY(-4px);
}

.nav-911 li:hover > a::after,
.nav-911 li.active > a::after,
.nav-911 li.current-menu-item > a::after {
    width: calc(100% - 40px) !important;
}

/* ============================================
   BOOTSTRAP NAVBAR NAV
   ============================================ */
.header-911 .navbar-nav .nav-link {
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.header-911 .navbar-nav .nav-link:hover,
.header-911 .navbar-nav .nav-link:focus,
.header-911 .navbar-nav .nav-link.active {
    color: #fff !important;
    border-bottom-color: var(--brand-accent, #ff7e16);
}

/* Dropdown toggle caret */
.header-911 .navbar-nav .dropdown-toggle::after {
    border-top-color: #fff;
}

/* Dropdown menu items */
.header-911 .navbar-nav .dropdown-item {
    color: #1e293b;
    font-weight: 500;
}

.header-911 .navbar-nav .dropdown-item:hover,
.header-911 .navbar-nav .dropdown-item:focus {
    color: var(--brand-accent, #ff7e16);
    background-color: rgba(255, 126, 22, 0.08);
}

.header-911 .navbar-nav .dropdown-item.active {
    color: var(--brand-accent, #ff7e16);
    font-weight: 600;
}

/* ============================================
   STANDARD DROPDOWN (hover on desktop)
   ============================================ */
@media (min-width: 1025px) {
    .header-911 .navbar-nav .dropdown:hover > .dropdown-menu {
        display: block;
        animation: mmFadeIn 0.2s ease;
    }

    .header-911 .navbar-nav .dropdown-menu .dropdown:hover > .dropdown-menu {
        display: block;
        top: 0;
        left: 100%;
        margin-top: -1px;
    }
}

/* ============================================
   MEGA MENU STRUCTURE
   ============================================ */
.header-911 .navbar-nav .has-mega-menu,
.header-911 .navbar-nav .menu-item-has-mega-menu {
    position: static !important;
}

/* All ancestors must be static */
.header-911 .container,
.header-911 .container-fluid,
.header-911 .navbar,
.header-911 .navbar-collapse,
.header-911 .navbar-nav {
    position: static !important;
}

/* Hide Bootstrap dropdown when mega menu present */
@media (min-width: 1025px) {
    .header-911 .navbar-nav .has-mega-menu > .dropdown-menu,
    .header-911 .navbar-nav .menu-item-has-mega-menu > .dropdown-menu {
        display: none !important;
    }
}

/* ============================================
   MEGA MENU PANEL
   ============================================ */
.gbp-mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border-top: 3px solid var(--bs-primary, #ff7e16);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    animation: mmFadeIn 0.2s ease;
}

/* Show on hover (desktop) */
@media (min-width: 1025px) {
    .header-911 .navbar-nav .has-mega-menu:hover > .gbp-mega-menu,
    .header-911 .navbar-nav .menu-item-has-mega-menu:hover > .gbp-mega-menu,
    .header-911 .navbar-nav .has-mega-menu.mega-open > .gbp-mega-menu,
    .header-911 .navbar-nav .menu-item-has-mega-menu.mega-open > .gbp-mega-menu {
        display: block;
    }
}

/* Show when JS adds .mega-open (keyboard / touch) */
.header-911 .navbar-nav .has-mega-menu.mega-open > .gbp-mega-menu {
    display: block;
}

.gbp-mega-menu .mega-menu-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

@keyframes mmFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MEGA MENU GRID
   ============================================ */
.mega-services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1200px) {
    .mega-services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .mega-services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .mega-services-grid {
        grid-template-columns: 1fr;
    }
}

.mega-column h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bs-primary, #ff7e16);
    display: inline-block;
}

.mega-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-column li {
    margin-bottom: 0.375rem;
}

.mega-column a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.mega-column a:hover {
    background: rgba(255, 126, 22, 0.08);
    color: var(--bs-primary, #ff7e16);
    transform: translateX(4px);
}

/* Mobile mega menu */
@media (max-width: 1024px) {
    .gbp-mega-menu {
        position: static;
        border-top: none;
        border-left: 3px solid var(--bs-primary, #ff7e16);
        box-shadow: none;
        margin-left: 1rem;
        animation: none;
    }

    .gbp-mega-menu .mega-menu-content {
        padding: 0.75rem 0.5rem;
    }
}

/* ============================================
   MOBILE TOGGLE
   ============================================ */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    z-index: 10001;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

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

@media (max-width: 1024px) {
    .mobile-toggle {
        display: flex !important;
    }
    .desktop-nav,
    .nav-911 {
        display: none !important;
    }
}

/* ============================================
   MOBILE SIDEBAR
   ============================================ */
#mobile-menu.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: linear-gradient(165deg, #0b2447, #081931);
    z-index: 999999;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -25px 0 50px -15px #1a1e2c99;
    overflow-y: auto;
    visibility: visible !important;
    touch-action: pan-y;
}

#mobile-menu.mobile-sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ff6b35, #ff8a5c, #ff6b35, #ff8a5c);
    background-size: 100% 300%;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientMove 3s ease infinite;
}

#mobile-menu.mobile-sidebar::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -20px;
    transform: translateY(-50%);
    width: 4px;
    height: 50px;
    background: #ff6b354d;
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#mobile-menu.mobile-sidebar:active::after {
    opacity: 1;
}

#mobile-menu.mobile-sidebar.translate-x-0,
#mobile-menu.mobile-sidebar.active {
    transform: translateX(0);
}

#mobile-menu.mobile-sidebar.translate-x-0::before,
#mobile-menu.mobile-sidebar.active::before {
    opacity: 1;
}

#mobile-menu.mobile-sidebar.translate-x-full {
    transform: translateX(100%);
}

#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link {
    animation: slideInRight 0.5s ease forwards;
    opacity: 0;
}

#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(1)  { animation-delay: 0.08s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(2)  { animation-delay: 0.16s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(3)  { animation-delay: 0.24s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(4)  { animation-delay: 0.32s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(5)  { animation-delay: 0.40s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(6)  { animation-delay: 0.48s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(7)  { animation-delay: 0.56s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(8)  { animation-delay: 0.64s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(9)  { animation-delay: 0.72s; }
#mobile-menu.mobile-sidebar.translate-x-0 .mobile-sidebar__link:nth-child(10) { animation-delay: 0.80s; }

/* Mobile Sidebar Header */
.mobile-sidebar__header {
    padding: 1.75rem 1.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
    position: relative;
}

.mobile-sidebar__header::after {
    content: "";
    position: absolute;
    bottom: -1.5px;
    left: 1.75rem;
    width: 60px;
    height: 3px;
    background: #ff6b35;
    border-radius: 9999px;
    box-shadow: 0 0 15px #ff6b3566;
}

.mobile-sidebar__logo {
    height: 2.75rem;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-sidebar__logo:hover {
    transform: scale(1.08) rotate(-2deg);
}

#mobile-menu-close.mobile-sidebar__close {
    width: 3.25rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff14;
    border: 1px solid hsla(0, 0%, 100%, 0.15);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: #ffffffe6;
    padding: 0;
}

#mobile-menu-close.mobile-sidebar__close:hover {
    background: #ff6b35;
    border-color: #ff6b35;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 25px #ff6b3580;
    color: #fff;
}

#mobile-menu-close.mobile-sidebar__close:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

#mobile-menu-close.mobile-sidebar__close svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
}

/* Mobile Sidebar Content */
.mobile-sidebar__content {
    height: calc(100vh - 6rem);
    overflow-y: auto;
    padding: 1.75rem;
    scrollbar-width: thin;
    scrollbar-color: #ff6b35 hsla(0, 0%, 100%, 0.1);
}

.mobile-sidebar__content::-webkit-scrollbar {
    width: 4px;
}

.mobile-sidebar__content::-webkit-scrollbar-track {
    background: #ffffff1a;
    border-radius: 9999px;
}

.mobile-sidebar__content::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 9999px;
}

.mobile-sidebar__content::-webkit-scrollbar-thumb:hover {
    background: #ff8a5c;
}

.mobile-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2.5rem;
}

.mobile-sidebar__link {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    padding: 1rem 1.25rem;
    color: #ffffffe6;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-sidebar__link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.05), transparent 90%);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.mobile-sidebar__link:hover {
    color: #fff;
    transform: translateX(8px);
}

.mobile-sidebar__link:hover::before {
    transform: translateX(0);
}

.mobile-sidebar__link:hover .mobile-sidebar__link-icon {
    background: #ff6b35;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 15px #ff6b3566;
}

.mobile-sidebar__link:active {
    transform: translateX(5px);
}

.mobile-sidebar__link span:last-child {
    position: relative;
    z-index: 1;
}

.mobile-sidebar__link-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff1a;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.mobile-sidebar__link-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke: currentColor;
    fill: none;
}

.mobile-sidebar__link--cta {
    background: linear-gradient(135deg, #ff6b35, #ff8a5c);
    margin-top: 0.75rem;
    color: #fff !important;
    box-shadow: 0 8px 20px -5px #ff6b3580;
}

.mobile-sidebar__link--cta::before {
    display: none;
}

.mobile-sidebar__link--cta:hover {
    transform: translateY(-3px) translateX(8px);
    box-shadow: 0 15px 30px -5px #ff6b35b3;
}

.mobile-sidebar__link--cta:hover .mobile-sidebar__link-icon {
    background: #ffffff40;
    transform: scale(1.1);
    box-shadow: 0 0 20px #ffffff4d;
}

.mobile-sidebar__link--cta .mobile-sidebar__link-icon {
    background: #fff3;
}

.mobile-sidebar__link--cta .mobile-sidebar__link-icon svg {
    stroke: #fff;
}

/* Mobile Sidebar Footer */
.mobile-sidebar__footer {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid hsla(0, 0%, 100%, 0.1);
    position: relative;
}

.mobile-sidebar__footer::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #ff6b35;
    border-radius: 9999px;
    box-shadow: 0 0 15px #ff6b3566;
}

.mobile-sidebar__contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: #ffffff0d;
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 12px;
    color: #ffffffb3;
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__contact-item:hover {
    background: #ff6b3526;
    border-color: #ff6b35;
    color: #fff;
    transform: translateX(8px);
}

.mobile-sidebar__contact-item:hover svg {
    stroke: #ff6b35;
    transform: scale(1.1);
}

.mobile-sidebar__contact-item svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__social {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.mobile-sidebar__social a {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff0d;
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 9999px;
    color: #ffffffe6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__social a:hover {
    background: #ff6b35;
    border-color: #ff6b35;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px #ff6b3580;
}

.mobile-sidebar__social a:hover svg {
    color: #fff;
    transform: scale(1.15);
}

.mobile-sidebar__social a svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
#sidebar-overlay.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: #1a1e2cd9;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999998;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#sidebar-overlay.sidebar-overlay.opacity-0,
#sidebar-overlay.sidebar-overlay.invisible {
    opacity: 0;
    visibility: hidden;
}

#sidebar-overlay.sidebar-overlay.visible,
#sidebar-overlay.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.overflow-hidden {
    overflow: hidden !important;
}

/* Admin bar offsets */
body.admin-bar #mobile-menu.mobile-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

body.admin-bar .mobile-sidebar__content {
    height: calc(100vh - 6rem - 32px);
}

@media (max-width: 782px) {
    body.admin-bar #mobile-menu.mobile-sidebar {
        top: 46px;
        height: calc(100vh - 46px);
    }
    body.admin-bar .mobile-sidebar__content {
        height: calc(100vh - 6rem - 46px);
    }
}

/* Small screens */
@media (max-width: 480px) {
    #mobile-menu.mobile-sidebar {
        width: 90%;
    }
    .mobile-sidebar__header {
        padding: 1.5rem 1.5rem 1rem;
    }
    .mobile-sidebar__header::after {
        left: 1.5rem;
        width: 50px;
    }
    .mobile-sidebar__logo {
        height: 2.25rem;
    }
    #mobile-menu-close.mobile-sidebar__close {
        width: 2.75rem;
        height: 2.75rem;
    }
    #mobile-menu-close.mobile-sidebar__close svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    .mobile-sidebar__content {
        padding: 1.5rem;
    }
    .mobile-sidebar__link {
        padding: 0.875rem 1rem;
        font-size: 1.05rem;
        gap: 1rem;
    }
    .mobile-sidebar__link-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    .mobile-sidebar__link-icon svg {
        width: 1.2rem;
        height: 1.2rem;
    }
    .mobile-sidebar__contact-item {
        padding: 1rem;
        font-size: 0.9rem;
    }
    .mobile-sidebar__social a {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}
