body {
    margin: 0;
    font-family: 'Nunito', sans-serif; /* Asegúrate de que esta fuente esté enlazada en tu HTML */
    background-color: #121212;
    color: #fff;
    scroll-behavior: smooth;
    text-align: center;
}

/* --- Barra de navegación --- */
header.navbar {
    position: fixed;
    background: rgba(18,18,18,0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 85px;
    padding: 5px 5%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

#main-title {
    font-size: 6rem;
    text-align: center;
    margin-top: 50px;
    color: white;
    font-weight: bold;
    word-wrap: break-word;
}

@media (max-width: 1024px) {
    #main-title {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    #main-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 480px) {
    #main-title {
        font-size: 2rem;
    }
}


.navbar .logo {
    font-weight: bold;
    font-size: 1.4em;
    color: #81b8b2; /* Usaremos esta como --primary */
    cursor: pointer;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.logo a:hover {
    opacity: 0.8;
}


.navbar nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.navbar nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
}

.navbar nav ul li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar nav ul li a {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    transition: color 0.3s, transform 0.3s;
    cursor: pointer;
}

.navbar nav ul li a:hover {
    color: #81b8b2;
    transform: scale(1.05);
    cursor: pointer;
}

/* Estilo para el enlace activo */
.navbar nav ul li a.active {
    color: #81b8b2;
    font-weight: 700;
    border-bottom: 2px solid #81b8b2;
}

/* 🔧 Arreglo para que los enlaces del navbar sean clickeables */
nav {
    position: relative;
    z-index: 1000;
}

#nav-links a {
    pointer-events: auto;
    position: relative;
    z-index: 1001;
}

header {
    position: relative;
    z-index: 1002;
}

/* Si tienes un overlay o menú móvil abierto, asegúrate de esto: */
.menu-toggle {
    position: relative;
    z-index: 1100;
}


/* Hamburger icon */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger div {
    width: 28px;
    height: 3px;
    background-color: white;
    margin: 4px 0;
    transition: 0.4s;
}

/* --- Responsive navbar (móviles) --- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        padding: 10px 5%;
    }

    .navbar nav {
        flex-grow: 1;
        justify-content: flex-end;
        position: static;
    }

    .navbar nav ul {
        flex-direction: column;
        align-items: center;
        max-height: 0;
        overflow: hidden;
        background-color: #1c1c1c;
        width: 100%;
        position: absolute;
        top: 85px;
        left: 0;
        padding: 0;
        margin: 0;
        transition: max-height 0.5s ease-out, padding 0.5s ease-out;
        z-index: 999;
    }

    .navbar nav ul.show {
        max-height: 600px;
        padding: 10px 0;
    }

    .navbar nav ul li {
        width: 90%;
        text-align: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .navbar nav ul li:last-child {
        border-bottom: none;
    }

    .navbar nav ul li a {
        display: block;
        width: 100%;
        padding: 10px 0;
    }

    .hamburger {
        display: flex;
    }
}


/* ==============================================
   NUEVOS ESTILOS PARA LA SECCIÓN DE DISEÑO Y MODAL
   ============================================== */

/* --- Variables de Color (Definidas de nuevo para independencia) --- */
:root{
    --bg: #121212;
    --primary: #81b8b2; /* Color principal (el que usas en el navbar) */
    --accent: #9ee2d9; /* Color de acento (similar a primary, un poco más claro) */
    --card: #171717; /* Fondo de tarjetas */
    --dark-grey: #242424; /* Gris oscuro para bordes y detalles */
}

/* --- Contenido Principal --- */
.main-content {
    /* Ajuste para el navbar fijo (85px de altura + espacio extra) */
    padding-top: 110px; 
    padding-bottom: 50px;
    padding-left: 5%;
    padding-right: 5%;
    max-width: 1400px; /* Ancho máximo para centrar el contenido */
    margin: 0 auto;
    text-align: center; /* Centra el contenido general como el título y filtros */
}

.design-page-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5em;
    color: var(--accent);
    text-align: center;
    margin-bottom: 40px;
    margin-top: 0;
}

/* --- Filtros de Categoría --- */
.design-filters {
 padding: 20px 0 40px 0;
}

.filter-buttons {
 display: flex;
 justify-content: center;
 flex-wrap: wrap; 
 gap: 10px;
}

.filter-button {
 background-color: var(--card);
 color: #fff;
 border: 1px solid var(--dark-grey);
 padding: 8px 15px;
 border-radius: 20px;
 cursor: pointer;
 font-weight: 500;
 transition: background-color 0.3s, border-color 0.3s;
}

.filter-button:hover {
 background-color: #242424;
}

filter-button.active {
 background-color: var(--primary);
 color: var(--bg); 
 font-weight: 700;
 border-color: var(--primary);
}


/* --- Cuadrícula de Proyectos (Grid) --- */
.design-grid-container {
 max-width: 1400px;
 margin: 0 auto;
}

.design-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
 gap: 20px;
 padding-bottom: 50px;
}

.project-card {
 position: relative; 
 aspect-ratio: 1 / 1; /* Para que sea cuadrado */
 overflow: hidden;
 border-radius: 8px;
 background-color: var(--card);
 box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
 cursor: pointer;
 transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
 transform: scale(1.02);
 box-shadow: 0 8px 25px rgba(129, 184, 178, 0.2); 
}

