/* =========================================
   LAYOUT PRINCIPAL DE GALERÍA (Grid 2 Columnas)
   ========================================= */
.gallery-layout-container {
    display: grid;
    grid-template-columns: 260px 1fr; /* Sidebar fijo 260px, resto flexible */
    gap: 2rem;
    padding-top: 140px; /* Espacio para el header fijo */
    padding-bottom: 4rem;
    padding-left: 4rem;
    padding-right: 4rem;
    min-height: 80vh; /* Asegura que ocupe buena parte de la pantalla */
    align-items: start;
}

/* =========================================
   SIDEBAR DE FILTROS (Izquierda)
   ========================================= */
.filters-sidebar {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid #00e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky; /* Se queda fijo al hacer scroll */
    top: 100px;
    max-height: 80vh;
    overflow-y: auto; /* Scroll interno si hay muchos filtros */
    scrollbar-width: thin;
    scrollbar-color: #333 #111;
}

/* Cabecera del Sidebar */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #00e0e0;
}

.filters-header h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.clear-btn {
    background: none;
    border: none;
    color: #00e0e0;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
}

.clear-btn:hover {
    color: #fff;
}

/* Grupos de Filtros (Categorías) */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h4 {
    font-size: 0.85rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* --- CHECKBOX PERSONALIZADO (Estilo Neón) --- */
.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #00e0e0;
    transition: color 0.2s;
    position: relative;
    padding-left: 1.8rem; /* Espacio para el cuadrito */
    user-select: none;
}

.filter-option:hover {
    color: #00e0e0;
    transform: scale(1.02) translateY(-1px);
}

/* Esconder el checkbox nativo */
.filter-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* El cuadrito personalizado */
.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Hover sobre el cuadrito */
.filter-option:hover .checkmark {
    border-color: #00e0e0;
    box-shadow: 0 0 5px rgba(0, 224, 224, 0.2);
}

/* Estado Activo (Checked) */
.filter-option input:checked ~ .checkmark {
    background-color: #00e0e0;
    border-color: #00e0e0;
    box-shadow: 0 0 10px rgba(0, 224, 224, 0.4);
}

/* El "check" (flechita) dentro del cuadro */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.filter-option input:checked ~ .checkmark:after {
    display: block;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #000; /* Check negro sobre fondo neón */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* =========================================
   CONTENIDO PRINCIPAL (Derecha)
   ========================================= */
.gallery-main {
    width: 100%;
}

.gallery-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #00e0e0;
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Botón "Abrir Filtros" (Oculto en Desktop) */
.filter-toggle-btn {
    display: none; /* Default desktop */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

/* Botón "Cerrar Filtros" (Dentro del sidebar) */
.close-filters-btn {
    display: none; /* Oculto en desktop */
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Acciones móviles dentro del sidebar */
.filters-actions-mobile {
    display: none; /* Oculto en desktop */
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

/* Botón flotante "Ver Resultados" */
.apply-filters-btn-mobile {
    display: none;
    width: 100%;
    background: var(--primary-color);
    color: #00e0e0;
    border: none;
    padding: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 2rem;
    border-radius: 8px;
    cursor: pointer;
}

/* Overlay de fondo */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 190; /* Debajo del sidebar (200) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.filters-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Ajuste Top Bar para alinear botón y contador */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 0.2rem;
    line-height: 1;
}

.subtitle-mini {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.results-count {
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Grid de Resultados */
#gallery-full-grid {
    display: grid;
    /* Forzamos 3 columnas como pediste en desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    min-height: 400px;
}

.gallery-work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Responsivo automático */
  gap: 2rem;
  padding: 2rem 5%;
}

/* --- ESTILOS DE PAGINACIÓN --- */
#gallery-pagination {
    margin-top: 4rem;
}

/* Botón de flecha limpio */
.pagination-btn {
    background: transparent;
    border: none;
    color: var(--primary-color); /* #00e0e0 */
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Crecimiento al hacer Hover (solo si no está desactivado) */
.pagination-btn:hover:not(:disabled) {
    transform: scale(1.3); /* Crece un poco */
    color: #00e0e0;
    filter: drop-shadow(0 0 5px rgba(0, 224, 224, 0.4)); /* Brillo sutil opcional */
}

/* Estado Desactivado */
.pagination-btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
}

.gabout-cta {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 2px solid #00e0e0;
  background-color: black;
  color: #00e0e0;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.gabout-cta:hover {
  background: #00e0e0;
  color: black;
  box-shadow: 0 0 20px rgba(0, 224, 224, 0.6);
}

/* =========================================
   RESPONSIVE (Móvil y Tablet)
   ========================================= */

@media (max-width: 900px) {
    /* Cambiar layout a una sola columna */
    .gallery-layout-container {
        grid-template-columns: 1fr;
        padding-top: 100px;
        gap: 2rem;
    }

    /* El Sidebar deja de ser lateral y se pone arriba */
    .filters-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        padding: 1rem;
    }

    /* Opcional: Hacer los filtros colapsables o en grid en móvil */
    #filters-wrapper {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 2rem;
    }
}
