@charset "UTF-8";
/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* BASE */
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1b1b1b, #0b0b0b);
  color: #ffffff;
  min-height: 100vh;
}

/* HEADER */
.header {
  text-align: center;
  padding: 2.5rem 1rem;
}
.header h1 {
  font-size: 2.6rem;
  letter-spacing: 0.5px;
}
.header p {
  margin-top: 0.6rem;
  opacity: 0.75;
}

/* CONTAINER - ESTADO NORMAL (sin favoritos) */
.container {
  max-width: 1600px;
  margin: auto;
  padding: 2rem;
  transition: all 0.3s ease;
}

/* ESTADO ABIERTO - Layout 70/30 lado a lado */
body.favorites-open .container {
  display: grid;
  grid-template-columns: 1fr 400px; /* Galería flexible + Panel fijo 400px */
  gap: 1.5rem;
  align-items: start;
  max-width: 100%;
  padding: 1rem;
}

/* SECCIÓN GALERÍA */
.gallery-section {
  width: 100%;
}

/* Cuando favoritos está abierto, la galería se ajusta automáticamente */
body.favorites-open .gallery-section {
  width: 100%;
}

/* TITLES */
h2 {
  margin-bottom: 1.2rem;
  font-size: 1.5rem;
}

/* BOTONES GENERALES */
button.favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #fff;
  padding: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}
button.favorite:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.6));
}
button.favorite.active {
  filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.9));
}

.gallery button.favorite {
  font-size: 1.6rem;
}

/* FILTROS */
.filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.filters label {
  font-weight: 600;
}
.filters select {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 0.95rem;
}

/* MODAL DE DETALLE */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #111;
  max-width: 520px;
  max-height: 85vh; /* 👈 Limitar altura del modal */
  margin: 6vh auto;
  border-radius: 16px;
  overflow-y: auto; /* 👈 Permitir scroll vertical */
  animation: fadeIn 0.3s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  /* Scrollbar personalizada para el modal */
}
.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 24, 0.5);
  border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 24, 0.8);
}

.modal-content img {
  width: 100%;
  max-height: 70vh; /* 👈 Limitar altura de imagen vertical */
  object-fit: contain; /* 👈 Mantener proporción sin recortar */
  display: block;
}

.modal-info {
  padding: 1.2rem;
}
.modal-info h2 {
  margin-bottom: 0.6rem;
}
.modal-info p {
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.9;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.1);
}

/* UTILIDADES */
.hidden {
  display: none !important;
}

/* ANIMACIONES */
@keyframes fadeIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* SCROLL INFINITO */
#scrollSentinel {
  height: 1px;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */
/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  body.favorites-open .container {
    grid-template-columns: 1fr 350px; /* Panel más angosto en tablets */
    gap: 1rem;
  }
}
/* MOBILE & SMALL TABLET (hasta 768px) */
@media (max-width: 768px) {
  .header {
    padding: 1.5rem 1rem;
  }
  .header h1 {
    font-size: 2rem;
  }
  .container {
    padding: 1rem;
  }
  /* En mobile, stack vertical */
  body.favorites-open .container {
    grid-template-columns: 1fr; /* Una sola columna */
    gap: 0;
  }
  /* Panel de favoritos en mobile */
  body.favorites-open .favorites-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%; /* Ocupa 85% del ancho */
    max-width: 400px;
    height: 100vh;
    z-index: 999;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  }
  /* Galería en mobile cuando favoritos está abierto */
  body.favorites-open .gallery-section {
    filter: brightness(0.5); /* Oscurecer galería */
    pointer-events: none; /* Deshabilitar clicks */
  }
}
/* SMALL MOBILE (hasta 480px) */
@media (max-width: 480px) {
  .header h1 {
    font-size: 1.6rem;
  }
  .filters {
    flex-direction: column;
    align-items: flex-start;
  }
  body.favorites-open .favorites-panel {
    width: 90%;
  }
}
/* ===========================
   GALERÍA PRINCIPAL
   =========================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  transition: all 0.3s ease;
}

/* Cuando favoritos está abierto, ajustar grid */
body.favorites-open .gallery {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* Card de galería */
.gallery .cat-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.gallery .cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 122, 24, 0.3);
}

.gallery .cat-card img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.gallery .cat-card:hover img {
  transform: scale(1.05);
}

/* Galería vacía */
.gallery-empty {
  grid-column: 1/-1;
  text-align: center;
  opacity: 0.6;
  font-style: italic;
  margin-top: 2rem;
  padding: 3rem;
}

/* Wrapper con scroll infinito */
.gallery-wrapper {
  height: calc(100vh - 320px);
  overflow-y: auto;
  padding-right: 12px;
  scroll-behavior: smooth;
}
.gallery-wrapper::-webkit-scrollbar {
  width: 10px;
}
.gallery-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}
.gallery-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 24, 0.5);
  border-radius: 6px;
}
.gallery-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 24, 0.8);
}

/* Ajustes cuando favoritos está abierto */
body.favorites-open .gallery-wrapper {
  height: calc(100vh - 280px);
  padding-right: 8px;
}

