/**
 * Full-Screen Overlay Mobile Menu Styles
 * For São Paulo SEO
 * Breakpoint: < 992px
 */

/* =========================================
   Mobile Menu Toggle Button (Hamburger)
   ========================================= */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    position: relative;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--dark);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease,
                background-color 0.3s ease;
}

.hamburger-line:nth-child(1) {
    transform: translateY(-7px);
}

.hamburger-line:nth-child(3) {
    transform: translateY(7px);
}

/* Hamburger to X animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(0) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
}

/* =========================================
   Full-Screen Overlay
   ========================================= */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(251, 248, 245, 0.98) 0%,
        rgba(245, 240, 248, 0.98) 50%,
        rgba(240, 248, 255, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

/* =========================================
   Overlay Content Container
   ========================================= */
.mobile-overlay-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 100px 30px 40px;
    max-width: 500px;
    margin: 0 auto;
}

/* =========================================
   Logo in Overlay
   ========================================= */
.mobile-overlay-logo {
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.mobile-overlay.active .mobile-overlay-logo {
    opacity: 1;
    transform: translateY(0);
}

.mobile-overlay-logo .logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.mobile-overlay-logo .logo svg {
    height: 50px;
    width: auto;
}

.mobile-overlay-logo .logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
}

.mobile-overlay-logo .logo-text span {
    color: var(--primary);
}

/* =========================================
   Mobile Navigation Links
   ========================================= */
.mobile-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links > li {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    transition-delay: calc(0.1s + var(--delay) * 0.08s);
}

.mobile-overlay.active .mobile-nav-links > li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-links > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
    text-decoration: none;
    border-bottom: 1px solid rgba(45, 24, 16, 0.08);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.mobile-nav-links > li > a:hover {
    color: var(--primary);
    padding-left: 10px;
}

.mobile-nav-links > li > a.active {
    color: var(--primary);
}

.mobile-nav-links > li > a svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* =========================================
   Mobile Dropdown
   ========================================= */
.mobile-dropdown-toggle svg {
    transition: transform 0.3s ease;
}

.mobile-dropdown.open .mobile-dropdown-toggle svg {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: rgba(232, 90, 79, 0.03);
    border-radius: 12px;
}

.mobile-dropdown.open .mobile-dropdown-menu {
    max-height: 500px;
    padding: 10px 0;
    margin: 10px 0;
}

.mobile-dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease, padding-left 0.3s ease;
    border-radius: 8px;
    margin: 0 10px;
}

.mobile-dropdown-menu li a:hover {
    color: var(--primary);
    background: rgba(232, 90, 79, 0.08);
    padding-left: 25px;
}

/* =========================================
   Mobile CTA Button
   ========================================= */
.mobile-cta {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(45, 24, 16, 0.08);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    transition-delay: calc(0.1s + var(--delay) * 0.08s);
}

.mobile-overlay.active .mobile-cta {
    opacity: 1;
    transform: translateY(0);
}

.mobile-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(232, 90, 79, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(232, 90, 79, 0.4);
}

.mobile-cta-btn svg {
    transition: transform 0.3s ease;
}

.mobile-cta-btn:hover svg {
    transform: translateX(5px);
}

/* =========================================
   Body Lock when Menu is Open
   ========================================= */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* =========================================
   Responsive Breakpoints
   ========================================= */
@media (max-width: 991px) {
    /* Show hamburger */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Hide desktop navigation */
    .nav-desktop,
    .nav-links.nav-desktop,
    .nav .nav-links.nav-desktop {
        display: none !important;
    }

    /* Ensure header is visible */
    .header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 576px) {
    .mobile-overlay-content {
        padding: 90px 20px 30px;
    }

    .mobile-nav-links > li > a {
        font-size: 1.3rem;
        padding: 15px 0;
    }

    .mobile-dropdown-menu li a {
        font-size: 1rem;
        padding: 10px 15px;
    }

    .mobile-overlay-logo .logo svg {
        height: 40px;
    }

    .mobile-overlay-logo .logo-text {
        font-size: 1.4rem;
    }
}

/* =========================================
   Header z-index adjustment
   ========================================= */
.header {
    z-index: 1003;
}

/* Ensure header stays above overlay */
.mobile-menu-toggle.active .hamburger-line {
    background-color: var(--dark);
}
