/* Prevenir scroll horizontal */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Garantir que o hero não cause overflow */
.hero-section {
    box-sizing: border-box;
}

/* Hero Section Styles */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: -10%;
    left: -10%;
    right: -10%;
    bottom: -10%;
    background-image: var(--hero-bg-image, url('/storage/hero-home/cidade.jpeg'));
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: 1;
    transform: scale(1.1);
    animation: heroZoom 12s linear infinite;
    will-change: transform;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 4rem 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-actions .btn {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hero-actions .btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    border: none;
}

.hero-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.hero-actions .btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.hero-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-actions {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Garantir que o container dentro do hero tenha padding adequado */
.hero-section .container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Padding específico para mobile - FORÇAR ESPAÇAMENTO */
@media (max-width: 768px) {
    .hero-section .container {
        padding-left: 25px !important;
        padding-right: 25px !important;
        max-width: none !important;
    }
    
    .hero-section .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .hero-section .col-lg-8,
    .hero-section .col-md-10 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

@media (max-width: 576px) {
    .hero-section .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .hero-section .col-lg-8,
    .hero-section .col-md-10 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Responsividade */
@media (max-width: 1200px) {
    .hero-background {
        background-attachment: scroll;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        max-width: calc(100vw);
        overflow: hidden;
    }
    
    .hero-content {
        padding: 3rem 1rem; /* Adiciona padding lateral aqui */
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-actions {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        margin-right: 0 !important;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions .btn:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 45vh;
    }
    
    .hero-content {
        padding: 2rem 1.5rem; /* Mais padding em telas pequenas */
    }
    
    .hero-title {
        font-size: 2rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-actions {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-actions .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        max-width: 280px;
    }
}

/* Efeito parallax suave */
@media (min-width: 769px) {
    .hero-background {
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Melhorar contraste em telas pequenas - OPACIDADE IDEAL */
@media (max-width: 768px) {
    .hero-section .hero-overlay {
        background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.35) 100%
        ) !important;
        background-color: rgba(0, 0, 0, 0.4) !important;
    }
}

/* Regra adicional para opacidade ideal em mobile */
@media (max-width: 767px) {
    .hero-overlay {
        background: rgba(0, 0, 0, 0.4) !important;
        background-image: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.35) 100%
        ) !important;
    }
}

/* Smooth scroll para o botão "Explorar Serviços" */
html {
    scroll-behavior: smooth;
}

/* Adicionar um indicador visual para scroll */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.6);
    z-index: 3;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@media (max-width: 768px) {
    .hero-section::after {
        display: none;
    }
}

/* CORREÇÃO SIMPLES PARA ESPAÇAMENTO LATERAL */
@media (max-width: 768px) {
    .hero-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: none !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .hero-section .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* Animação suave de zoom para simular vídeo */
@keyframes heroZoom {
    0% {
        transform: scale(1.1) translateX(0px) translateY(0px);
    }
    12.5% {
        transform: scale(1.115) translateX(-2px) translateY(-1px);
    }
    25% {
        transform: scale(1.13) translateX(-3px) translateY(0px);
    }
    37.5% {
        transform: scale(1.135) translateX(-2px) translateY(1px);
    }
    50% {
        transform: scale(1.14) translateX(0px) translateY(0px);
    }
    62.5% {
        transform: scale(1.135) translateX(2px) translateY(-1px);
    }
    75% {
        transform: scale(1.13) translateX(3px) translateY(0px);
    }
    87.5% {
        transform: scale(1.115) translateX(2px) translateY(1px);
    }
    100% {
        transform: scale(1.1) translateX(0px) translateY(0px);
    }
}

/* Desabilitar animação em dispositivos com preferência por movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .hero-background {
        animation: none;
        transform: scale(1.1);
    }
}

/* Ajustar animação para mobile (mais sutil) */
@media (max-width: 768px) {
    .hero-background {
        animation: heroZoomMobile 15s linear infinite;
        background-attachment: scroll;
    }
}

@keyframes heroZoomMobile {
    0% {
        transform: scale(1.05) translateX(0px) translateY(0px);
    }
    16.66% {
        transform: scale(1.06) translateX(-1px) translateY(-0.5px);
    }
    33.33% {
        transform: scale(1.07) translateX(-1.5px) translateY(0px);
    }
    50% {
        transform: scale(1.075) translateX(0px) translateY(0.5px);
    }
    66.66% {
        transform: scale(1.07) translateX(1.5px) translateY(0px);
    }
    83.33% {
        transform: scale(1.06) translateX(1px) translateY(-0.5px);
    }
    100% {
        transform: scale(1.05) translateX(0px) translateY(0px);
    }
}