/* ============================================================
   Velvet Route — catalogo.css
   Estilos específicos de la página /catalogo/
   ============================================================ */

/* ── Encabezado de página ────────────────────────────────── */
.catalog-page-header {
  padding: 120px clamp(22px, 5vw, 68px) 52px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(194,39,61,.10), transparent),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.catalog-page-header-content { max-width: 680px; }

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .83rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color var(--t);
}
.breadcrumb:hover { color: var(--text-dim); }

.catalog-page-header h1 {
  font-family: 'Cormorant', Georgia, serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.02em;
  margin: 0 0 20px;
}

.catalog-page-desc {
  color: var(--text-dim);
  font-size: clamp(.92rem, 1.8vw, 1.05rem);
  line-height: 1.72;
  max-width: 52ch;
  margin: 0;
}

/* ── Cuerpo ──────────────────────────────────────────────── */
.catalog-page-body {
  padding: 40px clamp(22px, 5vw, 68px) 88px;
}

/* ── Controles ───────────────────────────────────────────── */
.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

/* ── Fila de dropdowns ───────────────────────────────────── */
.filter-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Dropdown wrapper ────────────────────────────────────── */
.filter-dropdown {
  position: relative;
}

/* ── Botón trigger ───────────────────────────────────────── */
.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-dim);
  font: inherit;
  font-size: .87rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.filter-trigger:hover {
  background: rgba(255,255,255,.09);
  border-color: var(--line-mid);
  color: var(--text);
}
.filter-trigger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Trigger con filtro activo */
.filter-trigger.filter-trigger--active {
  background: var(--red-subtle);
  border-color: var(--red-border);
  color: var(--text);
}

/* Trigger cuando el panel está abierto */
.filter-dropdown.open .filter-trigger {
  background: rgba(255,255,255,.09);
  border-color: var(--line-mid);
  color: var(--text);
}

.filter-trigger-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--t);
}
.filter-trigger:hover .filter-trigger-label,
.filter-dropdown.open .filter-trigger-label,
.filter-trigger.filter-trigger--active .filter-trigger-label {
  color: inherit;
}

.filter-trigger-sep {
  color: var(--text-muted);
  font-size: .8rem;
  opacity: .45;
}

.filter-trigger-val {
  font-weight: 600;
  color: var(--text);
}

.filter-trigger-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s var(--ease), color var(--t);
}
.filter-dropdown.open .filter-trigger-chevron {
  transform: rotate(180deg);
  color: var(--text-dim);
}

/* ── Panel desplegable ───────────────────────────────────── */
.filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 190px;
  background: var(--surface-raised);
  border: 1px solid var(--line-mid);
  border-radius: 12px;
  padding: 6px;
  box-shadow:
    0 16px 48px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Origin-aware: el panel escala desde su trigger (arriba), no desde el centro */
  transform-origin: top center;
  animation: panelIn .16s var(--ease-out, cubic-bezier(.23,1,.32,1)) both;
}

.filter-panel[hidden] { display: none; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

@media (prefers-reduced-motion: reduce) {
  .filter-panel { animation: none; }
}

/* ── Opción dentro del panel ─────────────────────────────── */
.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-dim);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.filter-option:hover {
  background: rgba(255,255,255,.07);
  color: var(--text);
}

/* Punto indicador */
.filter-option::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: transparent;
  transition: background var(--t);
}
.filter-option.active {
  color: var(--text);
  font-weight: 600;
}
.filter-option.active::before { background: var(--red); }

/* +18 */
.filter-option--mature            { color: var(--red-bright); }
.filter-option--mature:hover      { background: var(--red-subtle); color: var(--red-bright); }
.filter-option--mature.active::before { background: var(--red-bright); }

/* ── Buscador ────────────────────────────────────────────── */
.catalog-search-wrap {
  width: 100%;
  max-width: 420px;
}

/* ── Estado vacío ────────────────────────────────────────── */
.catalog-empty-msg {
  padding: 64px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* ── Tablet ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  /* El site-header es position:absolute y más alto en esta vista */
  .catalog-page-header { padding-top: 180px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Móvil ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .catalog-page-header {
    padding-top: 160px;
    padding-bottom: 32px;
  }

  .catalog-page-header h1 { margin-bottom: 12px; }

  .catalog-page-body {
    padding: 24px 16px 64px;
  }

  .catalog-controls { gap: 10px; margin-bottom: 24px; }

  /*
   * Grid 2×2 en lugar de scroll horizontal.
   * CRÍTICO: sin overflow aquí para que los paneles
   * absolutos no queden recortados.
   */
  .filter-bar-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Botón trigger: llena su celda del grid */
  .filter-dropdown { width: 100%; }

  .filter-trigger {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    justify-content: space-between;
  }

  /* En móvil solo mostramos la etiqueta + chevron;
     el valor se ve en el panel al abrirlo.
     Cuando hay un filtro activo, el borde rojo lo indica. */
  .filter-trigger-sep,
  .filter-trigger-val { display: none; }

  /* Columna derecha: el panel se abre hacia la izquierda */
  .filter-bar-row .filter-dropdown:nth-child(even) .filter-panel {
    left: auto;
    right: 0;
  }

  /* Panel ocupa todo el ancho de su trigger como mínimo */
  .filter-panel { min-width: 160px; }

  /* Buscador: ancho completo */
  .catalog-search-wrap { max-width: 100%; }

  /* Grid de tarjetas: 1 columna */
  .project-grid { grid-template-columns: 1fr; }
}

/* ── Móvil muy pequeño (< 360px) ────────────────────────── */
@media (max-width: 359px) {
  .filter-trigger { padding: 0 10px; font-size: .8rem; }
  .filter-trigger-label { letter-spacing: .04em; }
}
