/*-----------------------------------*\
  #directory.css — directorio del tianguis
  Misma paleta y tipografías que las páginas de los negocios (plantilla Grilli).
\*-----------------------------------*/

:root {
  --gold: hsl(38, 61%, 73%);
  --gold-soft: hsla(38, 61%, 73%, 0.14);
  --bg: hsl(40, 12%, 5%);
  --bg-2: hsl(210, 4%, 9%);
  --bg-3: hsl(210, 4%, 11%);
  --line: hsla(0, 0%, 100%, 0.09);
  --text: hsl(0, 0%, 100%);
  --muted: hsl(0, 0%, 65%);
  --green: hsl(145, 55%, 52%);
  --forum: 'Forum', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------------- botones ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em; text-decoration: none;
  border: 1px solid var(--gold); transition: background-color .2s, color .2s, transform .1s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--gold); color: #111; }
.btn.primary:hover { background: hsl(38, 61%, 80%); }
.btn.ghost { background: transparent; color: var(--gold); }
.btn.ghost:hover { background: var(--gold-soft); }

/* ---------------- portada ---------------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 64px 0 44px; text-align: center;
  background-color: #0b0d16;
  border-bottom: 1px solid var(--line);
}
.hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; opacity: 0; transition: opacity .6s; }
.hero.has-cover .hero-bg { opacity: 1; }
.hero.has-cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, hsla(0, 0%, 0%, 0.55), hsla(40, 12%, 5%, 0.92) 85%, var(--bg));
}
.brand-logo { width: min(520px, 88vw); height: auto; margin: 0 auto 2px; filter: drop-shadow(0 6px 24px hsla(0, 0%, 0%, 0.6)); }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.eyebrow { margin: 0; color: var(--gold); text-transform: uppercase; letter-spacing: 0.3em; font-size: 12px; font-weight: 700; }
.title {
  margin: 0; font-family: var(--forum); font-weight: 400;
  font-size: clamp(42px, 11vw, 86px); line-height: 1; letter-spacing: 0.01em;
}
.schedule { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.status {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
}
.status.on { color: var(--text); border-color: hsla(145, 55%, 52%, 0.4); }
.status.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px hsla(145, 55%, 52%, 0.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px hsla(145, 55%, 52%, 0.05); } }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }

/* ---------------- buscador y categorías ---------------- */

.toolbar {
  position: sticky; top: 0; z-index: 20;
  padding: 12px 0 10px;
  background: hsla(40, 12%, 5%, 0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--gold); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px;
}
.search input::placeholder { color: var(--muted); }

.chips {
  display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none;
  margin-left: -18px; margin-right: -18px; padding: 0 18px 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 500;
  transition: border-color .2s, color .2s, background-color .2s;
}
.chip span { font-size: 12px; opacity: 0.7; }
.chip:hover { color: var(--text); border-color: hsla(0, 0%, 100%, 0.25); }
.chip.active { background: var(--gold); border-color: var(--gold); color: #111; }

/* ---------------- secciones ---------------- */

.block { padding-top: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.h2 { margin: 0 0 14px; font-family: var(--forum); font-weight: 400; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; }
.count { color: var(--muted); font-size: 14px; white-space: nowrap; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% - 26px); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 18px; scrollbar-width: none;
  margin: 0 -18px; padding: 0 18px 4px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 560px) { .rail { grid-auto-columns: 46%; } }
@media (min-width: 900px) { .rail { grid-auto-columns: calc((100% - 36px) / 3); } }

/* ---------------- tarjeta ---------------- */

.card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden; text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: transform .2s, border-color .2s;
}
.card:hover { border-color: hsla(38, 61%, 73%, 0.45); transform: translateY(-2px); }
.card:active { transform: scale(0.99); }

.media { position: relative; aspect-ratio: 16 / 9; background: var(--bg-3); overflow: hidden; }
.card.big .media { aspect-ratio: 4 / 3; }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .media img { transform: scale(1.04); }
.logo-fill { padding: 16%; }
.logo-fill img { width: 100%; height: 100%; object-fit: contain; }
.card:hover .logo-fill img { transform: none; }
.media-fill {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--forum); font-size: 54px; color: var(--gold);
  background: radial-gradient(circle at 30% 20%, hsla(38, 61%, 73%, 0.18), transparent 60%), var(--bg-3);
}
.badge {
  position: absolute; left: 12px; top: 12px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: hsla(0, 0%, 0%, 0.65); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge.on { color: #fff; }
.badge.on::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
.star { position: absolute; right: 12px; top: 10px; color: var(--gold); font-size: 18px; text-shadow: 0 1px 6px #000; }

.body { position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 14px 16px 16px; }
.logo {
  position: absolute; right: 14px; top: -28px;
  width: 56px; height: 56px; border-radius: 50%; object-fit: contain;
  background: #000; border: 2px solid var(--bg-2); padding: 4px;
}
.cat { color: var(--gold); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; padding-right: 64px; }
.name { margin: 0; font-family: var(--forum); font-weight: 400; font-size: 26px; line-height: 1.15; padding-right: 64px; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.own { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 700; font-size: 14px; }
.go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.card:hover .go svg { transform: translateX(3px); }

.skeleton { aspect-ratio: 4 / 5; min-height: 0; background: linear-gradient(100deg, var(--bg-2) 30%, var(--bg-3) 50%, var(--bg-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

.empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 30px 10px; margin: 0; }

/* ---------------- ubicación ---------------- */

.location { padding-bottom: 10px; }
.address { margin: -4px 0 14px; color: var(--muted); }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-3); aspect-ratio: 16 / 10; margin-bottom: 14px; }
@media (min-width: 900px) { .map { aspect-ratio: 21 / 8; } }
.map-note { height: 100%; display: grid; place-items: center; text-align: center; margin: 0; padding: 20px; color: var(--muted); font-size: 14px; }
.map iframe { width: 100%; height: 100%; border: 0; filter: invert(0.9) hue-rotate(180deg) saturate(0.6) brightness(0.95); }

/* ---------------- pie ---------------- */

.footer { margin-top: 40px; padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }
.footer p { margin: 6px 0; }
.footer a { color: var(--gold); }
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 14px 0 10px; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: var(--gold); }
.join { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------- aviso de privacidad y términos ---------------- */
.doc { max-width: 760px; padding-top: 28px; padding-bottom: 50px; }
.doc section { padding-top: 26px; }
.doc .h2 { margin-bottom: 4px; }
.doc h2:not(.h2) { font-size: 17px; margin: 22px 0 6px; color: var(--gold); }
.doc p { margin: 0 0 10px; color: hsl(0, 0%, 85%); }
.doc a { color: var(--gold); }
.doc-date { color: var(--muted) !important; font-size: 14px; }
.doc-back { display: inline-block; color: var(--gold); text-decoration: none; font-weight: 700; }
