/* Página /sucursales 17.0.3: localizador de tiendas.
 * Sistema visual: DESIGN.md (raíz de ifcreatif-addons). Todo cuelga de .chs para no tocar el resto del sitio.
 * Escritorio (>= 960px): panel de lista a la izquierda, mapa a todo lo alto a la derecha, ficha flotante sobre el mapa.
 * Celular: lista a pantalla completa, botón "Ver mapa" flotante, mapa y ficha a pantalla completa. */

.chs {
  --chs-red: #BD0926;          /* rojo Chrismas: acciones, pines y estado "Experiencia Navideña" */
  --chs-red-press: #9C0720;
  --chs-red-soft: #FBEDEF;
  --chs-pine: #1E6B45;         /* verde pino: pines y estado "Foto con tu Celular" */
  --chs-pine-soft: #E9F3EE;
  --chs-ink: #1D1D1F;
  --chs-body: #3A3A3C;
  --chs-muted: #6E6E73;
  --chs-line: #E5E5EA;
  --chs-soft: #F5F5F7;
  --chs-canvas: #FFFFFF;
  --chs-top: 0px;              /* alto del encabezado fijo del sitio, si lo hay */
  --chs-panel: clamp(400px, 38vw, 560px);
  --chs-r: 14px;
  --chs-float: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .16); /* taste-skill-ignore: única sombra, solo en lo que flota */
  color: var(--chs-ink);
  background: var(--chs-canvas);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.chs *, .chs *::before, .chs *::after { box-sizing: border-box; }
