/* ==========================================================================
   1. Reset y Variables (Optimización de renderizado)
   ========================================================================== */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f4f4f4;
    --text-muted: #a0a0a0;
    --accent-color: #00a8ff; /* Azul eléctrico para llamadas a la acción */
    --accent-hover: #008cd9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Navegación fluida al hacer clic en el menú */
}

body {
    /* Fuentes del sistema: no requieren descargar archivos extra, máxima velocidad */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* ==========================================================================
   2. Navegación y Cabecera
   ========================================================================== */
header {
    background-color: #000000;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: -0.5px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li a {
    font-weight: 500;
    font-size: 0.95rem;
}

nav ul li a:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   3. Hero Section (Primera impresión)
   ========================================================================== */
.hero {
    text-align: center;
    padding: 6rem 20px;
    /* Fondo oscuro sólido por defecto, preparado para añadir una imagen de fondo */
    background: linear-gradient(rgba(18, 18, 18, 0.85), rgba(18, 18, 18, 0.95));
    border-bottom: 1px solid #333;
}

.hero h1 {
    /* clamp() escala el texto automáticamente según el tamaño de la pantalla */
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.hero p {
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.btn-cta {
    display: inline-block;
    background-color: var(--accent-color);
    color: #ffffff;
    padding: 1rem 2.5rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-cta:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   4. Contenido Principal y Servicios
   ========================================================================== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 20px;
}

section {
    margin-bottom: 6rem;
}

section h2 {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 3rem;
    color: #ffffff;
}

/* Sistema de Grid para los servicios */
#servicios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.servicio {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 8px;
    border-top: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.servicio:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.servicio h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.servicio p {
    color: var(--text-muted);
}

/* ==========================================================================
   5. Galería de Trabajos (Optimización CLS)
   ========================================================================== */
#galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

#galeria img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    /* Aspect-ratio previene el CLS (Cumulative Layout Shift) en Google */
    aspect-ratio: 4 / 3; 
    border: 1px solid #333;
}

/* ==========================================================================
   6. Footer y Contacto
   ========================================================================== */
footer {
    background-color: #000000;
    padding: 4rem 20px 2rem;
    text-align: center;
    border-top: 1px solid #333;
}

footer h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
}

address {
    font-style: normal;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

address p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

address a:hover {
    color: var(--accent-color);
}

footer > p {
    color: #666;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* ==========================================================================
   7. Media Queries (Ajustes para Móviles)
   ========================================================================== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1.5rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    .hero {
        padding: 4rem 20px;
    }

    main {
        padding: 3rem 20px;
    }
}

/* ==========================================================================
   8. Páginas Internas (Servicios, Trabajos, Contacto)
   ========================================================================== */

/* --- Página: Servicios --- */
/* --- Página: Servicios --- */
#niveles-servicio {
    display: grid;
    /* Esto crea columnas automáticas. Si caben 3, pone 3. Si es móvil, pone 1. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px; /* Ampliamos el ancho para que respiren bien las 3 cajas */
    margin: 0 auto;
}

/* Hacemos que el contenido de las cajas se estire para que todas midan lo mismo */
#niveles-servicio .servicio {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Empuja el precio hacia la parte inferior de la caja para que queden alineados */
#niveles-servicio .servicio p:last-child {
    margin-top: auto;
}

#niveles-servicio .servicio strong {
    display: block;
    margin-top: 1.5rem;
    font-size: 1.5rem; /* Hacemos el precio un poco más grande */
    color: var(--accent-color);
}


/* --- Página: Trabajos (Galería con marcos) --- */
.grid-galeria {
    display: grid;
    /* Las imágenes serán más grandes que en la página principal */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.grid-galeria figure {
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    transition: transform 0.3s ease;
}

.grid-galeria figure:hover {
    transform: scale(1.02);
}

.grid-galeria img {
    width: 100%;
    /* Aspect ratio 16:9 para formato panorámico en los trabajos */
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border: none;
    border-radius: 0;
}

.grid-galeria figcaption {
    padding: 1.2rem;
    text-align: center;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    border-top: 1px solid #333;
}

/* --- Página: Contacto --- */
#pagina-contacto {
    max-width: 1000px;
    margin: 0 auto;
}

.info-contacto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    background-color: var(--bg-card);
    padding: 3rem;
    border-radius: 8px;
    margin-top: 3rem;
    border-top: 4px solid var(--accent-color);
}

.info-contacto address p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.info-contacto address strong {
    color: var(--text-muted);
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.mapa {
    background-color: #0a0a0a;
    min-height: 300px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #333;
    color: var(--text-muted);
}

/* Ajustes responsivos para las páginas internas */
@media (max-width: 768px) {
    .info-contacto {
        padding: 2rem 1.5rem;
    }
    
    .grid-galeria {
        grid-template-columns: 1fr;
    }
}