/* Arquivo dedicado para responsividade do site */

/* Base responsiva */
img, video, svg {
    max-width: 100%;
    height: auto;
}

/* Modo Extend / viewport: clip horizontal no html SEM criar 2.º scrollport.
   overflow-x:hidden força overflow-y:auto (CSS Overflow) → scrollbar duplo
   se body/main também forem scroll containers. Body sem overflow. */
html, body {
    width: 100% !important;
    max-width: 100% !important;
}

html {
    overflow-x: clip;
    overflow-y: auto;
}

body {
    overflow: visible;
}

/* Forçar recálculo do layout em modo estendido */
@media (display-mode: window-controls-overlay), 
       (display-mode: fullscreen),
       (display-mode: standalone) {
    body {
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .hero-banner, 
    .hero-slider,
    .slider-wrapper,
    .slider-slide {
        width: 100% !important;
        max-width: 100% !important;
    }

    .slider-container:not(.hero-slider) .slider-image {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Hero — full-bleed com cantos inferiores suaves */
.hero-banner {
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 0 var(--border-radius-lg, 16px) var(--border-radius-lg, 16px) !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero-banner {
        border-radius: 0 0 var(--border-radius, 10px) var(--border-radius, 10px) !important;
    }
}

.hero-slider {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    position: relative;
}

/* Configuração do slider com altura fixa para garantir consistência */
.hero-slider:not(.slider--informative) .slider-wrapper {
    position: relative;
    min-height: 350px;
    overflow: hidden;
    width: 100%;
    background-color: #f5f8fc;
}

.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: scale(1.05);
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.slider-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

/* Sliders genéricos — contain para não cortar */
.slider-container:not(.hero-slider) .slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    z-index: 1;
    background-color: #1a1a1a;
}

/* Hero informativo — faixa Bancomoc compacta (clamp + cover) */
.hero-slider.slider--informative .slider-wrapper {
    height: clamp(200px, 36vw, 480px) !important;
    min-height: 200px !important;
    max-height: 480px !important;
    aspect-ratio: auto;
}

@media (max-width: 768px) {
    .hero-slider.slider--informative .slider-wrapper {
        height: clamp(180px, 48vw, 260px) !important;
        min-height: 180px !important;
        max-height: 260px !important;
    }
}

.hero-slider.slider--informative .slider-image {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    background-color: transparent;
    transform: none !important;
}

/* Legenda posicionada sobre a imagem com gradiente para visibilidade */
.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    z-index: 3;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0) 100%);
    color: white;
    text-align: center;
}

/* Melhorando a visualização do texto */
.slider-caption h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: white;
}

/* Melhorando a visualização do texto */
.slider-caption p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    color: white;
}

/* Botões de navegação centralizados verticalmente (sliders genéricos, não o hero) */
.slider-container:not(.hero-slider) .slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 4;
    pointer-events: none;
}

.slider-container:not(.hero-slider) .slider-prev,
.slider-container:not(.hero-slider) .slider-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.slider-container:not(.hero-slider) .slider-prev:hover,
.slider-container:not(.hero-slider) .slider-next:hover {
    background: rgba(var(--primary-color-rgb), 0.8);
    transform: scale(1.1);
    border-color: white;
}

.slider-container:not(.hero-slider) .slider-dots {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: auto;
}

.slider-container:not(.hero-slider) .slider-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.slider-container:not(.hero-slider) .slider-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
    border-color: white;
}

/* Responsividade do slider com alturas específicas */
@media (max-width: 1400px) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        min-height: 500px;
    }
}

@media (max-width: 1200px) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        min-height: 450px;
    }
    
    .slider-caption h2 {
        font-size: 2.2rem;
    }
    
    .slider-caption p {
        font-size: 1.1rem;
    }
}

@media (max-width: 992px) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        min-height: 400px;
    }
    
    .slider-caption h2 {
        font-size: 2rem;
    }
    
    .slider-caption p {
        font-size: 1rem;
    }
    
    .slider-caption {
        padding: 1.5rem;
    }
    
    .slider-container:not(.hero-slider) .slider-controls {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        min-height: 350px;
    }
    
    .slider-caption h2 {
        font-size: 1.8rem;
        margin-bottom: 0.7rem;
    }
    
    .slider-caption p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .slider-caption {
        padding: 1.2rem;
    }
    
    .hero-slider .slider-prev,
    .hero-slider .slider-next {
        width: 40px;
        height: 40px;
    }

    .hero-slider .slider-controls {
        padding: 0 10px;
    }

    .slider-container:not(.hero-slider) .slider-prev,
    .slider-container:not(.hero-slider) .slider-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .slider-container:not(.hero-slider) .slider-controls {
        padding: 0 1rem;
    }
}

@media (max-width: 576px) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        min-height: 300px;
    }
    
    .slider-caption h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .slider-caption p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        max-width: 100%;
    }
    
    .slider-caption {
        padding: 1rem;
    }
    
    .hero-slider .slider-prev,
    .hero-slider .slider-next {
        width: 36px;
        height: 36px;
    }

    .hero-slider .slider-controls {
        padding: 0 8px;
    }

    .slider-container:not(.hero-slider) .slider-prev,
    .slider-container:not(.hero-slider) .slider-next {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .slider-container:not(.hero-slider) .slider-controls {
        padding: 0 0.8rem;
    }
    
    .slider-caption .primary-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        min-height: 280px;
    }
    
    .slider-caption h2 {
        font-size: 1.3rem;
    }
    
    .slider-container:not(.hero-slider) .slider-controls {
        top: auto;
        bottom: 50%;
    }
}

