/* ═══════════════════════════════════════════════════════════════
   KAMOR SOUVENIRS · Catálogo
   Sistema visual mobile-first · editorial cálido + tinta profunda
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Tinta */
  --ink:        #0d1220;
  --ink-2:      #1b2337;
  --ink-3:      #2c3650;

  /* Texto */
  --tx:         #14192a;
  --tx-mut:     #6a7285;
  --tx-soft:    #98a0b1;

  /* Superficies (papel cálido) */
  --paper:      #f6f4f1;
  --paper-2:    #efece7;
  --surface:    #ffffff;

  /* Líneas */
  --line:       #e6e2dc;
  --line-2:     #f0edE8;

  /* Acento cálido (sol / mediterráneo) */
  --acc:        #ff5a36;
  --acc-2:      #ff8a3d;
  --acc-soft:   #fff0eb;
  --acc-line:   #ffd4c6;

  /* Stock */
  --stk:        #0f8f6b;
  --stk-soft:   #e6f6f0;
  --stk-line:   #b8e6d6;

  /* Sombras */
  --sh-xs:  0 1px 2px rgba(20, 25, 42, .05);
  --sh-sm:  0 2px 8px rgba(20, 25, 42, .06);
  --sh-md:  0 8px 24px -6px rgba(20, 25, 42, .12), 0 2px 6px rgba(20, 25, 42, .05);
  --sh-lg:  0 24px 48px -12px rgba(20, 25, 42, .22), 0 8px 16px -8px rgba(20, 25, 42, .12);
  --sh-ink: 0 10px 26px -8px rgba(13, 18, 32, .45);

  /* Radios */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --tr: .22s var(--ease);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --pad: 1rem;
  --toolbar-h: 0px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--paper);
  color: var(--tx);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--acc); color: #fff; }

:focus-visible {
  outline: 2.5px solid var(--acc);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════
   TOP BRAND BAR
   ══════════════════════════════════════════ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: .8rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__brand { display: flex; align-items: center; }

.topbar__logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.topbar__cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .58rem .95rem;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-xs);
  transition: var(--tr);
  white-space: nowrap;
}

.topbar__cta i { font-size: .78rem; }
.topbar__cta:active { transform: scale(.96); }

/* ══════════════════════════════════════════
   HERO · SELECTOR DE POBLACIÓN
   ══════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, #fff6f1 0%, rgba(255,246,241,0) 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  padding: 1.6rem var(--pad) 1.5rem;
}

.hero__glow {
  position: absolute;
  top: -140px; right: -90px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,61,.22) 0%, rgba(255,90,54,0) 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--acc);
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
  padding: .35rem .7rem;
  border-radius: var(--r-pill);
}

.hero__title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.7rem, 8vw, 2.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--ink);
  margin: .7rem 0 .35rem;
}

.hero__title em {
  font-style: normal;
  position: relative;
  background: linear-gradient(100deg, var(--acc) 0%, var(--acc-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__sub {
  font-size: .9rem;
  color: var(--tx-mut);
  max-width: 42ch;
}

/* Métricas */
.hero__stats {
  display: flex;
  gap: .45rem;
  margin: 1rem 0 1.15rem;
  flex-wrap: wrap;
}

.stat {
  flex: 1 1 0;
  min-width: 88px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .6rem .7rem;
  box-shadow: var(--sh-xs);
}

.stat__num {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.stat__lbl {
  display: block;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx-soft);
  margin-top: .15rem;
}

/* ── Tarjeta destacada (España) ───────────── */
.loc-featured { margin-bottom: .6rem; }

.loccard-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: .9rem;
  text-align: left;
  padding: 1.05rem 1.1rem;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  transition: var(--tr);
}

.loccard-hero::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #ff5a36, #ffb020);
}

.loccard-hero__emoji {
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 14px;
  background: var(--paper-2);
  transition: var(--tr);
}

.loccard-hero__tx { min-width: 0; flex: 1; }

.loccard-hero__name {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.15;
}

.loccard-hero__meta {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--tx-mut);
  margin-top: .1rem;
}

.loccard-hero__check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .7rem;
  background: var(--paper-2);
  color: var(--tx-soft);
  transition: var(--tr);
}

