/* ==========================================================================
   RESPONSIVE STYLES (MOBILE & TABLET ONLY)
   Desktop layout (min-width: 992px) remains 100% untouched.
   ========================================================================== */

/* Universal Mobile & Tablet Adaptations (< 992px) */
@media (max-width: 991px) {
    /* Prevent horizontal scrolling on mobile */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    *, *::before, *::after {
        box-sizing: border-box;
    }

    /* Grid Layout Adaptations */
    .segments-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Header & Mobile Nav fixes */
    .hs-elevate-site-header__header-container {
        padding: 12px 20px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .hs-elevate-site-header__logo {
        max-height: 42px !important;
        width: auto !important;
        object-fit: contain !important;
    }

    .hs-elevate-site-header__menu-container {
        justify-content: flex-end !important;
        flex: 0 0 auto !important;
    }

    .hs-elevate-site-header__hamburger {
        display: flex !important;
        z-index: 10001;
        position: relative;
    }

    .hs-elevate-site-header__nav {
        display: none;
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: calc(100vh - 64px) !important;
        overflow-y: auto !important;
        background: #ffffff !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
        z-index: 10000 !important;
        padding: 16px 24px 32px !important;
        border-top: 1px solid #E2E8F0;
    }

    .hs-elevate-site-header__nav.active {
        display: block !important;
    }

    .hs-elevate-site-header__menu-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .hs-elevate-site-header__menu-list > li {
        border-bottom: 1px solid #EDF2F7 !important;
        padding: 12px 0 !important;
        position: relative !important;
    }

    .hs-elevate-site-header__menu-list > li:last-child {
        border-bottom: none !important;
    }

    .hs-elevate-site-header__menu-list a {
        font-size: 1.05rem !important;
        font-weight: 600 !important;
        color: #09152B !important;
        padding: 4px 0 !important;
    }

    /* Submenu dropdowns inside mobile nav */
    .hs-elevate-site-header__menu-list ul {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 8px 0 8px 16px !important;
        background: #F7F9FC !important;
        border-radius: 8px !important;
        margin-top: 8px !important;
    }

    .hs-elevate-site-header__menu-list ul li {
        padding: 6px 0 !important;
        border-bottom: none !important;
    }

    .hs-elevate-site-header__menu-list ul a {
        font-size: 0.925rem !important;
        font-weight: 500 !important;
        color: #4A5568 !important;
        white-space: normal !important;
    }
}

/* Mobile Breakpoint (< 768px) */
@media (max-width: 767px) {
    :root {
        --hsElevate--section--horizontalPadding: 16px;
        --hsElevate--section--medium__verticalPadding: 40px;
    }

    /* Section Paddings & Margins */
    .dnd-section {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .hs-elevate-content-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Override inline row-fluid and span widths on mobile */
    .row-fluid {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        gap: 28px !important;
        align-items: stretch !important;
    }

    .row-fluid > [class*="span"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex: none !important;
        box-sizing: border-box !important;
    }

    /* Mobile Typography Scaling */
    h1, .hs-elevate-display-2 {
        font-size: 1.75rem !important;
        line-height: 1.25 !important;
        margin-bottom: 16px !important;
        word-wrap: break-word !important;
    }

    h2, .hs-elevate-h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 16px !important;
        word-wrap: break-word !important;
    }

    .dnd-section h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 20px !important;
    }

    p {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }

    /* Hero Section Mobile Adjustments */
    .dnd-section:first-of-type .row-fluid {
        flex-direction: column-reverse !important;
        gap: 20px !important;
    }

    .dnd-section:first-of-type h1,
    .dnd-section:first-of-type .hs-elevate-display-2 {
        font-size: 2.15rem !important;
        font-weight: 800 !important;
        line-height: 1.18 !important;
        letter-spacing: -0.5px !important;
        margin-top: 12px !important;
        margin-bottom: 16px !important;
        color: #FFFFFF !important;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }

    .dnd-section:first-of-type p {
        font-size: 1.05rem !important;
        font-weight: 500 !important;
        line-height: 1.5 !important;
        color: #F7F9FC !important;
        margin-bottom: 24px !important;
    }

    .hero-desktop-img {
        display: none !important;
    }

    .hero-mobile-img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 16px !important;
        margin-bottom: 8px !important;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
    }

    .dnd-section:first-of-type {
        padding-top: 36px !important;
        padding-bottom: 44px !important;
    }

    .dnd-section:first-of-type .hs-elevate-button {
        width: 100% !important;
        text-align: center !important;
        display: block !important;
        box-sizing: border-box !important;
        font-weight: 700 !important;
        font-size: 1.05rem !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
    }

    /* Buttons Full Width on Mobile */
    a.hs-elevate-button,
    button.hs-elevate-button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        display: block !important;
        padding: 16px 20px !important;
    }

    /* Benefits & Metrics Grids */
    .benefits-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .benefit-card {
        padding: 24px 20px !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    .metric-number {
        font-size: 2rem !important;
    }

    .metric-description {
        font-size: 0.825rem !important;
    }

    .segments-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Video & FAQ Section */
    video, .video-container {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-bottom: 24px !important;
        border-radius: 16px !important;
    }

    .hs-elevate-accordion summary {
        padding: 16px 18px !important;
        font-size: 0.95rem !important;
    }

    .hs-elevate-accordion div[style*="padding:0 24px 20px"],
    .hs-elevate-accordion div[style*="padding: 0 24px 20px"] {
        padding: 0 18px 16px !important;
        font-size: 0.875rem !important;
    }

    /* CTA Banner */
    .dnd-section img[src*="banner-cta.png"] {
        width: 100% !important;
        height: auto !important;
        border-radius: 12px !important;
    }

    /* Contact Form Section */
    #contato .span6:first-child img {
        height: 220px !important;
        max-height: 220px !important;
        object-fit: cover !important;
        border-radius: 16px !important;
        width: 100% !important;
    }

    #contato div[style*="padding: 40px"],
    #contato div[style*="padding:40px"] {
        padding: 20px 16px !important;
        border-radius: 16px !important;
    }

    .contact-form {
        gap: 12px !important;
    }

    .contact-form .form-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .contact-form .form-group {
        width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
    }

    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 0.95rem !important;
    }

    .contact-form button[type="submit"] {
        width: 100% !important;
        padding: 16px !important;
        margin-top: 8px !important;
    }

    /* Footer & LGPD Mobile Adjustments */
    footer.hs-elevate-footer {
        padding-top: 0 !important;
    }

    footer .dnd-section {
        padding: 32px 16px 20px !important;
    }

    footer .row-fluid {
        gap: 20px !important;
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    footer .span3 {
        width: 100% !important;
        text-align: left !important;
    }

    footer h4 {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }

    footer p, footer li a {
        font-size: 0.85rem !important;
    }

    footer iframe {
        height: 140px !important;
    }

    /* Mobile LGPD Floating Banner */
    #lgpd-banner {
        padding: 8px 14px !important;
    }

    #lgpd-banner > div {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }

    #lgpd-banner p {
        font-size: 0.72rem !important;
        line-height: 1.3 !important;
    }

    #accept-lgpd-btn {
        padding: 5px 14px !important;
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
    }

    /* Mobile LGPD Modal */
    #lgpd-modal {
        padding: 12px !important;
    }

    #lgpd-modal > div {
        max-height: 90vh !important;
        border-radius: 14px !important;
    }
}

/* Extra Small Devices (< 480px) */
@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .dnd-section:first-of-type h1,
    .dnd-section:first-of-type .hs-elevate-display-2 {
        font-size: 1.75rem !important;
        font-weight: 800 !important;
    }

    h2, .hs-elevate-h2, .dnd-section h2 {
        font-size: 1.25rem !important;
    }
}

/* Anchor Links offset for fixed header */
.hs-elevate-anchor {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
}