/* ===========================
   RESPONSIVE
   =========================== */
/* DESKTOP GRANDE (>1400px) */
@media (min-width: 1400px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  body.favorites-open .gallery {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }
  body.favorites-open .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  .gallery-wrapper {
    height: calc(100vh - 280px);
  }
}
/* MOBILE (hasta 768px) */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  /* En mobile, galería mantiene su grid normal */
  body.favorites-open .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .gallery .cat-card img {
    min-height: 200px;
  }
  .gallery-wrapper {
    height: calc(100vh - 240px);
  }
  body.favorites-open .gallery-wrapper {
    height: calc(100vh - 240px);
  }
}
/* SMALL MOBILE (hasta 480px) */
@media (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr); /* Exactamente 2 columnas */
    gap: 10px;
  }
  .gallery .cat-card img {
    min-height: 180px;
  }
}
/* ===========================
   BOTÓN FLOTANTE DE FAVORITOS
   =========================== */
.favorites-btn {
  position: fixed;
  top: 2rem;
  right: 2rem;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff4d4d, #ff1f1f);
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 77, 77, 0.4);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.3s ease;
}
.favorites-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 77, 77, 0.6);
}
.favorites-btn .heart-icon {
  font-size: 1.2rem;
}
.favorites-btn .badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===========================
   PANEL LATERAL - Desktop
   =========================== */
.favorites-panel {
  display: none; /* Oculto por defecto */
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  height: fit-content;
  max-height: calc(100vh - 180px);
  position: sticky;
  top: 1rem;
}

/* Mostrar panel cuando está abierto */
body.favorites-open .favorites-panel {
  display: flex;
  flex-direction: column;
}

/* Header del panel */
.favorites-panel-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0; /* No se comprime */
}
.favorites-panel-header h2 {
  font-size: 1.3rem;
  margin: 0;
}

/* Botón de cerrar */
.favorites-panel .close-btn {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.6);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.favorites-panel .close-btn:hover {
  color: #fff;
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.1);
}

/* ===========================
   CONTENEDOR CON SCROLL
   =========================== */
.favorites-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  /* Scrollbar personalizada */
}
.favorites-container::-webkit-scrollbar {
  width: 8px;
}
.favorites-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.favorites-container::-webkit-scrollbar-thumb {
  background: rgba(255, 77, 77, 0.4);
  border-radius: 4px;
}
.favorites-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 77, 77, 0.6);
}

/* ===========================
   GRID DE FAVORITOS: 2 columnas
   =========================== */
.favorites-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

/* Tarjetas de favoritos con aspect ratio uniforme */
.favorites-gallery .cat-card {
  position: relative;
  aspect-ratio: 3/4;
  max-height: 220px; /* 👈 Límite de altura para imágenes verticales */
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.favorites-gallery .cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 77, 77, 0.3);
}

.favorites-gallery .cat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.favorites-gallery .cat-card:hover img {
  transform: scale(1.08);
}

/* Botón de favorito dentro de la tarjeta */
.favorites-gallery .cat-card button.favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}
.favorites-gallery .cat-card button.favorite:hover {
  background: #ff4d4d;
  transform: scale(1.15);
}
.favorites-gallery .cat-card button.favorite.active {
  background: #ff4d4d;
}

/* ===========================
   EMPTY STATE
   =========================== */
.favorites-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem 1rem;
  opacity: 0.6;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   RESPONSIVE
   =========================== */
/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  .favorites-panel {
    max-height: calc(100vh - 150px);
  }
  .favorites-gallery {
    gap: 0.6rem;
  }
  .favorites-panel-header h2 {
    font-size: 1.2rem;
  }
}
/* MOBILE (hasta 768px) */
@media (max-width: 768px) {
  /* Panel como slide-in desde la derecha */
  .favorites-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 999;
    transform: translateX(100%); /* Oculto fuera de pantalla */
    transition: transform 0.3s ease;
  }
  /* Mostrar panel con animación */
  body.favorites-open .favorites-panel {
    transform: translateX(0); /* Slide in */
  }
  .favorites-btn {
    top: 1rem;
    right: 1rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  .favorites-btn .favorites-label {
    display: none; /* Ocultar label en mobile */
  }
  .favorites-panel-header {
    padding: 1rem 1.2rem;
  }
  .favorites-container {
    padding: 0.8rem;
  }
  .favorites-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .favorites-gallery .cat-card {
    aspect-ratio: 1/1; /* Cuadradas en mobile */
    max-height: 180px; /* Altura ajustada para mobile */
  }
}
/* SMALL MOBILE (hasta 480px) */
@media (max-width: 480px) {
  .favorites-panel {
    width: 90%;
  }
  .favorites-gallery {
    gap: 0.4rem;
  }
  .favorites-panel-header h2 {
    font-size: 1.1rem;
  }
}
.loader {
  width: 64px;
  height: 64px;
  margin: 60px auto;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ff3366;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Clase utilitaria */
.hidden {
  display: none !important;
}

/*# sourceMappingURL=styles.css.map */
