/* ════════════════════════════════════════════════
   DIRECTORIO DE TIENDAS — sitio.gt V6.2
   Página /tiendas/ — app-like, cards cuadradas, filas por categoría.
   Path: /wp-content/themes/sitio-v5/assets/css/pages/05-stores-directory.css
   ════════════════════════════════════════════════ */

.st-dir { max-width: 1280px; margin: 0 auto; padding: 0 14px 40px; }

/* ── HERO ── */
.st-hero {
  margin: 10px 0 12px;
  background: linear-gradient(135deg, var(--jade), var(--jade-900));
  border-radius: var(--r-l);
  padding: 18px 18px 16px;
  color: #fff;
}
.st-hero-h { font-family: var(--fd); font-weight: 900; font-size: 21px; margin: 0 0 3px; color: #fff; line-height: 1.15; }
.st-hero-sub { font-size: 13px; opacity: .95; margin: 0; }
.st-hero-link { color: #fff; font-weight: 700; text-decoration: underline; }

/* ── BUSCADOR + botón filtro ── */
.st-searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--bdr);
  border-radius: var(--r-xl); padding: 6px 6px 6px 14px;
  margin-bottom: 12px; box-shadow: 0 2px 10px rgba(15,23,42,.04);
}
.st-searchbar:focus-within { border-color: var(--jade); }
.st-searchbar-ic { font-size: 15px; opacity: .6; }
.st-searchbar input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; font-family: inherit; color: var(--head); min-width: 0;
}
.st-filter-open {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  background: var(--jade-l); color: var(--jade); border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s;
}
.st-filter-open:active { background: var(--jade); color: #fff; }

/* ── Chips de filtros activos ── */
.st-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.st-active-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--jade-l); color: var(--jade-900);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700;
  font-family: var(--fd); text-decoration: none;
}
.st-active-clear { font-size: 12px; color: var(--muted); text-decoration: underline; margin-left: 4px; }

/* ── FILAS POR CATEGORÍA ── */
.st-rowsec { margin-bottom: 22px; }
.st-rowsec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.st-rowsec-title { font-family: var(--fd); font-weight: 800; font-size: 17px; color: var(--head); margin: 0; }
.st-rowsec-all { font-size: 12px; font-weight: 700; color: var(--jade); text-decoration: none; white-space: nowrap; }
.st-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.st-row::-webkit-scrollbar { display: none; }
.st-row .st-card { flex: 0 0 64%; max-width: 240px; scroll-snap-align: start; }

/* ── GRID (cuando hay filtro) ── */
.st-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* ── CARD CUADRADA ── */
.st-card {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r-l); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 12px rgba(15,23,42,.05);
  transition: transform .15s, box-shadow .15s;
}
.st-card:active { transform: scale(.985); }
.st-card-link { text-decoration: none; color: inherit; display: block; }
.st-card-cover {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--bg-s);
}
.st-card-badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.st-badge {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.st-badge-ver { background: var(--jade); }
.st-badge-gold { background: var(--gold); }
.st-card-logo {
  position: absolute; left: 10px; bottom: -16px;
  width: 46px; height: 46px; border-radius: 13px;
  border: 3px solid var(--card); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(15,23,42,.18);
}
.st-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.st-card-logo span { color: #fff; font-family: var(--fd); font-weight: 800; font-size: 18px; }
.st-card-body { padding: 22px 12px 8px; }
.st-card-name {
  font-family: var(--fd); font-weight: 800; font-size: 14px; color: var(--head);
  margin: 0 0 3px; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.st-name-ver { color: var(--jade); font-size: 12px; }
.st-card-meta { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.st-card-meta strong { color: var(--head); }
.st-meta-dot { opacity: .5; }

/* ── Pie de card: WA + Seguir ── */
.st-card-foot { display: flex; gap: 6px; padding: 0 12px 12px; margin-top: auto; }
.st-foot-wa {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: var(--wa); color: #fff;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.st-foot-follow {
  flex: 1; height: 34px; border-radius: 10px;
  background: var(--jade-l); color: var(--jade-900);
  border: 1.5px solid transparent; cursor: pointer;
  font-family: var(--fd); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  transition: background .15s, color .15s;
}
.st-foot-follow.is-following { background: var(--jade); color: #fff; }

/* ── EMPTY ── */
.st-empty { text-align: center; padding: 50px 20px; }
.st-empty-ic { font-size: 46px; margin-bottom: 8px; }
.st-empty h3 { font-family: var(--fd); font-weight: 800; font-size: 17px; color: var(--head); margin: 0 0 4px; }
.st-empty p { font-size: 13px; color: var(--muted); margin: 0 0 16px; }

/* ── BOTTOM SHEET DE FILTROS ── */
.st-sheet { position: fixed; inset: 0; z-index: 600; visibility: hidden; }
.st-sheet.open { visibility: visible; }
.st-sheet-ov {
  position: absolute; inset: 0; background: rgba(15,23,42,.45);
  opacity: 0; transition: opacity .25s;
}
.st-sheet.open .st-sheet-ov { opacity: 1; }
.st-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card); border-radius: 22px 22px 0 0;
  max-height: 86vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.16,1,.3,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.st-sheet.open .st-sheet-panel { transform: translateY(0); }
.st-sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--bdr-m); margin: 9px auto 4px; }
.st-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 10px; border-bottom: 1px solid var(--bdr); }
.st-sheet-title { font-family: var(--fd); font-weight: 800; font-size: 17px; color: var(--head); }
.st-sheet-x { background: var(--bg-s); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; color: var(--muted); cursor: pointer; }
.st-sheet-body { overflow-y: auto; padding: 14px 18px 6px; }
.st-fgroup { margin-bottom: 16px; }
.st-flbl { font-family: var(--fd); font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.st-fchips { display: flex; flex-wrap: wrap; gap: 7px; }
.st-fchip {
  display: inline-flex; align-items: center; cursor: pointer;
  background: var(--bg-s); border: 1.5px solid var(--bdr);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  font-family: var(--fd); color: var(--head); transition: all .14s;
}
.st-fchip input { position: absolute; opacity: 0; pointer-events: none; }
.st-fchip.on, .st-fchip:has(input:checked) { background: var(--jade); border-color: var(--jade); color: #fff; }
.st-ftoggle { display: flex; align-items: center; gap: 9px; padding: 10px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--head); cursor: pointer; }
.st-ftoggle input { width: 18px; height: 18px; accent-color: var(--jade); }
.st-sheet-foot { display: flex; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--bdr); }
.st-sheet-clear { flex: 0 0 38%; text-align: center; }
.st-sheet-apply { flex: 1; }

/* ── DESKTOP ── */
@media (min-width: 769px) {
  .st-dir { padding: 0 24px 60px; }
  .st-hero-h { font-size: 26px; }
  .st-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .st-row .st-card { flex: 0 0 220px; }
  .st-rowsec-title { font-size: 19px; }
  /* En desktop el sheet se centra como modal */
  .st-sheet-panel {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -46%); width: 460px; max-width: 92vw;
    border-radius: 20px; max-height: 80vh;
  }
  .st-sheet.open .st-sheet-panel { transform: translate(-50%, -50%); }
  .st-sheet-handle { display: none; }
}