.chs a { color: inherit; text-decoration: none; }
.chs :where(button) { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.chs :focus-visible { outline: 3px solid var(--chs-red); outline-offset: 2px; border-radius: 6px; }
.chs-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Panel ---------- */
.chs-panel { background: var(--chs-canvas); }
.chs-panel__head { padding: 24px 16px 8px; }
.chs-panel h1 {
  margin: 0 0 20px; font-size: 2rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em;
  color: var(--chs-ink); text-wrap: balance;
}

.chs-search {
  display: flex; align-items: center; gap: 8px; margin: 0;
  background: var(--chs-soft); border-radius: 12px; padding: 6px 6px 6px 16px;
}
.chs-search:focus-within { box-shadow: inset 0 0 0 2px var(--chs-ink); } /* taste-skill-ignore: anillo de foco */
.chs-search .chs-ico { color: var(--chs-muted); }
.chs-search input {
  flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: 0;
  font: inherit; font-size: 1rem; color: var(--chs-ink);
}
.chs-search input::placeholder { color: var(--chs-muted); }
.chs-search input::-webkit-search-cancel-button { cursor: pointer; }
.chs-search__go {
  height: 44px; padding: 0 20px; border: 0; border-radius: 8px;
  background: var(--chs-ink); color: #fff !important; font-weight: 600; font-size: 1rem;
  transition: background-color .15s;
}
.chs-search__go:hover { background: #000; }

.chs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chs-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--chs-soft); font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.chs-chip:hover { background: var(--chs-line); }
.chs-chip[aria-pressed="true"] { background: var(--chs-ink); color: #fff; }
.chs-chip__n { color: var(--chs-muted); font-variant-numeric: tabular-nums; }
.chs-chip[aria-pressed="true"] .chs-chip__n { color: #C7C7CC; }
.chs-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chs-dot--experiencia { background: var(--chs-red); }
.chs-dot--celular { background: var(--chs-pine); }

.chs-listbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 4px;
}
.chs-count { margin: 0; color: var(--chs-muted); font-size: 1rem; font-variant-numeric: tabular-nums; }
.chs-near {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px;
  border: 0; background: none; color: var(--chs-red); font-weight: 600; font-size: .9375rem;
}
.chs-near:hover { text-decoration: underline; text-underline-offset: 3px; }
.chs-near[aria-pressed="true"] { color: var(--chs-ink); }

/* ---------- Renglones ---------- */
.chs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chs-row { border-top: 1px solid var(--chs-line); } /* taste-skill-ignore: separador de renglones de la lista (patrón de localizador) */
.chs-row:first-child { border-top: 0; }
.chs-row[hidden] { display: none; }
.chs-row__link {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 16px; align-items: start;
  padding: 18px 16px; transition: background-color .15s;
}
.chs-row__link:hover { background: #FAFAFA; }
.chs-row.is-on .chs-row__link { background: var(--chs-soft); }
.chs-row__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chs-row__name {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 1.1875rem; line-height: 1.25; font-weight: 700; color: var(--chs-ink); margin-bottom: 4px;
}
.chs-tag {
  display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--chs-ink); color: #fff;
  font-size: .8125rem; font-weight: 600; line-height: 1.3;
}
.chs-status { margin: 0; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.chs-status--experiencia { color: var(--chs-red); }
.chs-status--celular, .chs-status--evento { color: var(--chs-pine); }
.chs-row__line { color: var(--chs-body); font-size: 1rem; overflow-wrap: anywhere; }
.chs-dist:empty { display: none; }
.chs-dist { color: var(--chs-muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.chs-row__img {
  display: block; width: 120px; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--chs-soft);
}
.chs-row__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sin foto: campo de color suave con la estrella del color de su tipo. */
.chs-ph { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: var(--chs-red-soft); color: var(--chs-red); }
.chs-row[data-f="celular"] .chs-ph, .chs-det[data-f="celular"] .chs-ph { background: var(--chs-pine-soft); color: var(--chs-pine); }
.chs-ph .chs-ico { width: 34px; height: 34px; }
.chs-ph--lg .chs-ico { width: 64px; height: 64px; stroke-width: 1.4; }

.chs-empty { margin: 0; padding: 32px 16px; color: var(--chs-body); }
.chs-credits { padding: 24px 16px 32px; color: var(--chs-muted); font-size: .875rem; }
.chs-credits summary { cursor: pointer; min-height: 32px; }
.chs-credits ul { margin: 8px 0 0; padding-left: 18px; }
.chs-credits a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Mapa ---------- */
.chs-mapbox { position: relative; background: #EEF0EC; }
.chs-map { position: absolute; inset: 0; z-index: 0; }
.chs-map .leaflet-tile-pane { filter: saturate(.6) brightness(1.04) contrast(.94); }
.chs-map-msg {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--chs-muted); z-index: 1;
}
.chs-map-msg[hidden] { display: none; }
.chs .leaflet-container { font: inherit; background: #EEF0EC; }
.chs .leaflet-control-zoom { border: 0; box-shadow: var(--chs-float); border-radius: 12px; overflow: hidden; } /* taste-skill-ignore: control flotante sobre el mapa */
.chs .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; color: var(--chs-ink); border-color: var(--chs-line); }
.chs .leaflet-control-attribution { padding: 2px 16px 2px 8px; font-size: 11px; background: rgba(255, 255, 255, .8); } /* taste-skill-ignore: atribución obligatoria de OSM */

/* Pin: gota del color de su tipo con punto blanco, como en la referencia. */
.chs-pin {
  width: 34px; height: 44px; transform-origin: 50% 100%; transition: transform .15s;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); /* taste-skill-ignore */
}
.chs-pin svg { display: block; width: 100%; height: 100%; }
.chs-pin path { fill: var(--chs-red); stroke: #fff; stroke-width: 1.5; }
.chs-pin--celular path, .chs-pin--evento path { fill: var(--chs-pine); }
.chs-pin circle { fill: #fff; }
.chs-pin.is-hover { transform: scale(1.12); }
.chs-pin.is-on { transform: scale(1.3); }
.chs-me {
  width: 18px; height: 18px; border-radius: 50%; background: #1A73E8; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, .2); /* taste-skill-ignore: punto "tú estás aquí" */
}
.chs-tip.leaflet-tooltip { font: inherit; font-size: .875rem; font-weight: 600; border: 0; border-radius: 8px; padding: 6px 10px; box-shadow: var(--chs-float); } /* taste-skill-ignore: tooltip */

/* ---------- Ficha ---------- */
.chs-pop {
  background: var(--chs-canvas); overflow: auto; overscroll-behavior: contain;
}
.chs-pop[hidden] { display: none; }
.chs-pop__x {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--chs-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2); /* taste-skill-ignore: botón sobre foto */
}
.chs-pop__x .chs-ico { width: 22px; height: 22px; stroke-width: 2.2; }
.chs-det[hidden] { display: none; }
.chs-det__hero { aspect-ratio: 16 / 10; background: var(--chs-soft); overflow: hidden; }
.chs-det__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chs-det__logo {
  position: relative; z-index: 2; width: 96px; height: 96px; margin: -48px 0 0 32px; border-radius: 50%;
  background: var(--chs-red); border: 4px solid #fff; overflow: hidden; display: grid; place-items: center; /* el logo del sitio es blanco */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14); /* taste-skill-ignore: sello del logo sobre la foto */
}
.chs-det__logo img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.chs-det__logo-ph { display: grid; place-items: center; width: 100%; height: 100%; background: var(--chs-red); color: #fff; border-radius: 50%; }
.chs-det__logo-ph .chs-ico { width: 40px; height: 40px; fill: currentColor; stroke: none; }
.chs-det__body { padding: 16px 32px 32px; }
.chs-det__title { margin: 0 0 8px; font-size: 2.25rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--chs-ink); text-wrap: balance; }
.chs-det .chs-status { font-size: 1.0625rem; }
.chs-det__desc { margin: 16px 0 0; font-size: 1.0625rem; color: var(--chs-body); text-wrap: pretty; }
.chs-det__info { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.chs-det__info li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; align-items: start; font-size: 1.0625rem; color: var(--chs-ink); }
.chs-det__info .chs-ico { width: 24px; height: 24px; color: var(--chs-muted); stroke-width: 1.5; margin-top: 1px; }
/* Los botones quedan fijos al pie de la ficha: siempre visibles aunque la ficha sea más alta que la pantalla. */
.chs-det__actions {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px;
  margin: 20px -32px -32px; padding: 16px 32px calc(20px + env(safe-area-inset-bottom));
  background: var(--chs-canvas); box-shadow: 0 -1px 0 var(--chs-line); /* taste-skill-ignore: borde superior de la barra fija */
}
.chs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--chs-red); color: #fff !important; font-weight: 600; font-size: 1rem;
  transition: background-color .15s;
}
.chs-btn:hover { background: var(--chs-red-press); }
.chs-btn--line { background: transparent; color: var(--chs-ink) !important; box-shadow: inset 0 0 0 1.5px var(--chs-ink); } /* taste-skill-ignore: botón secundario */
.chs-btn--line:hover { background: var(--chs-soft); }

/* Peek del mapa en celular: tarjeta inferior al tocar un pin. */
.chs-peek {
  position: absolute; left: 12px; right: 12px; bottom: 88px; z-index: 500;
  background: #fff; border-radius: 16px; box-shadow: var(--chs-float); /* taste-skill-ignore: tarjeta flotante sobre el mapa */
}
.chs-peek[hidden] { display: none; }
.chs-peek .chs-row__link { padding: 14px; grid-template-columns: minmax(0, 1fr) 96px; border-radius: 16px; }
.chs-peek .chs-row__img { width: 96px; }

/* Botones flotantes (celular). */
.chs-fab {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 1040;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--chs-ink); color: #fff; font-size: 1.0625rem; font-weight: 500;
  box-shadow: var(--chs-float); /* taste-skill-ignore: botón flotante sobre la lista */
  transition: opacity .2s, transform .2s;
}
.chs-fab .chs-ico { width: 22px; height: 22px; }
.chs-fab.is-away { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.chs-fab--list { position: absolute; z-index: 600; }

/* ---------- Celular y tableta (< 960px) ---------- */
@media (max-width: 959.98px) {
  .chs-mapbox { display: none; }
  .chs.is-map .chs-mapbox { display: block; position: fixed; inset: 0; z-index: 1060; }
  .chs.is-map .chs-fab--map { display: none; }
  .chs-pop {
    position: fixed; inset: 0; z-index: 1070;
    animation: chs-up .28s cubic-bezier(.2, .8, .2, 1);
  }
  .chs-pop__x { position: fixed; }
  .chs-det__logo { width: 80px; height: 80px; margin: -40px 0 0 20px; }
  .chs-det__body { padding: 12px 20px 32px; }
  .chs-det__actions { margin: 20px -20px -32px; padding-left: 20px; padding-right: 20px; }
  .chs-det__title { font-size: 2rem; }
  .chs-det__actions .chs-btn { flex: 1 1 100%; }
  .chs-list-wrap { padding-bottom: 96px; }
}
@media (min-width: 600px) and (max-width: 959.98px) {
  .chs-panel__head, .chs-listbar, .chs-row__link, .chs-empty, .chs-credits { padding-left: 32px; padding-right: 32px; }
  .chs-row__link { grid-template-columns: minmax(0, 1fr) 168px; }
  .chs-row__img { width: 168px; }
}
@keyframes chs-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Escritorio (>= 960px) ---------- */
@media (min-width: 960px) {
  .chs-app {
    position: relative; display: grid; grid-template-columns: var(--chs-panel) minmax(0, 1fr);
    height: calc(100vh - var(--chs-top)); height: calc(100dvh - var(--chs-top)); min-height: 460px; max-height: 1100px;
    border-top: 1px solid var(--chs-line); border-bottom: 1px solid var(--chs-line); /* taste-skill-ignore: separa la app del encabezado y pie del sitio */
  }
  .chs-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--chs-line); } /* taste-skill-ignore: borde panel/mapa */
  .chs-panel__head { padding: 32px 24px 12px; flex: none; }
  .chs-panel h1 { font-size: 2.5rem; }
  .chs-list-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; border-top: 1px solid var(--chs-line); } /* taste-skill-ignore: corte entre encabezado fijo y lista con scroll */
  .chs-listbar { padding: 16px 24px 4px; }
  .chs-row__link { padding: 20px 24px; grid-template-columns: minmax(0, 1fr) 168px; gap: 20px; }
  .chs-row__img { width: 168px; }
  .chs-empty, .chs-credits { padding-left: 24px; padding-right: 24px; }
  .chs-fab { display: none; }
  .chs-pop {
    position: absolute; z-index: 700; top: 24px; bottom: 24px; left: calc(var(--chs-panel) + 24px);
    width: min(460px, calc(100% - var(--chs-panel) - 48px)); border-radius: 18px; box-shadow: var(--chs-float); /* taste-skill-ignore: ficha flotante (diálogo) */
    animation: chs-in .22s cubic-bezier(.2, .8, .2, 1);
  }
  .chs-pop__x { position: sticky; float: right; margin: 14px 14px -58px 0; top: 14px; right: auto; }
  .chs-only-sm { display: none !important; }
}
@keyframes chs-in { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .chs-pop, .chs-fab, .chs-pin, .chs-row__link { animation: none !important; transition: none !important; }
}