/* Tratamento especial para dispositivos com tela baixa em modo paisagem */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider:not(.slider--informative) .slider-wrapper {
        height: 200px;
    }
    
    .slider-caption {
        padding: 0.5rem;
    }
    
    .slider-caption h2 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
    
    .slider-caption p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .slider-container:not(.hero-slider) .slider-controls {
        top: 50%;
    }
}

/* Ajuste de grids auxiliares não cobertos por styles.css */
.stats-container {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Container principal flexível — sem overflow-x:hidden (forçaria
   overflow-y:auto no main e um 2.º scrollport vertical). */
.container, main {
    max-width: 100%;
}

/* Ajustes para elementos flexíveis */
.card, 
.service-card, 
.project-item,
.stat-item {
    width: 100%;
}

/* Telas muito grandes (≥1400px) */
@media (min-width: 1400px) {
    main,
    .header-content,
    .footer-content,
    .content-section {
        max-width: 1680px;
    }
    
    .hero-slider:not(.slider--informative) .slider-wrapper {
        height: 600px;
    }

    .hero-slider.slider--informative .slider-wrapper {
        height: clamp(320px, 32vw, 540px) !important;
        max-height: 540px !important;
    }
    
    .card {
        padding: 2.5rem;
    }
}

/* Telas grandes (1200px - 1399px) */
@media (max-width: 1199px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.9rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
}

/* Telas médias (992px - 1199px) */
@media (max-width: 991px) and (min-width: 768px) {
    #main-menu a {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Telas pequenas (768px - 991px) */
@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    p {
        font-size: 1rem;
    }
    
    .header-content {
        padding: 0.6rem 1rem;
        gap: 0.75rem;
        min-height: 3.85rem;
    }

    header.is-scrolled .header-content {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    :root {
        --header-offset: 4.25rem;
    }
    
    .logo-container h1 {
        font-size: 1.2rem;
        font-weight: 900;
        letter-spacing: 0.05em;
    }
    
    .logo {
        width: 38px;
        height: 38px;
    }

    .logo-text {
        padding-left: 0.6rem;
    }
    
    .logo-desc {
        font-size: 0.6rem;
        font-weight: 500;
    }
    
    .menu-toggle {
        display: inline-flex;
    }
    
    #main-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(82vw, 320px);
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background-color: var(--card-bg, #ffffff);
        flex-direction: column;
        padding: 5.5rem 1.25rem 2rem;
        transition: right 0.3s var(--ease-out);
        z-index: 1001;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    }
    
    .menu-open #main-menu {
        right: 0;
    }
    
    #main-menu li {
        width: 100%;
    }
    
    #main-menu a {
        padding: 0.95rem 1.1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        text-align: left;
        color: var(--heading-color, #424242);
    }

    #main-menu a:hover,
    #main-menu a.active {
        color: var(--primary-color, #e63328);
        background-color: rgba(230, 51, 40, 0.06);
    }
    
    #main-menu a::after {
        display: none;
    }
    
    .slider-container:not(.hero-slider) .slider-controls {
        padding: 0 1rem;
    }
}

/* Telas muito pequenas (<576px) */
@media (max-width: 575px) {
    body {
        font-size: 15px;
    }

    .header-content {
        padding: 0.55rem 0.75rem;
        gap: 0.5rem;
    }

    .logo-desc {
        max-width: 11rem;
    }

    .card {
        padding: 1.5rem;
    }

    .map-placeholder,
    .map-placeholder.map-loaded iframe {
        min-height: 280px;
        height: 280px;
    }

    .map-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-image {
        height: 200px;
    }

    .footer-logo img,
    .footer-brand-mark {
        width: auto;
        height: 40px;
        max-width: 160px;
    }

    .footer-links h4,
    .footer-contact h4 {
        font-size: 0.75rem;
    }
}

/* Reduzir animações para usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition-delay: 0ms !important;
    }
}

/* Estilos para impressão */
@media print {
    header, 
    footer, 
    nav, 
    .hero-banner, 
    .map-container, 
    button,
    .btn,
    .form-container {
        display: none;
    }
    
    body {
        background-color: #fff;
        color: #000;
        font-size: 12pt;
    }
    
    main {
        width: 100%;
        margin: 0;
    }
    
    .content-section {
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

@media (min-width: 1600px) {
    main,
    .header-content,
    .footer-content,
    .content-section {
        max-width: 1840px;
        margin: 0 auto;
    }

    .hero-slider:not(.slider--informative) .slider-wrapper {
        height: 640px;
    }

    .hero-slider.slider--informative .slider-wrapper {
        height: clamp(360px, 30vw, 580px) !important;
        max-height: 580px !important;
    }
}

/* Ultrawide / monitores ≥1920px */
@media (min-width: 1920px) {
    main,
    .header-content,
    .footer-content,
    .content-section {
        max-width: 1920px;
        margin: 0 auto;
    }

    .hero-slider.slider--informative .slider-wrapper {
        height: clamp(400px, 28vw, 620px) !important;
        max-height: 620px !important;
    }
}