.loccard-hero.is-active {
  background: linear-gradient(135deg, var(--ink-2) 0%, var(--ink) 100%);
  border-color: var(--ink);
  box-shadow: var(--sh-ink);
}
.loccard-hero.is-active .loccard-hero__name { color: #fff; }
.loccard-hero.is-active .loccard-hero__meta { color: rgba(255,255,255,.62); }
.loccard-hero.is-active .loccard-hero__emoji { background: rgba(255,255,255,.14); }
.loccard-hero.is-active .loccard-hero__check { background: var(--acc); color: #fff; }
.loccard-hero:active { transform: scale(.985); }

/* ── Rejilla de poblaciones ───────────────── */
.loc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.loccard {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: .6rem;
  text-align: left;
  padding: .7rem .75rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  transition: var(--tr);
}

.loccard__emoji {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 10px;
  background: var(--tint, var(--paper-2));
  transition: var(--tr);
}

.loccard__tx { min-width: 0; }

.loccard__name {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loccard__count {
  display: block;
  font-size: .7rem;
  font-weight: 500;
  color: var(--tx-soft);
  margin-top: .05rem;
}

.loccard.is-active {
  background: linear-gradient(135deg, var(--ink-2) 0%, var(--ink) 100%);
  border-color: var(--ink);
  box-shadow: var(--sh-ink);
}
.loccard.is-active .loccard__name { color: #fff; }
.loccard.is-active .loccard__count { color: rgba(255,255,255,.6); }
.loccard.is-active .loccard__emoji { background: rgba(255,255,255,.16); }
.loccard:active { transform: scale(.97); }

/* Tarjeta "todas" con borde discontinuo cuando no está activa */
.loccard--all { border-style: dashed; border-color: #cfc9c0; background: transparent; }
.loccard--all.is-active { border-style: solid; }

/* Botón ver todas */
.loc-more {
  margin-top: .7rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 650;
  box-shadow: var(--sh-xs);
  transition: var(--tr);
}

.loc-more i { font-size: .8rem; }
.loc-more:active { transform: scale(.98); background: var(--paper-2); }

.loc-more__badge {
  background: var(--ink);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: var(--r-pill);
  min-width: 22px;
}

/* ══════════════════════════════════════════
   TOOLBAR STICKY
   ══════════════════════════════════════════ */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(246, 244, 241, .97);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.toolbar.is-stuck { box-shadow: 0 6px 18px -10px rgba(20,25,42,.28); }

.toolbar__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: .6rem var(--pad) .5rem;
}

/* ── Findbar (población + búsqueda + filtros) ── */
.findbar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: var(--tr);
}

.findbar:focus-within { border-color: var(--ink); box-shadow: var(--sh-md); }

.findbar__loc {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem .55rem .6rem .85rem;
  max-width: 44%;
  transition: background .15s;
}

.findbar__loc:active { background: var(--paper-2); }

.findbar__emoji { font-size: 1rem; line-height: 1; flex-shrink: 0; }

.findbar__value {
  font-family: 'Outfit', sans-serif;
  font-size: .87rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.findbar__chev { font-size: .6rem; color: var(--tx-soft); flex-shrink: 0; }

.findbar__sep {
  width: 1px;
  background: var(--line);
  margin: .5rem 0;
  flex-shrink: 0;
}

.findbar__search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: 0 .3rem 0 .7rem;
}

.findbar__search > i { font-size: .8rem; color: var(--tx-soft); flex-shrink: 0; }

.findbar__search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-size: .87rem;
  padding: .55rem 0;
}

.findbar__search input::placeholder { color: var(--tx-soft); }

.findbar__clear {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--tx-mut);
  font-size: .65rem;
}

.findbar__adv {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  color: var(--ink);
  font-size: .9rem;
  transition: var(--tr);
}

.findbar__adv:active { background: var(--paper-2); }
.findbar__adv.is-on { background: var(--ink); color: #fff; }

.findbar__dot {
  position: absolute;
  top: 10px; right: 11px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 2px var(--surface);
}
.findbar__adv.is-on .findbar__dot { box-shadow: 0 0 0 2px var(--ink); }

/* ── Panel avanzado ───────────────────────── */
.adv {
  display: none;
  grid-template-columns: 1fr;
  gap: .55rem;
  margin-top: .55rem;
  padding: .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  animation: advIn .24s var(--ease);
}

.adv.is-open { display: grid; }

@keyframes advIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.adv__field { display: flex; flex-direction: column; gap: .3rem; }

.adv__label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx-mut);
}

.adv__label i { font-size: .68rem; color: var(--tx-soft); }

.adv__select {
  appearance: none;
  width: 100%;
  padding: .65rem 2.1rem .65rem .8rem;
  background-color: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .87rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236a7285'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: .85rem;
  transition: var(--tr);
}

.adv__select:focus { border-color: var(--ink); background-color: var(--surface); }