.project-card img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 transition: opacity 0.3s;
}

/* Overlay de información al pasar el mouse */
.card-overlay {
 position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex;
 flex-direction: column; justify-content: center; align-items: center; padding: 15px;
 opacity: 0; transition: opacity 0.3s; text-align: center;
}
.project-card:hover .card-overlay { opacity: 1; }

.card-overlay h3 { color: var(--primary); font-size: 1.4em; margin: 0 0 5px 0; }
.card-overlay p { color: #ccc; font-size: 0.9em; margin: 0; }
.card-overlay .material-symbols-outlined { font-size: 2em; color: white; margin-top: 10px; }

/* Botón Cargar Más */
.load-more-container { text-align: center; padding: 30px 0 80px 0; }
.load-more-button {
 background-color: var(--card); color: var(--primary); border: 2px solid var(--primary);
 padding: 12px 30px; border-radius: 5px; cursor: pointer; font-weight: 700;
 transition: background-color 0.3s, color 0.3s;
}
.load-more-button:hover { background-color: var(--primary); color: var(--bg); }


/* ==================================
   MODAL DE PROYECTO (Ventana Emergente)
   ================================== */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto; 
    background-color: rgba(0,0,0,0.95); padding-top: 50px;
}

.modal-content {
    background-color: var(--card); margin: 5% auto; padding: 30px;
    border: 1px solid #333; border-radius: 10px; width: 90%; 
    max-width: 1000px; position: relative; box-shadow: 0 5px 30px rgba(0, 0, 0, 0.7);
}

.close-button {
    color: #aaa; float: right; font-size: 40px; font-weight: bold; cursor: pointer; 
    line-height: 1; position: absolute; top: 10px; right: 20px; transition: color 0.3s;
}
.close-button:hover, .close-button:focus { color: var(--primary); text-decoration: none; }

.modal-body h2 {
    color: var(--accent); font-size: 2.5em; margin-top: 0;
    border-bottom: 2px solid var(--dark-grey); padding-bottom: 10px;
}
#modal-category { color: var(--primary); font-style: italic; font-size: 1.1em; margin-bottom: 20px; }

#modal-description p { line-height: 1.6; margin-bottom: 20px; text-align: left; color: #ddd; }

/* Estilos para el proceso (imágenes y texto) */
/* ... (otras reglas) ... */

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.modal-gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    /* 💡 CAMBIO CLAVE: Muestra el cursor de la mano */
    cursor: pointer; 
}

/* Clase para evitar el scroll del body cuando el modal está abierto */
.modal-open { overflow: hidden; }


/* --- AJUSTES RESPONSIVE PARA EL NUEVO CONTENIDO --- */
@media (max-width: 768px) { 
    
    /* Contenido General */
    .main-content { padding-top: 90px; }
    .design-page-title { font-size: 1.8em; margin-bottom: 20px;}
    
    /* Grid y Filtros */
    .design-grid { grid-template-columns: 1fr; gap: 15px; }
    .filter-button { font-size: 0.9em; padding: 6px 12px; }
    
    /* Modal Responsive */
    .modal-content { width: 95%; margin: 10% auto; padding: 20px; }
    .modal-gallery-grid { grid-template-columns: 1fr; }
    .modal-body h2 { font-size: 2em; }
}


/* ==================================
   LIGHTBOX PARA IMAGENES DEL MODAL
   ================================== */
.lightbox-overlay {
     display: none; /* <--- ¡ESTO DEBE ESTAR EN 'none'! */
    position: fixed; 
    z-index: 3000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(5px); /* Efecto de desenfoque */
    -webkit-backdrop-filter: blur(5px); /* Para compatibilidad */
    display: flex; /* Para centrar contenido */
    align-items: center;
    justify-content: center;
}

#projectLightbox {
    display: none; /* Asegura que el ID específico también esté oculto */
}

.lightbox-content {
    margin: auto; /* Centra la imagen */
    display: block;
    max-width: 90%; /* Máximo 90% del ancho de la pantalla */
    max-height: 90%; /* Máximo 90% de la altura de la pantalla */
    object-fit: contain; /* Ajusta la imagen sin recortar */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    animation: zoomIn 0.3s ease-out; /* Pequeña animación al abrir */
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 3001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.lightbox-caption {
    margin-top: 15px;
    text-align: center;
    color: #ccc;
    font-size: 1.2em;
    position: absolute;
    bottom: 20px;
    width: 100%;
    left: 0;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    padding: 16px;
    transition: 0.3s;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 70px; /* Tamaño del botón */
    height: 70px; /* Tamaño del botón */
    display: flex; /* Para centrar flecha */
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--primary);
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* Responsive para el lightbox */
@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 35px;
        padding: 10px;
        width: 50px;
        height: 50px;
    }
    .lightbox-nav.prev { left: 10px; }
    .lightbox-nav.next { right: 10px; }
    .lightbox-close {
        font-size: 40px;
        top: 10px;
        right: 20px;
    }
    .lightbox-caption {
        font-size: 1em;
        bottom: 10px;
    }
}