:root {
    --color-primario: #1a1a1a;
    --color-secundario: #ffffff; 
    --color-acento: #e0b87c; 
    --fuente-principal: 'Montserrat', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente-principal);
    margin: 0;
    padding: 0;
    background-color: var(--color-secundario);
    color: var(--color-primario);
    line-height: 1.6;
}

/* ==========================================================================
   2. ESTILOS BASE Y UTILIDADES
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 2rem;
    text-align: center;
}

.page-section {
    padding-top: 120px;
}

h1, h2, h3, h4 {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; margin-bottom: 3rem; }
a { text-decoration: none; color: var(--color-acento); }

/* ==========================================================================
   3. ENCABEZADO Y NAVEGACIÓN (UNIFICADO)
   ========================================================================== */
.header {
    background-color: #ffffff;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem; /* padding horizontal */
    height: 90px; /* ALTURA FIJA Y DEFINITIVA */
    position: relative; /* Para posicionar el botón hamburguesa */
}

.nav-left { justify-self: start; }
.nav-center { justify-self: center; }
.nav-right { justify-self: end; }

.logo {
    max-height: 60px;
    width: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--color-primario);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-media-header {
    display: flex;
    gap: 1.5rem;
}

.social-media-header a {
    color: var(--color-primario);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.social-media-header a:hover {
    color: var(--color-acento);
}

.nav-menu a.active {
    color: var(--color-acento) !important;
    font-weight: 700;
}

/* Botón Hamburguesa (oculto en escritorio) */
.nav-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: none; /* visible solo en mobile/tablet */
    background: none;
    border: none;
    color: var(--color-primario);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

/* Estado abierto del menú en mobile */
.header.menu-open .nav-center {
    display: block !important;
    position: absolute;
    top: 90px; /* debajo del header fijo */
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #eee;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 1100;
}

.header.menu-open .nav-menu {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
}

.header.menu-open .nav-menu a {
    font-size: 1rem;
}

/* ==========================================================================
   4. SECCIONES DE PÁGINA (ORGANIZADAS)
   ========================================================================== */

/* --- Sección Hero (Inicio) --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('img/hero-background.jpg'); 
    background-size: cover;
    background-position: center;
    color: var(--color-secundario);
}

.hero-text h1 {
    line-height: 1.2;
}

/* --- Sección Proyectos --- */
#proyectos {
    background-color: black;
    color: var(--color-secundario);
    min-height: 100vh;
}

#proyectos h2 {
    color: var(--color-secundario);
}

.proyectos-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.categoria-proyecto {
    text-decoration: none;
    color: var(--color-secundario);
    transition: transform 0.3s ease;
}

.categoria-proyecto:hover {
    transform: scale(1.05);
}

.categoria-img {
    position: relative;
    width: 390px;
    height: 700px;
    border-radius: 12px;
    margin-bottom: 1rem;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: filter 0.4s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.categoria-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    transition: background-color 0.4s ease;
}

.categoria-proyecto:hover .categoria-img::after {
    background-color: rgba(0,0,0,0.1);
}

.categoria-titulo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    text-align: center;
    letter-spacing: 2px;
}
.categoria-proyecto:hover .categoria-img {
    filter: grayscale(0%);
}

.categoria-proyecto:hover .categoria-titulo {
    opacity: 1;
}

.img-arquitectura { background-image: url('img/arquitectura-portada.jpg'); }
.img-diseno { background-image: url('img/diseno-interior-portada.jpg'); }

/* (rollback) se eliminan ajustes responsivos añadidos para tamaños de tarjetas */


/* --- Sección Nosotros --- */
.about-intro {
    background-color: #f4f4f4;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

.team-group-photo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    text-align: left;
}

.team-group-photo img {
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.team-group-text {
    max-width: 500px;
}

.process-section {
    background-color: var(--color-primario);
    color: var(--color-secundario);
}

.process-section h3, .process-section h4 {
    color: var(--color-secundario);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    text-align: left;
}

.step .step-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-acento);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-acento);
    display: inline-block;
    padding-bottom: 0.5rem;
}

/* --- Sección Contacto --- */
.map-container {
    margin-top: 4rem; 
    border-radius: 8px; 
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); 
    line-height: 0;
}

