@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Paleta "mar" — celeste turquesa + amarillo arena */
  --turquoise: #14b8c9;
  --turquoise-2: #0d9baa;
  --turquoise-dark: #096b78;
  --turquoise-deep: #054750;
  --turquoise-light: #8fe8ef;
  --turquoise-tint: #e6fbfc;
  --sand: #fffaf0;
  --sand-yellow: #ffbe3d;
  --sand-yellow-dark: #e89e12;
  --sand-yellow-tint: #fff3d9;
  --text: #0c3338;
  --text-soft: #5f7a7d;
  --white: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 20px rgba(9, 107, 120, 0.10);
  --shadow-lift: 0 10px 28px rgba(9, 107, 120, 0.16);
  --header-h: 60px;
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--sand);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { font-family: var(--font-display); }

/* ---------- Íconos lineales (SVG inline, stroke=currentColor) ---------- */
/* Tamaño por defecto; cada contexto (icon-circle, ph-icon, etc.) lo pisa */
svg { display: block; }
.icon svg, .btn-icon svg, .section-icon svg, .ph-icon svg, .inline-icon svg,
.back-btn svg, .drawer-close svg, .fab-home svg {
  width: 1em;
  height: 1em;
}

#app {
  min-height: 100vh;
  padding-top: var(--header-h);
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(120deg, var(--turquoise-dark), var(--turquoise-2) 60%, var(--turquoise));
  color: white;
  z-index: 50;
  box-shadow: 0 4px 18px rgba(5, 71, 80, 0.22);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  max-width: 1180px;
  margin: 0 auto;
}
.desktop-nav { display: none; }
.app-header .back-btn {
  background: rgba(255,255,255,0.16);
  border: none;
  color: white;
  font-size: 1.3rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.header-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}

/* ---------- Hamburger button ---------- */
.hamburger-btn {
  background: rgba(255,255,255,0.16);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Drawer (menú lateral derecha→izquierda) ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 32, 36, 0.55);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(80vw, 320px);
  background: var(--white);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.28, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(5, 32, 36, 0.2);
  padding-top: env(safe-area-inset-top);
}
.drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px;
  background: linear-gradient(135deg, var(--turquoise-dark), var(--turquoise));
  color: white;
}
.drawer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.drawer-close {
  background: rgba(255,255,255,0.18);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid rgba(12, 51, 56, 0.06);
  position: relative;
}
.drawer-item .icon {
  font-size: 1.25rem;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--turquoise-dark);
}
.drawer-item.active {
  color: var(--turquoise-dark);
  background: var(--turquoise-tint);
  font-weight: 700;
}
.drawer-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--sand-yellow);
}

/* ---------- Home hero (forma de ola) ---------- */
.home-hero {
  position: relative;
  background: linear-gradient(160deg, var(--turquoise-dark) 0%, var(--turquoise-2) 55%, var(--turquoise) 100%);
  color: white;
  padding: 26px 18px 56px;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
  border-radius: 50%;
}
.home-hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 34px;
  background: var(--sand);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'><path d='M0 20 Q 50 0 100 20 T 200 20 T 300 20 T 400 20 V40 H0 Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'><path d='M0 20 Q 50 0 100 20 T 200 20 T 300 20 T 400 20 V40 H0 Z'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.home-hero-content { position: relative; z-index: 1; }
.home-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.home-hero p {
  margin: 0 0 18px;
  opacity: 0.92;
  font-size: 0.92rem;
}
.search-bar {
  display: flex;
  background: white;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(5, 45, 51, 0.25);
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 13px 18px;
  font-size: 0.95rem;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
}
.search-bar button {
  background: var(--sand-yellow);
  border: none;
  color: var(--turquoise-deep);
  font-weight: 700;
  padding: 0 20px;
  cursor: pointer;
  font-family: var(--font-display);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 22px 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  color: var(--text);
}
.section-title .see-all {
  font-size: 0.78rem;
  color: var(--turquoise-dark);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.section-icon {
  font-size: 1.3rem;
  color: var(--turquoise-dark);
  flex-shrink: 0;
  display: inline-flex;
}
.inline-icon {
  display: inline-flex;
  color: currentColor;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
  margin-top: -32px;
  position: relative;
  z-index: 2;
}
.cat-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease;
}
.cat-card:active { transform: scale(0.96); }
.cat-card .icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--turquoise-tint), var(--sand-yellow-tint));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--turquoise-dark);
}
.cat-card .label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }

