/* ==========================================================================
   PIWA 3D — página de cada negocio (lo que se abre al tocar el llavero)
   Liviana, pensada para el celular y para usar con el pulgar.
   --acento y --sobre-acento los define cada negocio desde el panel.
   ========================================================================== */
:root {
  --noche: #0D1B2A; --abismo: #091522; --pizarra: #14273B; --borde: #23405E;
  --cian: #00B4D8; --hielo: #CAF0F8; --niebla: #E0E1DD; --gris: #93A6BA; --wa: #25D366;
  --f-titulo: "Sora", system-ui, sans-serif; --f-texto: "Manrope", system-ui, sans-serif;
  --capas: repeating-linear-gradient(0deg, rgba(202, 240, 248, .05) 0 1px, transparent 1px 5px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--abismo); color: var(--niebla);
  font: 500 1rem/1.5 var(--f-texto); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2 { font-family: var(--f-titulo); color: #fff; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cian); outline-offset: 3px; border-radius: 6px; }
.ico { width: 22px; height: 22px; flex: none; }

.perfil {
  --acento: var(--cian); --sobre-acento: #0D1B2A;
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--noche);
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
@media (min-width: 520px) { body { padding: 24px 0; } .perfil { min-height: auto; border-radius: 28px; overflow: clip; border: 1px solid var(--borde); } }

/* ---------- Cabecera ---------- */
.perfil__cabecera { display: flex; flex-direction: column; align-items: center; text-align: center; }
.perfil__portada {
  align-self: stretch; margin: 0 -16px; height: 150px;
  background: var(--capas), linear-gradient(165deg, var(--acento) 0%, color-mix(in srgb, var(--acento) 35%, var(--noche)) 55%, var(--noche) 100%);
  background-size: cover; background-position: center;
}
.perfil__logo {
  width: 132px; height: 132px; margin-top: -72px; position: relative;
  display: grid; place-items: center;
  border-radius: 34px; background: var(--noche); padding: 10px;
  box-shadow: 0 0 0 5px var(--noche), 0 20px 40px -12px rgba(0, 0, 0, .6);
}
.perfil__logo img { width: 100%; height: 100%; object-fit: contain; }
.perfil__logo span { font: 700 3.4rem var(--f-titulo); color: var(--acento); }
.perfil__nombre { font-size: clamp(1.6rem, 7vw, 2rem); line-height: 1.1; margin-top: 16px; font-weight: 700; overflow-wrap: anywhere; }
.perfil__rubro { color: var(--gris); margin-top: 6px; }
.perfil__desc { color: var(--niebla); margin-top: 12px; max-width: 36ch; font-weight: 400; }

.estado {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: var(--pizarra); border: 1px solid var(--borde); color: var(--niebla);
  border-radius: 999px; padding: 7px 14px; font: 600 .88rem var(--f-texto); cursor: pointer;
}
.estado i { width: 8px; height: 8px; border-radius: 50%; background: #E76F51; }
.estado.is-abierto i { background: var(--wa); box-shadow: 0 0 0 4px rgba(37, 211, 102, .18); }
.estado .ico { width: 16px; height: 16px; color: var(--gris); }

/* Portada con foto: se muestra completa, con el alto que pida la imagen */
.perfil__portada--foto { height: auto; background: var(--abismo); }
.perfil__portada--foto img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: cover; }

/* ---------- Acciones rápidas ---------- */
.rapidos { display: flex; justify-content: center; gap: 8px; margin: 22px 0 6px; }
.rapidos a, .rapidos button {
  flex: 1; max-width: 96px; display: grid; justify-items: center; gap: 4px;
  padding: 12px 4px 10px; border-radius: 16px; border: 1px solid var(--borde);
  background: var(--pizarra); color: var(--niebla); text-decoration: none;
  font: 600 .76rem var(--f-texto); cursor: pointer; white-space: nowrap;
}
.rapidos .ico { color: var(--acento); width: 24px; height: 24px; }
.rapidos a:active, .rapidos button:active { transform: scale(.97); }

/* ---------- Botones ---------- */
.bloques { display: grid; gap: 10px; margin-top: 16px; }
.boton {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 18px;
  border-radius: 18px; background: var(--pizarra); border: 1px solid var(--borde);
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem;
  transition: border-color .15s, background-color .15s;
}
@media (hover: hover) { .boton:hover { border-color: var(--acento); } }
.boton:active { transform: scale(.985); }
.boton .ico { color: var(--acento); }
.boton span { flex: 1; }
.boton::after { content: ""; width: 8px; height: 8px; border-top: 2px solid var(--gris); border-right: 2px solid var(--gris); transform: rotate(45deg); opacity: .7; }
.boton--wa { background: var(--wa); border-color: var(--wa); color: #06210f; }
.boton--wa .ico { color: #06210f; }
.boton--wa::after { border-color: #06210f; }
.boton--wa:hover { border-color: #fff; }
.boton--grande { min-height: 68px; font-size: 1.12rem; justify-content: center; }
.boton--grande span { flex: none; }
.boton--grande::after { display: none; }
.boton--instagram .ico { color: #E1306C; }
.boton--facebook .ico { color: #4D8DFF; }
.boton--linea { background: transparent; min-height: 50px; justify-content: center; }
.boton--linea span, .boton--linea { flex: none; }
.boton--linea::after { display: none; }

.aviso {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 18px;
  background: color-mix(in srgb, var(--acento) 16%, var(--noche)); border: 1px solid color-mix(in srgb, var(--acento) 55%, transparent);
  color: #fff; font-weight: 500;
}
.aviso .ico { color: var(--acento); margin-top: 1px; }
.aviso strong { display: block; }

/* ---------- Galería (carta, promos) ---------- */
.galeria { margin-top: 8px; }
.galeria h2, .horarios h2 { font-size: 1.05rem; margin: 6px 2px 10px; font-weight: 600; }
.galeria__fila { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.galeria__fila a { flex: 0 0 78%; scroll-snap-align: start; border-radius: 16px; overflow: hidden; border: 1px solid var(--borde); background: var(--pizarra); }
.galeria__fila a:only-child { flex-basis: 100%; }
.galeria__fila img { width: 100%; height: auto; }

/* ---------- Ubicaciones ---------- */
.lugar { background: var(--pizarra); border: 1px solid var(--borde); border-radius: 18px; padding: 14px; display: grid; gap: 12px; }
.lugar__texto { display: flex; gap: 12px; align-items: flex-start; }
.lugar__texto .ico { color: var(--acento); margin-top: 2px; }
.lugar__texto strong { display: block; color: #fff; }
.lugar__texto span { color: var(--gris); font-size: .92rem; font-weight: 500; }
.lugar__mapa { height: 160px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--capas), var(--abismo); }
.lugar__mapa iframe { width: 100%; height: 100%; border: 0; }
.lugar__ver { background: var(--noche); color: var(--niebla); border: 1px solid var(--borde); border-radius: 999px; padding: 9px 18px; font: 600 .9rem var(--f-texto); cursor: pointer; }
.lugar .boton { min-height: 48px; border-radius: 12px; }

/* ---------- Horarios ---------- */
.horarios { margin-top: 18px; background: var(--pizarra); border: 1px solid var(--borde); border-radius: 18px; padding: 14px 16px; }
.horarios dl { margin: 0; display: grid; }
.horarios dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--borde); font-size: .95rem; }
.horarios dt { color: var(--gris); }
.horarios dd { margin: 0; text-align: right; }
.horarios .is-hoy dt, .horarios .is-hoy dd { color: #fff; font-weight: 700; }

/* ---------- Firma PIWA ---------- */
.firma { margin-top: auto; padding-top: 36px; }
.firma a { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gris); text-decoration: none; font-size: .85rem; padding: 12px; border-top: 1px solid var(--borde); }
.firma a:hover { color: var(--hielo); }
.firma strong { color: var(--hielo); }
.firma svg { width: 20px; height: 20px; color: var(--cian); flex: none; }

/* Dentro del ejemplo de la página de inicio */
.es-demo { background: var(--noche); padding: 0 !important; }
.es-demo .perfil { border: 0; border-radius: 0; }
.es-demo .perfil__portada:not(.perfil__portada--foto) { height: 110px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #fff; color: var(--noche); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: .92rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* ==========================================================================
   Navegación y ajustes para celular
   ========================================================================== */
html { scroll-behavior: smooth; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }

/* Barra superior: Inicio y Buscar (siempre a mano, también al bajar) */
.barra {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 -16px -64px; height: 64px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  transition: background-color .2s, box-shadow .2s;
}
.barra.is-solida {
  background: rgba(13, 27, 42, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--borde);
}
.barra__btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px 0 11px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(9, 21, 34, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; text-decoration: none; font: 700 .9rem var(--f-texto); cursor: pointer;
}
.barra__btn .ico { width: 20px; height: 20px; }
.barra__btn:active { transform: scale(.96); background: rgba(9, 21, 34, .8); }
.barra__titulo {
  flex: 1; min-width: 0; text-align: center; color: #fff; font: 700 .98rem var(--f-titulo);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s;
}
.barra.is-solida .barra__titulo { opacity: 1; transform: none; }
.barra.is-solida .barra__btn { background: var(--pizarra); border-color: var(--borde); }
.es-demo .barra, .es-demo .explorar, .es-demo .fijo { display: none; }

/* Más negocios para explorar */
.explorar { margin-top: 28px; }
.explorar__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.explorar__cab h2 { font-size: 1.05rem; font-weight: 600; }
.explorar__todos { background: none; border: 0; color: var(--cian); font: 700 .9rem var(--f-texto); padding: 10px 0 10px 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.explorar__todos:hover { color: #fff; }
/* Migas de pan (Inicio / Negocios / Rubro) */
.migas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 28px 2px 0; font-size: .82rem; color: var(--gris); }
.migas a { color: var(--gris); text-decoration: none; padding: 4px 0; }
.migas a:hover { color: var(--cian); }
.migas [aria-current] { color: var(--niebla); }
.explorar__fila {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 2px 16px 8px; scroll-padding: 0 16px; scrollbar-width: none;
}
.explorar__fila::-webkit-scrollbar { display: none; }
.explorar__item {
  flex: 0 0 132px; scroll-snap-align: start; display: grid; gap: 4px; align-content: start;
  padding: 10px; border-radius: 16px; background: var(--pizarra); border: 1px solid var(--borde);
  text-decoration: none; color: #fff;
}
.explorar__item:active { transform: scale(.97); }
.explorar__logo { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; padding: 10px; background: var(--capas), var(--abismo); margin-bottom: 4px; }
.explorar__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.explorar__logo b { font: 700 1.6rem var(--f-titulo); color: var(--cian); }
.explorar__nombre { font-weight: 700; font-size: .9rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.explorar__rubro { color: var(--gris); font-size: .78rem; }

/* WhatsApp fijo abajo: aparece cuando el botón principal sale de la pantalla */
.fijo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--noche) 55%, rgba(13, 27, 42, 0));
  transform: translateY(110%); transition: transform .25s ease;
  pointer-events: none;
}
.fijo.is-visible { transform: none; pointer-events: auto; }
.fijo__wa {
  display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 448px; margin: 0 auto;
  min-height: 56px; border-radius: 16px; background: var(--wa); color: #06210f; text-decoration: none;
  font: 700 1.05rem var(--f-texto); box-shadow: 0 12px 30px -8px rgba(37, 211, 102, .45);
}
.fijo__wa:active { transform: scale(.98); }
body.con-fijo .firma { padding-bottom: 76px; }

/* Visor de imágenes (carta, promos) a pantalla completa */
.visor { position: fixed; inset: 0; z-index: 70; background: #03080E; display: flex; flex-direction: column; touch-action: pan-y; }
.visor__barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; color: var(--niebla); font-weight: 600; font-size: .9rem; }
.visor__cerrar { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--borde); background: var(--pizarra); color: #fff; font: 700 .9rem var(--f-texto); cursor: pointer; }
.visor__marco { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px; overflow: auto; }
.visor__marco img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
.visor__nav { display: flex; justify-content: center; gap: 12px; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); }
.visor__nav button { min-width: 64px; min-height: 48px; border-radius: 14px; border: 1px solid var(--borde); background: var(--pizarra); color: #fff; font: 700 1.2rem var(--f-texto); cursor: pointer; }
.visor__nav button:disabled { opacity: .35; }
body.con-visor { overflow: hidden; }

/* Toques más cómodos */
.estado { min-height: 40px; }
.lugar__ver { min-height: 44px; padding: 0 20px; }
.rapidos a, .rapidos button { min-height: 66px; }
.rapidos a:active, .rapidos button:active, .boton:active, .estado:active, .lugar__ver:active { filter: brightness(1.15); }

/* Celulares chicos */
@media (max-width: 359px) {
  .perfil { padding-left: 12px; padding-right: 12px; }
  .barra { margin-left: -12px; margin-right: -12px; }
  .perfil__portada { margin-left: -12px; margin-right: -12px; }
  .explorar__fila { margin: 0 -12px; padding: 2px 12px 8px; scroll-padding: 0 12px; }
  .perfil__logo { width: 112px; height: 112px; margin-top: -60px; }
  .rapidos { gap: 6px; }
  .rapidos a, .rapidos button { font-size: .7rem; }
  .barra__btn span { display: none; }
  .barra__btn { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .fijo, .barra__titulo { transition: none; } }
