/* ==============================================
   HIDER · catalog.css
   Ubicación: HIDER - frontend/css/catalog.css
   Descripción: Estilos para la página de catálogo, incluyendo filtros y grilla de productos
   Página de Tienda · filtros · grilla
   ============================================== */

/* ── Page hero ───────────────────────────────── */
.page-hero {
  position: relative;
  padding: 72px 0 86px;
  background:
    linear-gradient(rgba(254, 250, 244, 0.46), rgba(254, 250, 244, 0.24)),
    url('https://images.unsplash.com/photo-1483985988355-763728e1935b?auto=format&fit=crop&w=1600&q=80')
    center 35% / cover no-repeat;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 18px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(254,250,244,0.9);
}

.breadcrumb a {
  color: var(--brown);
  transition: color var(--duration);
}

.breadcrumb a:hover { color: var(--brown); }

.breadcrumb .current { color: var(--brown); }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 400;
  color: var(--brown-deep);
  line-height: 1.05;
  text-shadow: 0 2px 14px rgba(254,250,244,0.92), 0 1px 1px rgba(255,255,255,0.85);
}

.page-sub {
  margin-top: 12px;
  color: var(--brown);
  font-size: 16px;
  max-width: 480px;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(254,250,244,0.9), 0 1px 1px rgba(255,255,255,0.8);
}

/* ── Layout ──────────────────────────────────── */
.catalog {
  padding: 40px 0 80px;
  position: relative;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Filtros ─────────────────────────────────── */
.filters {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
}

.filters__close {
  display: none;
  color: var(--ink);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.filter-group__title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.filter-radio,
.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  transition: color var(--duration);
}

.filter-radio:hover,
.filter-check:hover { color: var(--brown); }

.filter-radio input,
.filter-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: border-color var(--duration), background var(--duration);
}

.filter-radio input { border-radius: 50%; }
.filter-check input { border-radius: 5px; }

.filter-radio input:checked,
.filter-check input:checked {
  border-color: var(--brown);
  background: var(--brown);
}

.filter-radio input:checked::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--cream);
}

.filter-check input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--cream);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Toolbar ─────────────────────────────────── */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.catalog-count {
  font-size: 14px;
  color: var(--muted);
}

.catalog-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filters__toggle { display: none; }

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--line);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 42px 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition:
    border-color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
  min-width: 160px;
}

.select:hover {
  border-color: var(--brown);
  background: var(--surface);
}

.select:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(91, 66, 52, 0.1);
  background: var(--surface);
}

.select option {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px;
  background: var(--surface);
  color: var(--text);
}

.select-wrap svg {
  position: absolute;
  right: 14px;
  pointer-events: none;
  color: var(--brown);
  transition: transform 0.2s var(--ease);
}

.select-wrap:focus-within svg {
  transform: rotate(180deg);
}

/* Dark mode select */
[data-theme="dark"] .select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
[data-theme="dark"] .select:hover,
[data-theme="dark"] .select:focus {
  background: var(--surface-2);
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(212, 168, 122, 0.12);
}
[data-theme="dark"] .select-wrap svg {
  color: var(--gold-light);
}
[data-theme="dark"] .select option {
  background: var(--surface);
  color: var(--text);
}

/* ── Empty ───────────────────────────────────── */
.catalog-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.catalog-empty svg { color: var(--line); margin-bottom: 20px; }

.catalog-empty h3 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--ink);
  margin-bottom: 8px;
}

.catalog-empty p { margin-bottom: 24px; }

/* ── Cargar más ──────────────────────────────── */
.catalog-more {
  text-align: center;
  margin-top: 48px;
}

/* ── Scrim filtros (móvil) ───────────────────── */
.filters-scrim {
  position: fixed;
  inset: 0;
  background: rgba(30, 18, 8, 0.45);
  backdrop-filter: blur(4px);
  z-index: 198;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.filters-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .filters {
    position: fixed;
    inset: 0;
    right: auto;
    width: min(320px, 88vw);
    background: var(--white);
    z-index: 199;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.38s var(--ease-out);
    box-shadow: var(--shadow-lg);
    gap: 24px;
  }

  .filters.open { transform: translateX(0); }

  .filters__close { display: flex; }

  .filters__toggle { display: inline-flex; }
}

/* Animación de entrada de las cards */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#catalogGrid .pc {
  animation: cardIn 0.4s var(--ease-out) both;
}
/* ══════════════════════════════════════════════
   DARK MODE — catalog
   ══════════════════════════════════════════════ */
[data-theme="dark"] .page-hero {
  background: linear-gradient(rgba(15,12,10,0.7), rgba(15,12,10,0.5)),
    url('https://images.unsplash.com/photo-1483985988355-763728e1935b?auto=format&fit=crop&w=1600&q=80')
    center 35% / cover no-repeat;
  border-bottom-color: var(--line);
}
[data-theme="dark"] .page-title {
  color: #fff8ef;
  text-shadow: 0 2px 16px rgba(0,0,0,0.72), 0 0 2px rgba(0,0,0,0.9);
}

[data-theme="dark"] .breadcrumb {
  color: #ead4bd;
  text-shadow: 0 2px 12px rgba(0,0,0,0.75);
}

[data-theme="dark"] .breadcrumb a,
[data-theme="dark"] .breadcrumb .current {
  color: #fff1df;
}

[data-theme="dark"] .filters {
  background: transparent;  /* en desktop no necesita fondo, hereda la página */
  border-right-color: transparent;
}

/* En móvil sí necesita fondo porque es un panel flotante */
@media (max-width: 900px) {
  [data-theme="dark"] .filters {
    background: var(--surface);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
}
[data-theme="dark"] .filters__title          { color: var(--text); }
[data-theme="dark"] .filter-group__title    { color: var(--muted); }
[data-theme="dark"] .filter-radio span,
[data-theme="dark"] .filter-check span      { color: var(--text); }
[data-theme="dark"] .filter-radio input,
[data-theme="dark"] .filter-check input     { accent-color: var(--gold-light); }
[data-theme="dark"] .page-sub {
  color: #f0d8bf;
  text-shadow: 0 2px 14px rgba(0,0,0,0.72), 0 0 2px rgba(0,0,0,0.9);
}
[data-theme="dark"] .catalog-count { color: var(--muted); }
[data-theme="dark"] .catalog-toolbar {
  border-bottom-color: var(--line);
}
[data-theme="dark"] .pc-skeleton .skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
}
[data-theme="dark"] .catalog-empty h3 { color: var(--text); }
