/* ==========================================================
   Bikat Guide by Guille Gareca
   Hoja de estilos - azul y blanco, modo claro/oscuro, RTL/LTR
   Movil primero; en PC la app se amplia hasta 1100px.
   Se usan propiedades logicas (inline/block) para que el
   diseno se invierta solo al cambiar entre hebreo e ingles.
   ========================================================== */

/* ---------- 1. Variables de color (modo claro) ---------- */
:root {
  --blue-main: #0038B8;
  --blue-dark: #00267F;
  --blue-light: #4A78D8;
  --white: #FFFFFF;

  --bg: #EAF1FF;
  --surface: #FFFFFF;
  --surface-soft: #EAF1FF;
  --border: #C9D8F7;
  --text: #12234D;
  --text-muted: #5A6B94;
  --title: #00267F;
  --accent: #0038B8;
  --on-accent: #FFFFFF;

  --header-from: #4A78D8;
  --header-mid: #0038B8;
  --header-to: #00267F;
  --footer-bg: #0038B8;

  --shadow-card: 0 8px 24px rgba(0, 56, 184, 0.16);
  --shadow-soft: 0 3px 10px rgba(0, 56, 184, 0.10);

  --whatsapp: #1FA855;
  --waze: #33CCFF;
  --waze-text: #052B4A;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --font-main: "Heebo", "Assistant", "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
}

/* ---------- 2. Variables de color (modo oscuro) ---------- */
[data-theme="dark"] {
  --bg: #0B1426;
  --surface: #14213D;
  --surface-soft: #0F1A31;
  --border: #263A66;
  --text: #E6ECFA;
  --text-muted: #9FB0D6;
  --title: #BFD2FF;
  --accent: #6C97F0;
  --on-accent: #08142E;

  --header-from: #1E3F96;
  --header-mid: #0F2766;
  --header-to: #08173F;
  --footer-bg: #08173F;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 3px 10px rgba(0, 0, 0, 0.35);

  --whatsapp: #25C26A;
}

/* ---------- 3. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, color 0.25s ease;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. Contenedor de la app (hasta 1100px) ---------- */
.app {
  width: 100%;
  max-width: 1100px;
  min-height: 100vh;
  margin-inline: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 56, 184, 0.12);
  transition: background 0.25s ease;
}

/* ---------- 5. Encabezado ---------- */
.app-header {
  position: relative;
  padding: 18px 20px 72px;
  padding-top: max(18px, env(safe-area-inset-top));
  color: var(--white);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(160deg, var(--header-from) 0%, var(--header-mid) 55%, var(--header-to) 100%);
  border-end-start-radius: 36px;
  border-end-end-radius: 36px;
}

/* Herramientas: tema + idioma */
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle:focus-visible,
.lang-btn:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

/* En modo claro se muestra la luna (para pasar a oscuro); en oscuro, el sol */
.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.lang-btn {
  min-width: 70px;
  min-height: 36px;
  padding: 4px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--white);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn[aria-pressed="true"] {
  background: var(--white);
  color: var(--blue-main);
  font-weight: 700;
}

/* Marca: logo pin + titulo */
.brand {
  padding-top: 4px;
}

.brand-logo {
  width: 92px;
  height: 92px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 6px 10px rgba(0, 15, 80, 0.45));
}