/* ── Categorías ───────────────────────────── */
.cats-wrap { position: relative; margin-top: .5rem; }

.cats-wrap::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(246,244,241,0), rgba(246,244,241,.95));
}

.cats {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: .1rem 1.5rem .1rem 0;
  scroll-padding-left: 0;
}

.cats::-webkit-scrollbar { display: none; }

.cat {
  flex-shrink: 0;
  padding: .45rem .8rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--tx-mut);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--tr);
}

.cat:active { transform: scale(.95); }

.cat.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: var(--sh-sm);
}

/* ══════════════════════════════════════════
   RESULTADOS
   ══════════════════════════════════════════ */
.main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: .9rem var(--pad) 2.5rem;
}

.results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .7rem;
}

.results__count {
  font-size: .82rem;
  font-weight: 500;
  color: var(--tx-mut);
}

.results__count strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--ink);
}

.results__reset {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .76rem;
  font-weight: 600;
  color: var(--tx-mut);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: .4rem .7rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: var(--tr);
}

.results__reset i { font-size: .7rem; }
.results__reset:active { transform: scale(.95); background: var(--paper-2); }

/* Chips de filtros activos */
.chips-active {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .85rem;
}

.chips-active:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
  padding: .3rem .5rem .3rem .65rem;
  border-radius: var(--r-pill);
}

.chip button {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 90, 54, .16);
  color: var(--acc);
  font-size: .55rem;
}

/* ══════════════════════════════════════════
   AVISO DE EXISTENCIAS
   ══════════════════════════════════════════ */
.notice {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  background: linear-gradient(135deg, #fff8ec, #fff3e2);
  border: 1px solid #f6dcb4;
  border-radius: var(--r-md);
  padding: .7rem .8rem;
  margin-bottom: .9rem;
}

.notice > i {
  flex-shrink: 0;
  margin-top: .12rem;
  font-size: .85rem;
  color: #c97a12;
}

.notice p {
  font-size: .74rem;
  line-height: 1.5;
  color: #7a5a20;
}

.notice strong { font-weight: 700; color: #6b4a12; }
.notice b { font-weight: 700; color: #6b4a12; }

.notice--modal { margin-bottom: 0; }

/* ══════════════════════════════════════════
   REJILLA DE PRODUCTOS
   ══════════════════════════════════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .7rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-xs);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  animation: cardIn .35s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card:active { transform: scale(.975); }

/* Las fotos están normalizadas a un cuadrado de 320×320 con el
   producto centrado, así que el marco es cuadrado. */
.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line-2);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .35s var(--ease);
}

.card__loc {
  position: absolute;
  top: .4rem; left: .4rem;
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  padding: .16rem .4rem;
  border-radius: var(--r-pill);
  max-width: calc(100% - .8rem);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__body {
  padding: .6rem .65rem .65rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
}

.card__cat {
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--tx-soft);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__title {
  font-family: 'Outfit', sans-serif;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--tx);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  margin-top: auto;
  padding-top: .45rem;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
}

.card__stock {
  display: inline-flex;
  align-items: baseline;
  gap: .2rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .92rem;
  color: var(--stk);
  background: var(--stk-soft);
  border: 1px solid var(--stk-line);
  padding: .1rem .42rem;
  border-radius: var(--r-sm);
  letter-spacing: -.01em;
}

.card__stock small { font-size: .58rem; font-weight: 700; opacity: .75; }

.card__ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  color: var(--tx-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sin imagen */
.noimg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%; height: 100%;
  color: var(--tx-soft);
  font-size: .68rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  padding: .3rem;
}

.noimg i { font-size: 1.3rem; color: #d8d3ca; }

/* Cargar más */
.grid-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  margin: 1.4rem auto 0;
  max-width: 340px;
  padding: .85rem 1.4rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 650;
  box-shadow: var(--sh-xs);
  transition: var(--tr);
}

.grid-more:active { transform: scale(.98); background: var(--paper-2); }

.spinner {
  width: 14px; height: 14px;
  flex-shrink: 0;
  border: 2px solid var(--line);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Estado vacío */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}

.empty i {
  font-size: 2rem;
  color: #dcd6cc;
  margin-bottom: .8rem;
}

.empty h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .3rem;
}

.empty p {
  font-size: .85rem;
  color: var(--tx-mut);
  max-width: 34ch;
  margin: 0 auto 1.1rem;
}

.empty button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--ink);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: .65rem 1.15rem;
  border-radius: var(--r-pill);
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 2rem var(--pad) calc(2rem + var(--safe-b));
  text-align: center;
}

