/* Sello Concreto - Estilos optimizados */
:root {
    --color-concrete-light: #e0e0e0;
    --color-concrete-medium: #b0b0b0;
    --color-concrete-dark: #707070;
    --color-concrete-darker: #505050;
    --color-accent: #3a3a3a;
    --color-text: #333333;
    --color-text-light: #f5f5f5;
    --font-primary: 'Roboto', sans-serif;
    --transition-speed: 0.3s;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-text);
    overflow-x: hidden;
    background-color: var(--color-concrete-light);
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-concrete-darker);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--color-accent);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Fondo fijo */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: -1;
    will-change: transform; /* Optimización para rendimiento */
}

/* Animación inicial optimizada con WebP */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('optimized_images/plano_general.webp') center/cover no-repeat;
    z-index: 9999;
    transition: opacity 1s ease-out;
    will-change: opacity, transform; /* Optimización para rendimiento */
}

.lens-effect {
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid var(--color-concrete-light);
    position: absolute;
    transition: all 1.5s ease-out;
    display: none;
}

/* Encabezado / Portada */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--color-text-light);
    padding: 4rem 2rem 2rem 2rem;
}

/* Estilos para el carrusel */
.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.logo {
    max-width: 150px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Navegación */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(80, 80, 80, 0.9);
    padding: 1rem 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

/* Estilos para el menú de hamburguesa */
.hamburger-menu {
    display: none;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 1001;
}

.hamburger-icon {
    width: 30px;
    height: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--color-text-light);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animación para el icono de hamburguesa cuando está activo */
.hamburger-icon.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-icon.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-icon.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

nav ul.nav-links {
    display: flex;
    justify-content: center;
    list-style: none;
}

nav li {
    margin: 0 1.5rem;
}

nav a {
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-text-light);
    transition: width var(--transition-speed);
}

nav a:hover::after {
    width: 100%;
}

/* Secciones */
.section {
    padding: 5rem 0;
    position: relative;
    scroll-margin-top: 4rem; /* Ajuste para el scroll con navegación fija */
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(224, 224, 224, 0.3);
    z-index: -1;
}

.section h2 {
    font-size: 2.5rem;
    color: var(--color-concrete-darker);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--color-concrete-dark);
}

.content {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Galería */
.gallery-intro {
    text-align: center;
    font-style: italic;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed);
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-speed);
    will-change: transform; /* Optimización para rendimiento */
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Servicios */
#servicios .content h3 {
    color: var(--color-concrete-darker);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Contacto */
.contact-info {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-info strong {
    font-size: 1.5rem;
    color: var(--color-concrete-darker);
}

.contact-info i {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.contact-info .fa-whatsapp {
    color: #25D366;
}

.contact-info a {
    transition: all 0.3s ease;
}

.contact-info a:hover {
    color: #25D366;
}

.map-container {
    margin-top: 1.5rem;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background-color: var(--color-concrete-darker);
    color: var(--color-text-light);
    padding: 2rem 0;
    text-align: center;
}

/* Estilos para la sección Antes y Después */
.before-after-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    width: 100%;
}

.before-after-item {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
    width: 100%;
    margin-bottom: 2rem;
}

.before, .after {
    flex: 0 0 45%; /* Take up 45% of the container width */
    max-width: 500px;
    height: 400px;
    text-align: center;
}

.before h3, .after h3 {
    margin-bottom: 1rem;
    color: var(--color-concrete-darker);
}

.before img, .after img {
    width: 100%;
    height: 400px;
    object-fit: cover; /* Maintain aspect ratio while filling the container */
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed);
    cursor: pointer;
}

.before img:hover, .after img:hover {
    transform: scale(1.03);
}

/* Estilos para la sección Proceso de Creación */
.creation-process {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.process-step {
    text-align: center;
}

.process-step img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed);
    margin-bottom: 1rem;
    cursor: pointer;
}

.process-step img:hover {
    transform: scale(1.03);
}

.process-step p {
    font-weight: 500;
    color: var(--color-concrete-darker);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    /* Estilos para el menú móvil */
    .hamburger-menu {
        display: block;
    }
    
    nav {
        padding: 1rem;
        justify-content: flex-start;
    }
    
    nav ul.nav-links {
        flex-direction: column;
        align-items: center;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(80, 80, 80, 0.75);
        padding-top: 4rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(5px);
    }
    
    nav ul.nav-links.active {
        right: 0;
    }
    
    nav li {
        margin: 1rem 0;
        width: 100%;
        text-align: center;
    }
    
    nav a {
        display: block;
        padding: 0.8rem 0;
    }
    
    nav a::after {
        display: none;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section h2 {
        font-size: 2rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .map-container iframe {
        height: 250px;
    }
    
    .before-after-item {
        flex-direction: column;
    }
    
    .before, .after {
        min-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .creation-process {
        grid-template-columns: 1fr;
    }
    
    /* Añadir overlay para cuando el menú está abierto */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .container {
        width: 95%;
    }
    
    .map-container iframe {
        height: 200px;
    }
}

body:not(.loaded) > *:not(.intro-overlay) {
    visibility: hidden;
  }


/* Overlay optimizado con WebP */
.intro-overlay {
    background: url('optimized_images/plano_general.webp') center/cover no-repeat;
    z-index: 9999;
    transition: none;
    animation: intro-in 0.8s ease-out forwards;
    will-change: opacity, transform; /* Optimización para rendimiento */
}
  
  /* 2. Animación de entrada (suaviza un poco el zoom y quita blur) */
  @keyframes intro-in {
    from {
      transform: scale(1.2);
      filter: blur(20px);
      opacity: 1;
    }
    to {
      transform: scale(1);
      filter: blur(0px);
      opacity: 1;
    }
  }
  
  /* 3. Clase para el efecto de salida */
  .intro-overlay.fade-out {
    animation: intro-out 1s ease-in-out forwards;
  }
  
  /* 4. Animación de salida (zoom‑out, blur y fade) */
  @keyframes intro-out {
    from {
      transform: scale(1);
      filter: blur(0px);
      opacity: 1;
    }
    to {
      transform: scale(0.8);
      filter: blur(20px);
      opacity: 0;
    }
  }