.map-container iframe {
    width: 100%; 
    height: 450px; 
    border: 0;
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--color-primario);
    color: var(--color-secundario);
    font-weight: 300;
    font-size: 0.9rem;
}

/* --- Estilos para la Lista de Proyectos en Páginas de Categoría --- */

.project-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 4rem;
    text-align: left;
}

.project-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 3rem;
}
.project-item:last-child {
    border-bottom: none;
}

.project-item-visible {
    display: flex;
    flex-wrap: wrap; /* Para que se adapte en móvil */
    gap: 2rem;
    align-items: center;
    text-decoration: none;
    color: var(--color-primario);
}

.project-image {
    flex: 1 1 300px; /* Base de 300px, puede crecer y encogerse */
}

.project-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.project-details {
    flex: 2 1 400px; /* Ocupa el doble de espacio que la imagen */
}

.project-details h3 {
    margin-top: 0;
    font-size: 1.8rem;
}

.project-details p {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
}

.btn-gallery {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--color-primario);
    color: var(--color-secundario);
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.project-item-visible:hover .btn-gallery {
    background-color: var(--color-acento);
    color: var(--color-primario);
}

/* ===== ESTILOS PARA PÁGINAS DE CATEGORÍA CON FONDO NEGRO ===== */

.category-page {
    background-color: var(--color-primario); /* Fondo negro */
}

/* Título, enlace de "volver" y texto del proyecto en blanco */
.category-page .page-title-container h2,
.category-page .back-link,
.category-page .project-item-visible {
    color: var(--color-secundario);
}

/* Descripción del proyecto en un gris más sutil */
.category-page .project-details p {
    color: #ccc; 
}

/* Línea separadora de proyectos en un color más oscuro */
.category-page .project-item {
    border-bottom-color: #444; 
}

/* Botón de galería con colores invertidos para el fondo oscuro */
.category-page .btn-gallery {
    background-color: var(--color-acento);
    color: var(--color-primario);
}

.category-page .project-item-visible:hover .btn-gallery {
    background-color: var(--color-secundario);
}

/* ===== ESTILOS PERSONALIZADOS PARA LIGHTGALLERY (FONDO TRANSPARENTE) ===== */

.lg-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important; /* Fondo negro con 70% de opacidad */
    backdrop-filter: blur(10px) !important;          /* Efecto de desenfoque */
    -webkit-backdrop-filter: blur(10px) !important;  /* Compatibilidad para Safari */
}


/* ===== ESTILOS PARA LA PÁGINA DE CONTACTO (FORMULARIO Y BOTONES) ===== */

.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: left;
    margin-top: 4rem;
}

@media (min-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr 1.5fr; /* Divide en 2 columnas en escritorio */
    }
}

.contact-info h4, #contact-form h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Estilos del Formulario */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--fuente-principal);
    font-size: 1rem;
}

.btn-submit {
    display: inline-block;
    background-color: var(--color-primario);
    color: var(--color-secundario);
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--color-acento);
    color: var(--color-primario);
}

/* Estilos del Botón de WhatsApp */
.whatsapp-container {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    background-color: #25D366;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    transform: scale(1.05);
}

.btn-whatsapp i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

/* ==========================================================================
   6. RESPONSIVE DESIGN (CORREGIDO)
   ========================================================================== */
@media (max-width: 992px) {
    /* Ocultamos el menú central en tablet y movemos las redes a su lugar */
    .nav-main {
        grid-template-columns: auto 1fr; /* Logo a la izquierda, redes a la derecha */
    }
    .nav-center {
        display: none; 
    }
    .nav-right {
        grid-column: 2 / 3; /* Aseguramos que las redes se muevan a la segunda columna */
    }
    .nav-toggle { display: block; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 2rem; }
    .section { padding: 4rem 1rem; }
    .page-section { padding-top: 100px; }

    /* Para móvil, ocultamos todo excepto el logo. Ideal para un futuro menú "hamburguesa". */
    .nav-main {
        grid-template-columns: auto; /* Solo una columna para el logo */
        justify-content: center; /* Centramos el logo en móvil */
    }
    .nav-center, .nav-right {
        display: none; 
    }
    .logo { height: 50px; }

    /* (rollback) no forzar visibilidad de títulos en móvil */
}