.footer__logo {
  height: 18px;
  width: auto;
  margin: 0 auto .8rem;
  opacity: .55;
}

.footer__note {
  font-size: .76rem;
  color: var(--tx-soft);
  max-width: 40ch;
  margin: 0 auto .6rem;
  line-height: 1.5;
}

.footer__link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--acc);
  padding-bottom: 1px;
}

/* ══════════════════════════════════════════
   FAB VOLVER ARRIBA
   ══════════════════════════════════════════ */
.fab-top {
  position: fixed;
  right: var(--pad);
  bottom: calc(1rem + var(--safe-b));
  z-index: 70;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: .85rem;
  box-shadow: var(--sh-md);
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: var(--tr);
}

.fab-top.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fab-top:active { transform: scale(.92); }

/* ══════════════════════════════════════════
   HOJA INFERIOR · POBLACIONES
   ══════════════════════════════════════════ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(13, 18, 32, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}

.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-lg);
  transform: translateY(100%);
  transition: transform .32s var(--ease);
  overflow: hidden;
}

.sheet-backdrop.is-open .sheet { transform: none; }

.sheet__grab {
  width: 40px; height: 4px;
  border-radius: 999px;
  background: #d5cfc6;
  margin: .55rem auto .2rem;
  flex-shrink: 0;
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 1.1rem .6rem;
  flex-shrink: 0;
}

.sheet__title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--ink);
}

.sheet__sub { font-size: .78rem; color: var(--tx-mut); margin-top: .05rem; }

.sheet__close {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--tx);
  font-size: .8rem;
}

.sheet__close:active { transform: scale(.92); }

.sheet__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 1.1rem .6rem;
  padding: 0 .85rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  flex-shrink: 0;
}

.sheet__search:focus-within { border-color: var(--ink); }
.sheet__search i { font-size: .8rem; color: var(--tx-soft); }

.sheet__search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  padding: .65rem 0;
  font-size: .88rem;
}

.sheet__list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 1.1rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.sheet__group {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx-soft);
  padding: .7rem .2rem .25rem;
}

.locrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  text-align: left;
  padding: .65rem .7rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: var(--tr);
}

.locrow__emoji {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 11px;
  background: var(--tint, var(--paper-2));
}

.locrow__tx { flex: 1; min-width: 0; }

.locrow__name {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: .93rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.locrow__count { display: block; font-size: .73rem; color: var(--tx-mut); }

.locrow__check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: .6rem;
  color: transparent;
  transition: var(--tr);
}

.locrow.is-active { border-color: var(--ink); background: #fff; box-shadow: var(--sh-sm); }
.locrow.is-active .locrow__check { background: var(--ink); border-color: var(--ink); color: #fff; }
.locrow:active { transform: scale(.985); }

.sheet__note {
  flex-shrink: 0;
  display: flex;
  gap: .45rem;
  font-size: .7rem;
  line-height: 1.45;
  color: var(--tx-soft);
  background: var(--paper-2);
  padding: .7rem 1.1rem calc(.7rem + var(--safe-b));
  border-top: 1px solid var(--line);
}

.sheet__note i { margin-top: .15rem; }

/* ══════════════════════════════════════════
   FICHA DE PRODUCTO (MODAL)
   ══════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(13, 18, 32, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}

.modal.is-open { opacity: 1; pointer-events: auto; }

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: 94vh;
  max-height: 94dvh;
  background: var(--paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh-lg);
  transform: translateY(100%);
  transition: transform .32s var(--ease);
}

.modal.is-open .modal__panel { transform: none; }

.modal__close {
  position: absolute;
  top: .7rem; right: .7rem;
  z-index: 5;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  color: var(--ink);
  font-size: .85rem;
}

.modal__close:active { transform: scale(.92); }

.modal__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal__media {
  position: relative;
  background: #fff;
  aspect-ratio: 1 / 1;
  max-height: 52vh;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.modal__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal__info {
  padding: 1.1rem var(--pad) 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.modal__cat {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--acc);
}

.modal__title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-top: -.5rem;
}

.modal__stock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: linear-gradient(135deg, var(--stk-soft), #f2fbf7);
  border: 1.5px solid var(--stk-line);
  border-radius: var(--r-md);
  padding: .8rem 1rem;
}

.modal__stock-label {
  font-size: .78rem;
  font-weight: 600;
  color: #0b6e52;
}

.modal__stock-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--stk);
  line-height: 1;
}

.modal__stock-value small { font-size: .7rem; font-weight: 700; opacity: .7; }

.modal__specs {
  display: grid;
  gap: .4rem;
}

.modal__spec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .65rem .8rem;
}

.modal__spec dt {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tx-soft);
}

.modal__spec dd {
  font-size: .86rem;
  font-weight: 600;
  color: var(--tx);
  text-align: right;
  word-break: break-word;
}

.modal__nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .7rem var(--pad) calc(.7rem + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.modal__navbtn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 650;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  padding: .55rem .85rem;
  border-radius: var(--r-pill);
  transition: var(--tr);
}

.modal__navbtn i { font-size: .7rem; }
.modal__navbtn:active { transform: scale(.95); }
.modal__navbtn:disabled { opacity: .35; pointer-events: none; }

.modal__counter {
  font-size: .74rem;
  font-weight: 600;
  color: var(--tx-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   BREAKPOINTS
   ══════════════════════════════════════════ */