/* ---------- Cards ---------- */
.card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  width: 220px;
  scroll-snap-align: start;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:active { transform: scale(0.98); }
.card .img-wrap {
  position: relative;
  height: 130px;
  background: linear-gradient(135deg, var(--turquoise-tint), #ddd);
}
.card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card .tag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--sand-yellow);
  color: var(--turquoise-deep);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.card .body { padding: 12px 13px 14px; }
.card .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 5px;
  line-height: 1.25;
  color: var(--text);
}
.card .meta {
  font-size: 0.75rem;
  color: var(--turquoise-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}
.card .resumen {
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Full-width list card variant (category pages) */
.list-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 16px;
}
.card.card-wide { width: 100%; display: flex; flex-direction: row; height: 112px; }
.card.card-wide .img-wrap { width: 112px; height: 112px; flex-shrink: 0; }
.card.card-wide .body { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Filters ---------- */
.filters-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filters-bar::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: white;
  border: 1.5px solid var(--turquoise-tint);
  color: var(--turquoise-dark);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
}
.chip.active {
  background: linear-gradient(120deg, var(--turquoise-dark), var(--turquoise));
  border-color: transparent;
  color: white;
}

.search-inline {
  margin: 10px 16px 4px;
}
.search-inline input {
  width: 100%;
  border: 1.5px solid rgba(12, 51, 56, 0.08);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.9rem;
  background: white;
  font-family: var(--font-body);
}
.search-inline input:focus {
  outline: none;
  border-color: var(--turquoise);
}

/* ---------- Título de página (categoría/info/búsqueda) ---------- */
.page-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 16px 2px;
}
.page-heading .ph-icon { font-size: 1.35rem; line-height: 1; }
.page-heading h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* ---------- Botón flotante: volver al inicio ---------- */
.fab-home {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--sand-yellow), var(--sand-yellow-dark));
  color: var(--turquoise-deep);
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(232, 158, 18, 0.42);
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  transform: scale(0.75) translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.fab-home.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.fab-home:active { transform: scale(0.92); }