.brand-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.pin-shadow { fill: rgba(0, 10, 60, 0.35); }
.pin-body   { fill: var(--white); }
.pin-face   { fill: var(--blue-main); }
.pin-ring   { fill: none; stroke: var(--blue-light); stroke-width: 2; }
.pin-tick   { stroke: rgba(255, 255, 255, 0.85); stroke-width: 2; stroke-linecap: round; }
.pin-needle { transform-origin: 50px 38px; transform: rotate(45deg); animation: needle-swing 4.5s ease-in-out infinite; }
.pin-needle-n { fill: var(--white); }
.pin-needle-s { fill: #8FB0F5; }
.pin-dot    { fill: var(--blue-main); stroke: var(--white); stroke-width: 1.6; }

@keyframes needle-swing {
  0%, 100% { transform: rotate(38deg); }
  50%      { transform: rotate(52deg); }
}

.brand-title {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.3px;
}

.brand-author {
  margin: 2px 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.92;
}

.brand-tagline {
  margin: 10px auto 0;
  max-width: 44ch;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ---------- 6. Contenido principal ---------- */
.app-main {
  flex: 1;
  padding: 0 16px 24px;
}

/* Buscador (tarjeta que sobresale del encabezado) */
.search-card {
  max-width: 720px;
  margin: -34px auto 0;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 2;
  transition: background 0.25s ease;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  inset-inline-start: 16px;
  display: flex;
  color: var(--accent);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 54px;
  padding-block: 10px;
  padding-inline-start: 50px;
  padding-inline-end: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
  text-align: start;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

/* Titulos de seccion */
.section-title {
  margin: 26px 4px 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--title);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
}

/* ---------- 7. Categorias ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 112px;
  padding: 14px 10px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  border-radius: 50%;
  background: var(--surface-soft);
  transition: background 0.2s ease;
}

.category-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.category-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

.category-btn:active {
  transform: scale(0.97);
}

.category-btn:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}

.category-btn[aria-pressed="true"] {
  background: var(--blue-main);
  border-color: var(--blue-dark);
  color: var(--white);
}

[data-theme="dark"] .category-btn[aria-pressed="true"] {
  background: #2A55C4;
  border-color: #6C97F0;
}

.category-btn[aria-pressed="true"] .category-icon {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- 8. Resultados y fichas de negocio ---------- */
.results-box {
  padding: 22px 18px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
}

.results-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 1.05rem;
}

.business-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.business-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 6px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.business-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.business-cat {
  align-self: flex-start;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.business-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--title);
}

.business-location,
.business-hours,
.business-phone {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.93rem;
}

.business-location::before { content: "\1F4CD"; }
.business-hours::before    { content: "\1F552"; }
.business-phone::before    { content: "\260E\FE0F"; }

.business-phone bdi {
  direction: ltr;
  unicode-bidi: isolate;
}

.business-contact-note {
  align-self: flex-start;
  margin: 0;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--whatsapp);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
}

.business-desc {
  margin: 0;
  font-size: 0.95rem;
}

.business-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.business-sample {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.business-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.action-btn:hover {
  filter: brightness(1.08);
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}

.action-btn svg {
  flex: none;
}

.action-whatsapp {
  background: var(--whatsapp);
  color: #FFFFFF;
}

.action-waze {
  background: var(--waze);
  color: var(--waze-text);
}

/* ---------- 9. Pie de pagina ---------- */
.app-footer {
  padding: 18px 16px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.85rem;
  color: var(--white);
  background: var(--footer-bg);
}

.app-footer p {
  margin: 0;
}

.footer-credit {
  margin-top: 2px;
  opacity: 0.8;
}

/* ---------- 10. Tabletas (>= 600px) ---------- */
@media (min-width: 600px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .business-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- 11. Computadoras (>= 900px): ancho amplio ---------- */
@media (min-width: 900px) {
  body {
    padding-block: 20px;
  }

  .app {
    min-height: calc(100vh - 40px);
    border-radius: 32px;
    overflow: hidden;
  }

  .app-header {
    padding: 22px 48px 84px;
  }

  .brand-logo {
    width: 104px;
    height: 104px;
  }

  .brand-title {
    font-size: 2.6rem;
  }

  .app-main {
    padding: 0 40px 36px;
  }

  .search-card {
    margin-top: -40px;
  }

  .section-title {
    font-size: 1.3rem;
    margin-top: 34px;
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .category-btn {
    min-height: 128px;
  }

  .business-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* ---------- 12. Pantallas muy anchas (>= 1100px) ---------- */
@media (min-width: 1100px) {
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Respeta a quien prefiere menos animacion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