/* ── Móvil grande / phablet ──────────────── */
@media (min-width: 480px) {
  :root { --pad: 1.25rem; }
  .loc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .85rem; }
  .findbar__search input { font-size: .9rem; }
}

/* ── Tablet ──────────────────────────────── */
@media (min-width: 768px) {
  :root { --pad: 1.75rem; }

  .topbar__inner { padding: 1rem var(--pad); }
  .topbar__logo { height: 28px; }
  .topbar__cta { font-size: .85rem; padding: .62rem 1.1rem; }

  .hero { padding: 2.6rem var(--pad) 2.2rem; }
  .hero__title { font-size: 2.5rem; }
  .hero__sub { font-size: 1rem; }
  .hero__stats { max-width: 480px; }

  .loc-featured { margin-bottom: .75rem; max-width: 520px; }
  .loccard-hero { padding: 1.3rem 1.4rem; }
  .loccard-hero__emoji { width: 54px; height: 54px; font-size: 1.7rem; }
  .loccard-hero__name { font-size: 1.35rem; }

  .loc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
  .loccard { padding: .85rem .9rem; }

  .loc-more { width: auto; padding: .8rem 1.4rem; }

  .adv { max-width: 340px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
  .card__body { padding: .8rem .85rem .85rem; }
  .card__title { font-size: .9rem; }

  .modal { align-items: center; padding: 1.5rem; }
  .modal__panel { max-width: 620px; border-radius: var(--r-xl); transform: translateY(24px) scale(.98); }
  .modal.is-open .modal__panel { transform: none; }
  .modal__info { padding: 1.5rem 1.8rem 1.8rem; }
  .modal__title { font-size: 1.5rem; }
  .modal__nav { padding: .8rem 1.8rem; }

  .sheet { border-radius: var(--r-xl); max-height: 82vh; margin-bottom: 2rem; }
  .sheet-backdrop { align-items: center; padding: 1.5rem; }
  .sheet__note { padding-bottom: .7rem; }

  .fab-top { width: 48px; height: 48px; right: 1.75rem; bottom: 1.75rem; }
}

/* ── Escritorio: hover states + selects inline ──────── */
@media (min-width: 900px) {
  .hero__stats { max-width: 540px; }

  .loc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  /* Panel de color/orden siempre visible */
  .adv { display: grid !important; max-width: 300px; }
  .findbar__adv { display: none; }
  .findbar__loc { max-width: 240px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
}

@media (hover: hover) and (pointer: fine) {
  .topbar__cta:hover { background: var(--ink-2); transform: translateY(-1px); box-shadow: var(--sh-md); }

  .loccard:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--sh-md); }
  .loccard.is-active:hover { border-color: var(--ink); }
  .loccard-hero:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--sh-md); }
  .loccard-hero.is-active:hover { box-shadow: var(--sh-ink); border-color: var(--ink); }

  .loc-more:hover { background: var(--ink); color: #fff; }
  .loc-more:hover .loc-more__badge { background: rgba(255,255,255,.2); }

  .grid-more:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
  .cat:hover { border-color: var(--ink-3); color: var(--ink); }
  .cat.is-active:hover { background: var(--ink-2); }

  .card:hover { transform: translateY(-3px); border-color: var(--ink-3); box-shadow: var(--sh-md); }
  .card:hover .card__media img { transform: scale(1.07); }

  .locrow:hover { border-color: var(--ink-3); }
  .modal__navbtn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
  .results__reset:hover { border-color: var(--ink-3); color: var(--ink); }
  .sheet__close:hover { background: #e4dfd7; }
  .fab-top:hover { background: var(--ink-2); transform: translateY(-2px); }
  .findbar__clear:hover { background: #e4dfd7; }
}

/* ── Accesibilidad: reducir movimiento ───── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