.empty-state {
  text-align: center;
  color: var(--text-soft);
  padding: 50px 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Detail page ---------- */
.detail-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}
.detail-body {
  padding: 20px 18px;
  background: white;
  border-radius: 22px 22px 0 0;
  margin-top: -18px;
  position: relative;
  z-index: 1;
}
.detail-body h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.badge {
  background: var(--turquoise-tint);
  color: var(--turquoise-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.fact {
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  border: 1px solid rgba(12, 51, 56, 0.05);
}
.fact .k { font-size: 0.66rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.fact .v { font-weight: 700; font-size: 0.9rem; margin-top: 3px; color: var(--text); }
.detail-desc {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 22px;
}
.cta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 0 4px;
}
.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1.1;
  cursor: pointer;
  font-family: var(--font-display);
  text-align: center;
  /* Esmerilado: fondo semitransparente + blur, tintado por botón */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid transparent;
}
.btn .btn-icon { font-size: 1.25rem; line-height: 1; }
.btn-location {
  background: rgba(20, 184, 201, 0.14);
  border-color: rgba(20, 184, 201, 0.35);
  color: var(--turquoise-dark);
  box-shadow: 0 4px 14px rgba(9, 107, 120, 0.1);
}
.btn-instagram {
  background: rgba(221, 42, 123, 0.12);
  border-color: rgba(221, 42, 123, 0.32);
  color: #c22a72;
  box-shadow: 0 4px 14px rgba(221, 42, 123, 0.1);
}
.btn-web {
  background: rgba(232, 158, 18, 0.16);
  border-color: rgba(232, 158, 18, 0.38);
  color: #9c6a0c;
  box-shadow: 0 4px 14px rgba(232, 158, 18, 0.12);
}
.btn-whatsapp {
  background: rgba(37, 211, 102, 0.14);
  border-color: rgba(37, 211, 102, 0.35);
  color: #1a9950;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.1);
}

/* ---------- Info page ---------- */
.info-section {
  margin: 0 16px 18px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.info-section h3 {
  font-size: 0.97rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--turquoise-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(12, 51, 56, 0.05);
  font-size: 0.85rem;
}
.info-item:last-child { border-bottom: none; }
.info-item .name { font-weight: 700; color: var(--text); }
.info-item .detalle { color: var(--text-soft); font-size: 0.8rem; }
.info-item .extra {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--turquoise-dark);
  font-size: 0.82rem;
  white-space: nowrap;
  background: var(--turquoise-tint);
  padding: 3px 9px;
  border-radius: 999px;
}
.info-note {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.install-banner {
  margin: 0 16px 4px;
  background: linear-gradient(120deg, var(--sand-yellow), #ffd066);
  color: var(--turquoise-deep);
  border-radius: 14px;
  padding: 11px 15px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.install-banner button {
  background: var(--turquoise-deep);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  font-weight: 700;
  font-size: 0.78rem;
}

.skeleton {
  background: linear-gradient(90deg, #eef7f8 25%, #f7fcfc 50%, #eef7f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ======================================================================
   Responsive real: a partir de tablet/desktop se reacomoda como sitio web
   (menú horizontal, grillas de varias columnas), no como un "teléfono"
   flotando en el medio de la pantalla.
   ====================================================================== */
@media (min-width: 900px) {
  :root { --header-h: 72px; }

  #app {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Header: nav horizontal, sin hamburguesa ni back-btn */
  .app-header .back-btn, .app-header .hamburger-btn { display: none; }
  .desktop-nav {
    display: flex;
    gap: 4px;
    align-items: center;
  }
  .desktop-nav a {
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 15px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .desktop-nav a:hover { background: rgba(255,255,255,0.14); color: white; }
  .desktop-nav a.active { background: rgba(255,255,255,0.24); color: white; }
  .header-title { flex: 0 0 auto; font-size: 1.15rem; }

  .drawer, .drawer-overlay { display: none !important; }

  /* Hero */
  .home-hero { padding: 60px 24px 110px; border-radius: 0 0 32px 32px; }
  .home-hero-content { max-width: 620px; margin: 0 auto; text-align: center; }
  .home-hero h1 { font-size: 2.5rem; }
  .home-hero p { font-size: 1.05rem; margin-bottom: 28px; }
  .search-bar { max-width: 520px; margin: 0 auto; }

  /* Categorías: grilla de 5 en vez de 2x3 */
  .cat-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    padding: 0;
    margin-top: -64px;
  }
  .cat-card { padding: 26px 14px; }
  .cat-card .icon-circle { width: 58px; height: 58px; font-size: 1.8rem; }
  .cat-card .label { font-size: 0.9rem; }

  /* Destacados: grilla real en vez de scroll horizontal */
  .section-title { margin: 40px 0 16px; font-size: 1.2rem; }
  .hscroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    overflow: visible;
    padding: 4px 0 8px;
  }
  .card { width: auto; }
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

  /* Listados de categoría: grilla de 2 columnas */
  .list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 4px 0 24px;
  }
  .card.card-wide { height: auto; min-height: 130px; }
  .card.card-wide .img-wrap { width: 150px; height: auto; }
  .filters-bar, .search-inline { padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }

  /* Fichas de detalle: contenido centrado, más legible */
  .detail-img { max-width: 820px; margin: 16px auto 0; border-radius: 22px; height: 380px; }
  .detail-body { max-width: 820px; margin: -50px auto 0; border-radius: 22px; box-shadow: var(--shadow-lift); padding: 32px 36px 24px; }
  .cta-grid { max-width: 460px; }

  /* Info útil: columna centrada, más legible que a lo ancho */
  .info-section { max-width: 640px; margin: 0 auto 18px; padding: 18px 22px; }

  .page-heading { margin: 20px 0 6px; }
  .page-heading h1 { font-size: 1.3rem; }

  /* El logo + menú horizontal ya cubren "volver al inicio" en desktop */
  .fab-home { display: none; }
}

@media (min-width: 1300px) {
  .list-grid { grid-template-columns: repeat(3, 1fr); }
}
