/* =========================================
   SISTEMA DE DISEÑO CLARO
   ========================================= */
:root {
    --bg: #F0F2F5;
    --text-primary: #1A1A1A;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent: #00D2FF;
    --accent-hover: #00A6CC;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 15px rgba(0,0,0,0.06);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
}

.contenedor {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 40px 0;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

.logo h1 {
    font-size: 3.2rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    color: var(--text-primary);
    font-weight: 700;
}

.logo p {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.1rem;
}

.barra-busqueda {
    width: 100%;
    max-width: 500px;
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid #E1E8ED;
    background: #FFFFFF;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    margin: 30px auto;
    display: block;
    font-size: 1rem;
}

.barra-busqueda:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.1);
}

.categorias {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.categorias a {
    padding: 10px 25px;
    border: 1px solid #E1E8ED;
    border-radius: 25px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    background: #FFFFFF;
    transition: var(--transition);
}

.categorias a:hover {
    background: #F5F8FA;
    border-color: var(--accent);
}

.categorias a.activo {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
}

.grid {
    position: relative;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.grid.imagenes-cargadas {
    opacity: 1;
}

.item {
    position: absolute;
    display: block;
    width: 25%;
    padding: 12px;
}

@media (max-width: 1000px) { .item { width: 33.33%; } }
@media (max-width: 700px) { .item { width: 50%; } }
@media (max-width: 480px) { .item { width: 100%; } }

.item-contenido {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.item img {
    width: 100%;
    vertical-align: top;
    transition: var(--transition);
    display: block;
}

.item-contenido:hover img {
    transform: scale(1.08);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.overlay.activo {
    display: flex;
}

.contenedor-img {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
}

.overlay img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 5px solid #FFFFFF;
}

#btn-cerrar-popup {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    color: var(--text-primary);
    border: none;
    font-size: 40px;
    cursor: pointer;
}

.overlay .descripcion {
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-align: center;
}

footer {
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid #E1E8ED;
    margin-top: 50px;
}