:root {
  /* Paleta CeliGO */
  --green:#4E6B4A;
  --green-dark:#3A5236;
  --green-mid:#5A7A56;
  --green-light:#E8F0E7;
  --green-pale:#F2F6F1;

  --gold:#E8A820;
  --gold-light:#FBF0D4;
  --gold-pale:#FFFBF0;
  --gold-dark:#C48E10;

  --cream:#F5F0E8;
  --cream-dark:#EDE6D8;

  --violet:#A78BFA;
  --violet-light:#EDE9FF;

  --red:#C0392B;
  --red-light:#FDECEA;

  --amber:#E8A820;
  --amber-light:#FBF0D4;

  /* Neutros */
  --text:#1C2419;
  --text-muted:#5A6B58;
  --text-hint:#9DAB9A;
  --bg:#c1cbb9;
  --surface:#FFFFFF;
  --border:rgba(0,0,0,0.07);
  --border-md:rgba(0,0,0,0.12);

  /* Radios */
  --r:20px;
  --r-sm:14px;
  --r-xs:10px;
  --r-pill:100px;

  /* Sombras */
  --shadow-sm:0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.12);
  --shadow-green:0 4px 20px rgba(78,107,74,0.25);
  --shadow-gold:0 4px 20px rgba(232,168,32,0.3);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body {
  font-family:'Plus Jakarta Sans', sans-serif;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  max-width:480px;
  margin:0 auto;
  padding-bottom:100px;
}

/* app-topbar oculto en mobile */
.app-topbar { display: none; }
/* desktop-layout es transparente en mobile */
.desktop-layout { display: contents; }
.app-column { display: contents; }
/*.app-pages { display: contents; }*/
.info-column { display: none; }

/* Ocultar topbar (header con logo y hojas) en mobile */
body > .topbar { display: none; }

.topbar {
  position:sticky;
  top:0;
  z-index:100;
  background-image: url('../img/bg-leaves.jpg');
  background-size:cover;
  background-position:center top;
  border-radius:0;
  overflow:hidden;
  box-shadow:0 4px 20px rgba(0,0,0,0.25);
}

/* Overlay oscuro sobre las hojas */
.topbar::before {
  content:'';
  position:absolute;
  inset:0;
  background:rgba(20,40,18,0.35);
  pointer-events:none;
}

.topbar-head {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px 20px 10px;
  padding-top: calc(22px + env(safe-area-inset-top) + 40px);
  min-height:64px;
}

.logo img {
  height:105px;
  width:auto;
  filter:drop-shadow(0 2px 10px rgba(0,0,0,0.4));
}

/* Wrapper tabs — sin fondo blanco, directo sobre las hojas */
.tabs-wrap {
  position:relative;
}

/* ── TABS ── */
.tabs {
  display:flex;
  background:transparent;
}

.tab {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:10px 2px 14px;
  cursor:pointer;
  border-bottom:2.5px solid transparent;
  transition:all 0.2s;
  color:rgba(255,255,255,0.6);
  font-size:8px;
  font-weight:700;
  letter-spacing:0.05em;
  position:relative;
}

.tab svg {
  width:20px; height:20px;
  stroke:currentColor; fill:none;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.tab.active {
  color:var(--gold);
  border-bottom-color:var(--gold);
}

.tab:hover:not(.active) {
  color:rgba(255,255,255,0.9);
}

/* ── PAGES ── */
.page { display:none; padding:20px; }
#page-home { padding: 0; }
#page-restaurantes { padding:0; }

#page-scanner,
#page-asistente,
#page-descubre {
  padding-top: calc(20px + env(safe-area-inset-top) + 40px);
}
#page-restaurantes .search-bar,
#page-restaurantes .filter-row,
#page-restaurantes #restList { padding-left:16px; padding-right:16px; }

#page-tiendas { padding:0; }
#page-tiendas .search-bar,
#page-tiendas .filter-row,
#page-tiendas #storeList { padding-left:16px; padding-right:16px; }
.page.active {
  display:block;
  animation: pageIn 0.28s ease forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-title {
  font-family:'Funnel Display', sans-serif;
  font-weight:700;
  font-size:28px;
  line-height:1.1;
  letter-spacing:-0.5px;
  margin-bottom:6px;
  color:var(--text);
}
.page-sub {
  font-size:14px;
  color:var(--text-muted);
  font-weight:300;
  margin-bottom:20px;
  line-height:1.5;
  padding: 0 16px;
}
#page-scanner .page-title{
  padding: 0 16px;
}

/* ── HERO BANNER ── */
.hero-banner {
  background:linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius:var(--r);
  padding:22px;
  margin-bottom:20px;
  color:white;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-green);
}
.hero-banner::before {
  content:'';
  position:absolute;
  top:-30px; right:-30px;
  width:140px; height:140px;
  background:rgba(255,255,255,0.06);
  border-radius:50%;
}
.hero-banner::after {
  content:'';
  position:absolute;
  bottom:-20px; left:20px;
  width:80px; height:80px;
  background:rgba(232,168,32,0.1);
  border-radius:50%;
}
.hero-banner h2 {
  font-family:'Funnel Display', sans-serif;
  font-weight:900;
  font-size:22px;
  line-height:1.2;
  margin-bottom:6px;
  color:var(--cream);
}
.hero-banner p { font-size:13px; opacity:0.8; font-weight:300; line-height:1.5; }
.stat-row { display:flex; gap:10px; margin-top:16px; }
.stat {
  background:rgba(255,255,255,0.12);
  border-radius:var(--r-xs);
  padding:10px 14px;
  flex:1;
  border:1px solid rgba(255,255,255,0.15);
}
.stat-num {
  font-family:'Funnel Display', sans-serif;
  font-weight:900;
  font-size:22px;
  color:var(--gold);
}
.stat-label { font-size:10px; opacity:0.75; margin-top:1px; font-weight:500; color:var(--cream); }

/* ── UPLOAD ZONE ── */
.upload-zone {
  background:var(--surface);
  border:2px dashed rgba(78,107,74,0.25);
  border-radius:var(--r);
  padding:28px 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition:all 0.2s;
  position:relative;
  overflow:hidden;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.upload-zone:hover { border-color:var(--green); background:var(--green-pale); }
.upload-zone input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.cam-icon {
  width:56px; height:56px;
  background:var(--green-light);
  border-radius:16px;
  display:flex; align-items:center; justify-content:center;
}
.cam-icon svg { width:24px; height:24px; stroke:var(--green); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.upload-zone h3 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:15px; }
.upload-zone p { font-size:12px; color:var(--text-muted); text-align:center; }
#previewImg { width:100%; max-height:200px; object-fit:cover; border-radius:var(--r-sm); display:none; }

.or-row { display:flex; align-items:center; gap:10px; color:var(--text-muted); font-size:12px; margin:2px 0 14px; }
.or-row::before,.or-row::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── INPUT CARD ── */
.input-card {
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:var(--r);
  padding:14px 16px;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.input-card label { font-size:11px; font-weight:700; color:var(--text-hint); letter-spacing:0.06em; display:block; margin-bottom:8px; }
.input-card textarea { width:100%; border:none; outline:none; resize:none; font-family:'Plus Jakarta Sans', sans-serif; font-size:14px; color:var(--text); background:transparent; line-height:1.6; min-height:80px; }
.input-card textarea::placeholder { color:var(--text-hint); }

/* ── CHIPS ── */
.chips { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px; }
.chip {
  background:var(--surface);
  border:1.5px solid var(--border-md);
  border-radius:var(--r-pill);
  padding:6px 14px;
  font-size:12px;
  color:var(--text-muted);
  cursor:pointer;
  transition:all 0.15s;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-weight:500;
  box-shadow:var(--shadow-sm);
}
.chip:hover { border-color:var(--green); color:var(--green); background:var(--green-pale); }

/* ── ALLERGY BANNER ── */
.allergy-active-banner {
  background:var(--gold-light);
  border:1.5px solid rgba(232,168,32,0.3);
  border-radius:var(--r-sm);
  padding:12px 14px;
  margin-bottom:14px;
  display:none;
}
.allergy-active-banner.show { display:flex; align-items:center; gap:10px; }
.allergy-active-banner svg { width:16px; height:16px; stroke:var(--gold-dark); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.allergy-active-banner p { font-size:12px; color:var(--gold-dark); font-weight:500; flex:1; line-height:1.4; }
.allergy-active-banner button { background:none; border:none; font-size:11px; color:var(--gold-dark); font-weight:700; cursor:pointer; text-decoration:underline; font-family:'Plus Jakarta Sans', sans-serif; }

/* ── BUTTONS ── */
.btn-primary {
  width:100%;
  background:var(--green);
  color:white;
  border:none;
  border-radius:var(--r-sm);
  padding:16px;
  font-family:'Funnel Display', sans-serif;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  letter-spacing:-0.2px;
  box-shadow:var(--shadow-green);
}
.btn-primary:hover { background:var(--green-dark); transform:translateY(-1px); }
.btn-primary:active { transform:translateY(0); }
.btn-primary:disabled { background:#9AB59A; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-primary svg { width:18px; height:18px; stroke:white; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.btn-ghost {
  width:100%;
  background:transparent;
  border:1.5px solid var(--border-md);
  border-radius:var(--r-sm);
  padding:12px;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-size:13px;
  font-weight:500;
  color:var(--text-muted);
  cursor:pointer;
  transition:all 0.15s;
}
.btn-ghost:hover { border-color:var(--green); color:var(--green); }

/* ── LOADING ── */
.loading-box {
  display:none;
  flex-direction:column;
  align-items:center;
  gap:12px;
  padding:32px 20px;
  background:var(--surface);
  border-radius:var(--r);
  margin-top:14px;
  box-shadow:var(--shadow-sm);
}
.loading-box.show { display:flex; }
.spinner {
  width:32px; height:32px;
  border:3px solid var(--green-light);
  border-top-color:var(--green);
  border-radius:50%;
  animation:spin 0.75s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }
.loading-box p { font-size:13px; color:var(--text-muted); text-align:center; line-height:1.5; }
.loading-box strong { font-family:'Funnel Display', sans-serif; font-size:15px; color:var(--text); display:block; margin-bottom:2px; }

/* ── RESULT CARD ── */
.result-card {
  display:none;
  flex-direction:column;
  gap:14px;
  background:var(--surface);
  border-radius:var(--r);
  padding:18px;
  margin-top:14px;
  border:1.5px solid var(--border);
  animation:up 0.3s ease;
  box-shadow:var(--shadow-md);
}
@keyframes up { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.result-card.show { display:flex; }

.verdict { display:flex; align-items:center; gap:14px; padding:14px; border-radius:var(--r-sm); }
.verdict.apto { background:var(--green-light); }
.verdict.no-apto { background:var(--red-light); }
.verdict.precaucion { background:var(--gold-light); }

.v-icon { width:44px; height:44px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:900; flex-shrink:0; }
.apto .v-icon { background:#C5DEC3; color:var(--green-dark); }
.no-apto .v-icon { background:#F5C0B8; color:var(--red); }
.precaucion .v-icon { background:#F5DFA0; color:var(--gold-dark); }

.v-label { font-family:'Funnel Display', sans-serif; font-weight:900; font-size:20px; }
.apto .v-label { color:var(--green-dark); }
.no-apto .v-label { color:var(--red); }
.precaucion .v-label { color:var(--gold-dark); }
.v-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }

.res-section { border-top:1px solid var(--border); padding-top:13px; }
.res-section h4 { font-size:10px; font-weight:700; color:var(--text-hint); letter-spacing:0.08em; margin-bottom:7px; }
.res-section p { font-size:13px; line-height:1.65; color:var(--text); }

.itag { display:inline-block; font-size:11px; font-weight:600; padding:3px 10px; border-radius:var(--r-pill); margin:2px 2px 2px 0; }
.itag.danger { background:var(--red-light); color:var(--red); }
.itag.ok { background:var(--green-light); color:var(--green-dark); }
.itag.warn { background:var(--gold-light); color:var(--gold-dark); }

/* ── SEARCH & FILTER ── */
.search-bar {
  display:flex; align-items:center; gap:10px;
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:var(--r-sm);
  padding:11px 14px;
  margin-bottom:16px;
  box-shadow:var(--shadow-sm);
    display:none;
}
.search-bar svg { width:16px; height:16px; stroke:var(--text-hint); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.search-bar input { border:none; outline:none; font-family:'Plus Jakarta Sans', sans-serif; font-size:14px; color:var(--text); background:transparent; flex:1; }
.search-bar input::placeholder { color:var(--text-hint); }

.filter-row { display:none; gap:7px; flex-wrap:wrap; margin-bottom:18px; }
.filter-btn {
  background:var(--surface);
  border:1.5px solid var(--border-md);
  border-radius:var(--r-pill);
  padding:6px 16px;
  font-size:12px;
  font-weight:600;
  color:var(--text-muted);
  cursor:pointer;
  transition:all 0.15s;
  box-shadow:var(--shadow-sm);
}
.filter-btn.active, .filter-btn:hover { background:var(--green); color:white; border-color:var(--green); box-shadow:var(--shadow-green); }

/* ── PLACE CARDS ── */
.place-card {
  background:var(--surface);
  border-radius:var(--r);
  /*border:1.5px solid var(--border);*/
  padding:16px;
  margin-bottom:12px;
  transition:all 0.2s;
  cursor:pointer;
  /*box-shadow:var(--shadow-sm);*/
}
.place-card:hover { border-color:rgba(78,107,74,0.3); transform:translateY(-2px); box-shadow:var(--shadow-md); }
.place-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.place-icon { width:44px; height:44px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.place-name { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:15px; line-height:1.2; margin-bottom:3px; }
.place-type { font-size:11px; color:var(--text-hint); font-weight:600; letter-spacing:0.04em; }
.stars { color:var(--gold); font-size:12px; }
.rating-num { font-size:12px; font-weight:600; color:var(--text-muted); margin-left:3px; }
.place-desc { font-size:13px; color:var(--text-muted); line-height:1.5; margin-bottom:10px; }
.place-tags { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:10px; }
.ptag { font-size:11px; font-weight:600; padding:3px 10px; border-radius:var(--r-pill); background:var(--green-light); color:var(--green-dark); }
.ptag.gray { background:var(--bg); color:var(--text-muted); }
.place-foot { display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--border); padding-top:10px; font-size:12px; color:var(--text-muted); }
.place-foot a { color:var(--green); font-weight:600; text-decoration:none; font-size:12px; }
.badge-cert { display:inline-flex; align-items:center; gap:4px; background:var(--gold); color:white; font-size:10px; font-weight:700; padding:3px 8px; border-radius:var(--r-pill); letter-spacing:0.03em; }
.empty-state { text-align:center; padding:40px 20px; color:var(--text-hint); }
.empty-state p { font-size:14px; margin-top:8px; }

/* ── INSTALL APP CARD ── */
.install-app-card { border-color: var(--primary-light, #d4f0e0); background: linear-gradient(135deg, #f0faf5 0%, var(--surface) 100%); }
.install-app-header { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.install-app-header h3 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:17px; margin-bottom:2px; }
.install-app-header p { font-size:13px; color:var(--text-muted); margin:0; }
.install-steps { display:flex; flex-direction:column; gap:10px; }
.install-step {
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:14px;
  line-height:1.45;
}
.install-step-num {
  flex-shrink:0;
  width:24px;
  height:24px;
  border-radius:50%;
  background:var(--primary);
  color:#fff;
  font-size:12px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top:1px;
}

/* ── ALLERGY PROFILE ── */
.profile-card {
  background:var(--surface);
  border-radius:var(--r);
  border:1.5px solid var(--border);
  padding:18px;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.profile-card h3 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:17px; margin-bottom:4px; }
.profile-card p { font-size:13px; color:var(--text-muted); line-height:1.5; margin-bottom:16px; }

.allergy-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:16px; }
.allergy-toggle {
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:var(--r-sm);
  padding:12px;
  cursor:pointer;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  gap:10px;
}
.allergy-toggle:hover { border-color:rgba(78,107,74,0.4); }
.allergy-toggle.selected { background:var(--green-light); border-color:var(--green); }
.allergy-toggle.selected .at-check { background:var(--green); border-color:var(--green); color:white; }
.at-emoji { font-size:20px; flex-shrink:0; }
.at-info { flex:1; min-width:0; }
.at-name { font-size:13px; font-weight:600; color:var(--text); line-height:1.2; }
.at-sub { font-size:10px; color:var(--text-muted); margin-top:1px; }
.at-check { width:18px; height:18px; border-radius:5px; border:1.5px solid var(--border-md); display:flex; align-items:center; justify-content:center; font-size:11px; flex-shrink:0; transition:all 0.15s; }

.custom-allergy-wrap { margin-top:4px; }
.custom-allergy-wrap label { font-size:11px; font-weight:700; color:var(--text-hint); letter-spacing:0.06em; display:block; margin-bottom:8px; }
.custom-input-row { display:flex; gap:8px; }
.custom-input-row input { flex:1; border:1.5px solid var(--border); border-radius:var(--r-xs); padding:10px 12px; font-family:'Plus Jakarta Sans', sans-serif; font-size:13px; color:var(--text); outline:none; background:var(--bg); }
.custom-input-row input:focus { border-color:var(--green); }
.btn-add { background:var(--green); color:white; border:none; border-radius:var(--r-xs); padding:10px 16px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; font-family:'Plus Jakarta Sans', sans-serif; }
.custom-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.custom-tag { display:inline-flex; align-items:center; gap:5px; background:var(--gold-light); color:var(--gold-dark); font-size:12px; font-weight:600; padding:4px 10px; border-radius:var(--r-pill); }
.custom-tag button { background:none; border:none; color:var(--gold-dark); cursor:pointer; font-size:14px; line-height:1; padding:0; }

/* ── AI CHAT ── */
.ai-chat-card {
  background:var(--surface);
  border-radius:var(--r);
  border:1.5px solid var(--border);
  overflow:hidden;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.ai-chat-header {
  background:linear-gradient(135deg, var(--green), var(--green-dark));
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid rgba(255,255,255,0.1);
}
.ai-chat-header svg { width:20px; height:20px; stroke:var(--cream); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.ai-chat-header h4 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:15px; color:var(--cream); }
.ai-chat-header p { font-size:11px; color:var(--cream); opacity:0.7; margin-top:1px; }
.chat-messages { padding:14px; display:flex; flex-direction:column; gap:10px; min-height:80px; max-height:300px; overflow-y:auto; }
.msg { max-width:85%; padding:10px 13px; border-radius:14px; font-size:13px; line-height:1.55; }
.msg.bot { background:var(--green-light); color:var(--green-dark); align-self:flex-start; border-bottom-left-radius:4px; }
.msg.user { background:var(--green); color:white; align-self:flex-end; border-bottom-right-radius:4px; }
.msg.loading-msg { background:var(--bg); color:var(--text-hint); align-self:flex-start; }
.chat-input-row { display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--border); }
.chat-input-row input { flex:1; border:1.5px solid var(--border); border-radius:var(--r-xs); padding:10px 12px; font-family:'Plus Jakarta Sans', sans-serif; font-size:13px; color:var(--text); outline:none; }
.chat-input-row input:focus { border-color:var(--green); }
.btn-send { background:var(--green); color:white; border:none; border-radius:var(--r-xs); padding:10px 16px; font-size:13px; font-weight:600; cursor:pointer; font-family:'Plus Jakarta Sans', sans-serif; white-space:nowrap; }
.btn-send:disabled { background:#9AB59A; cursor:not-allowed; }

/* ── BANNER ASISTENTE ── */
.asistente-banner-wrap { margin: 16px 0 4px; border-radius: var(--r-sm, 12px); overflow: hidden; height: 160px; }
.asistente-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--r-sm, 12px); }

/* ── CLÍNICAS ASISTENTE ── */
.asistente-clinicas-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 20px 0 10px;
}
.asistente-clinicas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.clinica-card {
  background: var(--surface, #1e2a1c);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--r-sm, 12px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.clinica-card-icon {
  font-size: 22px;
  margin-bottom: 2px;
}
.clinica-card-ciudad {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green, #7CBF6E);
  background: rgba(124,191,110,0.12);
  border-radius: 100px;
  padding: 2px 7px;
  display: inline-block;
  margin-bottom: 2px;
  width: fit-content;
}
.clinica-card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #e8f5e9);
  line-height: 1.3;
}
.clinica-card-dir {
  font-size: 10px;
  color: var(--text-muted, rgba(255,255,255,0.45));
  line-height: 1.4;
  margin-top: 2px;
  flex: 1;
}
.clinica-card-wsap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  background: rgba(37,211,102,0.12);
  border: 1px solid rgba(37,211,102,0.25);
  border-radius: 100px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #25d366;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.18s;
}
.clinica-card-wsap:hover { background: rgba(37,211,102,0.22); }
.clinica-card-wsap svg { flex-shrink: 0; }

.clinicas-otras-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-hint);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin: 8px 0 4px;
  opacity: 0.6;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 10px 8px;
  background: var(--green-dark);
  border-radius: 28px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.28),
    0 2px 8px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);
  pointer-events: all;
  gap: 0;
}

.nav-btn {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.45);
  padding: 6px 4px;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.nav-btn span {
  display: block;
  line-height: 1;
}

.nav-btn.active {
  color: var(--green-dark);
  background: var(--gold);
  padding: 8px 6px;
}

.nav-btn.active svg {
  stroke-width: 2.2;
}

.nav-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 14px);
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  display: none;
  z-index: 3;
}
.nav-dot.show { display: block; }

/* ── DESTACADO DEL MES ── */
.featured-card {
  background:var(--surface);
  border-radius:var(--r);
  border:1.5px solid rgba(78,107,74,0.2);
  overflow:hidden;
  margin-bottom:16px;
  box-shadow:var(--shadow-md);
  width:100%;
}
.featured-badge {
  background:linear-gradient(135deg, var(--green), var(--green-dark));
  color:var(--gold);
  font-size:11px;
  font-weight:700;
  padding:8px 16px;
  letter-spacing:0.05em;
  display:block;
  width:100%;
}
.featured-body {
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  width:100%;
  box-sizing:border-box;
}
.featured-info { display:flex; gap:12px; align-items:flex-start; width:100%; }
.featured-icon {
  width:44px; height:44px; min-width:44px;
  background:var(--green-light);
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; flex-shrink:0;
}
.featured-info > div:last-child { flex:1; min-width:0; overflow:hidden; }
.featured-name { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:16px; color:var(--text); margin-bottom:2px; }
.featured-type { font-size:10px; font-weight:700; color:var(--text-hint); letter-spacing:0.04em; margin-bottom:5px; }
.featured-desc { font-size:12px; color:var(--text-muted); line-height:1.5; margin-bottom:7px; word-break:break-word; }
.featured-tags { display:flex; flex-wrap:wrap; gap:5px; }
.featured-tag { font-size:11px; font-weight:600; padding:3px 9px; border-radius:var(--r-pill); background:var(--green-light); color:var(--green-dark); white-space:nowrap; }
.featured-tag.gold { background:var(--gold); color:white; }

.featured-map-wrap { border-radius:var(--r-sm); overflow:hidden; border:1px solid var(--border); width:100%; position:relative; }
.featured-map { width:100%; height:160px; border:none; display:block; }
.featured-map-link {
  display:block; text-align:center; padding:9px;
  font-size:12px; font-weight:600;
  color:var(--green); text-decoration:none;
  background:var(--green-pale);
  border-top:1px solid var(--border);
  transition:background 0.15s;
}
.featured-map-link:hover { background:var(--green-light); }
.featured-foot {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; border-top:1px solid var(--border);
  padding-top:11px; font-size:12px; color:var(--text-muted); flex-wrap:wrap;
}
.featured-foot span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.featured-foot a { color:var(--green); font-weight:600; text-decoration:none; white-space:nowrap; flex-shrink:0; }

/* ── PROFILE SUMMARY ── */
#profileSummaryCard {
  background:linear-gradient(135deg, var(--green-light), var(--gold-pale));
  border:1.5px solid rgba(78,107,74,0.2);
  border-radius:var(--r);
  padding:18px;
  margin-bottom:14px;
  display:none;
}
.ps-inner { display:flex; flex-direction:column; gap:10px; }
.ps-name { font-size:15px; color:var(--text); }
.ps-name strong { font-family:'Funnel Display', sans-serif; font-size:18px; }
.ps-tags { display:flex; flex-wrap:wrap; gap:6px; }
.ps-tag { font-size:11px; font-weight:600; padding:4px 11px; border-radius:var(--r-pill); }
.ps-tag.coral { background:var(--green-light); color:var(--green-dark); }
.ps-tag.amber { background:var(--gold-light); color:var(--gold-dark); }
.ps-tag.mint  { background:var(--green-light); color:var(--green-dark); }
.ps-tag.violet { background:var(--gold-light); color:var(--gold-dark); }
.ps-edit-btn {
  background:none; border:1.5px solid var(--border-md);
  border-radius:var(--r-xs); padding:8px 14px;
  font-size:12px; font-weight:600; color:var(--text-muted);
  cursor:pointer; font-family:'Plus Jakarta Sans', sans-serif;
  align-self:flex-start; transition:all 0.15s;
}
.ps-edit-btn:hover { border-color:var(--green); color:var(--green); }

/* ══ AVATAR TOPBAR ══ */
.topbar-avatar {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(232,168,32,0.18);
  border: 2px solid rgba(232,168,32,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.topbar-avatar:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,168,32,0.2);
}
.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
#topbarAvatarInitials {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: -0.5px;
  line-height: 1;
}

/* ══ SECCIÓN DESCUBRE ══ */
#page-descubre {
  padding: 20px 16px;
}
.descubre-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.descubre-card-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.descubre-hello {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}
.descubre-hello strong {
  font-family: 'Funnel Display', sans-serif;
  font-size: 20px;
  font-weight: 800;
}
.descubre-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.descubre-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 100px;
}
.descubre-tag.coral  { background: var(--coral-pale); color: var(--coral-dark); }
.descubre-tag.amber  { background: var(--amber-light); color: #B8860B; }
.descubre-tag.mint   { background: var(--mint-light); color: var(--mint-dark); }
.descubre-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.descubre-stat {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.descubre-stat-num {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--gold);
}
.descubre-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.descubre-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.descubre-feature-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.descubre-feature strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.descubre-feature span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ══════════════════════════════════════
   DESKTOP LAYOUT — min-width: 900px
   ══════════════════════════════════════ */
@media (min-width: 900px) {

  /* Fondo de hojas en toda la pantalla */
  html, body {
    height: 100%;
    overflow: hidden;
  }

  html {
    background-image: url('../img/bg-dark-leaves.jpg');
    background-size: cover;
    background-position: center;
  }

  body {
    max-width: 100%;
    background: transparent;
    padding-bottom: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  /* Ocultar bottom nav en desktop — lo reactivamos abajo en app-column */
  .bottom-nav { display: none !important; }

  /* El topbar global se oculta */
  .topbar { display: none; }

  /* Ocultar el topbar de hojas dentro de app-column en desktop */
  .app-column .app-topbar { display: none !important; }

  /* Mostrar bottom-nav dentro de app-column en desktop */
  .app-column .bottom-nav {
    display: flex !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    margin: 0 12px 12px !important;
    flex-shrink: 0;
  }
  .desktop-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
  }

  /* ── COLUMNA IZQUIERDA: app completa con su propio topbar ── */
  .app-column {
    width: 460px;
    min-width: 460px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    /* 3. Sombra que separa ambas secciones */
    box-shadow: 6px 0 40px rgba(0,0,0,1);
    position: relative;
    z-index: 10;
    overflow: hidden;
    /* 4. Pequeño margen izquierdo */
    margin-left: 140px;
    border-radius: 0 0 0 0;
    border-left: 1px solid #888c67;
    border-right: 1px solid #888c67;
  }

  /* Topbar propio dentro de la columna izquierda — siempre visible */
  .app-column .app-topbar {
    display: none !important;
    flex-shrink: 0;
  }

  /* El topbar dentro del app-column debe funcionar normal (no sticky) */
  .app-column .app-topbar .topbar {
    display: block !important;
    position: relative;
    max-width: 100%;
    border-radius: 0;
  }

  /* 2. Área scrollable de las páginas — overflow-y: auto para habilitar scroll */
  .app-column .app-pages {
    flex: 1;
    overflow-y: auto;
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: rgba(78,107,74,0.3) transparent;
    min-height: 0;
    position: relative;
  }
  .app-column .app-pages::-webkit-scrollbar { width: 4px; }
  .app-column .app-pages::-webkit-scrollbar-thumb { background: rgba(78,107,74,0.3); border-radius: 4px; }

  .app-column .page { padding: 16px; }
  .app-column #page-scanner,
  .app-column #page-asistente,
  .app-column #page-descubre { padding-top: 16px; }
  .app-column #page-restaurantes { padding: 0; }
  .app-column #page-restaurantes .search-bar,
  .app-column #page-restaurantes .filter-row,
  .app-column #page-restaurantes #restList { padding-left: 16px; padding-right: 16px; }

  .app-column #page-tiendas { padding: 0; }
  .app-column #page-tiendas .search-bar,
  .app-column #page-tiendas .filter-row,
  .app-column #page-tiendas #storeList { padding-left: 16px; padding-right: 16px; }

  /* ── COLUMNA DERECHA: info sin scroll ── */
  .info-column {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 170px;
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 0;
    overflow: hidden;
  }

  /* Cards que se distribuyen en el espacio disponible */
  .info-card {
    flex: 1;
    background: rgb(255 255 255 / 10%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    padding: 24px 28px;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  /* Espacio entre cards */
  .info-column > .info-card + .info-card { margin-top: 16px; }

  .info-card-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
  }

  .info-card h2 {
    font-family: 'Funnel Display', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 10px;
  }

  .info-card p {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255,255,255,0.72);
  }

  .info-card-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 12px 0;
  }

  .info-tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }

  .info-tip + .info-tip { margin-top: 10px; }

  .info-tip-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(232,168,32,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
  }

  .info-tip-text { font-size: 12px; color: rgba(255,255,255,0.78); line-height: 1.55; }
  .info-tip-text strong { color: #fff; display: block; margin-bottom: 1px; font-size: 12px; }

  .info-stat-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }

  .info-stat {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
  }

  .info-stat-num {
    font-family: 'Funnel Display', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
  }

  .info-stat-label {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    margin-top: 3px;
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .app-column { width: 400px; min-width: 400px; }
  .info-column { padding: 28px 32px; }
  .info-card h2 { font-size: 18px; }
  .info-card { padding: 18px 22px; }
}

/* ══ HERO RESTAURANTE DESTACADO ══ */
.rest-hero {
  position: relative;
  width: 100%;
  min-height: 680px;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 0;
  padding-bottom: 20px;
}

/* Curva blanca al pie del hero, sobre las cards */
.rest-hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 48px;
  background: var(--bg);
  border-radius: 36px 36px 0 0;
  z-index: 3;
  pointer-events: none;
}

.rest-hero-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.rest-hero-img img {
  width: 100%;
  height: 125%;
  top: -12.5%;
  position: absolute;
  object-fit: cover;
  object-position: center top;
  display: block;
  will-change: transform;
}

.rest-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(42,62,38,0.05) 0%,
    rgba(42,62,38,0.15) 30%,
    rgba(42,62,38,0.72) 60%,
    rgba(35,52,31,0.95) 100%
  );
}

.rest-hero-logo {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
}

.rest-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rest-hero-content {
  position: relative;
  z-index: 4;
  padding: 20px 20px 52px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rest-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.rest-badge-destacado {
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  display: inline-block;
}

.rest-hero-rating {
  text-align: right;
}

.rest-stars-gold {
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
}

.rest-rating-val {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-left: 4px;
}

.rest-rating-count {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

.rest-hero-name {
  font-family: 'Funnel Display', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.rest-hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  line-height: 1.6;
}

.rest-hero-horario {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 5px;
}

.rest-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.rest-hero-tag {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
}

/* ══ SCANNER PAGE ══ */
#page-scanner { padding: 0; }

.scanner-form-wrap {
  padding: 20px;
}

/* Desktop override */
@media (min-width: 900px) {
  .app-column #page-scanner { padding: 0; }
  .app-column .scanner-form-wrap { padding: 16px; }
}

/* ══ PERFIL HERO ══ */
#page-perfil { padding: 0; }

.profile-hero {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  background: var(--green-light);
}

.profile-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.profile-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.profile-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--green-light) 0%, var(--cream) 100%);
}

.profile-hero-placeholder svg {
  width: 80px;
  height: 80px;
  stroke: var(--green);
  opacity: 0.3;
}

/* Degradado de foto a blanco */
.profile-hero-fade {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 65%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(245,240,232,0.6) 40%,
    var(--bg) 80%,
    var(--bg) 100%
  );
  pointer-events: none;
}

/* Nombre y badge sobre el degradado */
.profile-hero-info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
}

.profile-hero-name {
  font-family: 'Funnel Display', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.profile-hero-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-hero-badge .ps-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
}

/* Botón cámara */
.profile-photo-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}

.profile-photo-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.profile-photo-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--green-dark);
}

/* Cuerpo del perfil */
.profile-body {
  padding: 0 20px 20px;
}

/* Desktop override */
@media (min-width: 900px) {
  .app-column #page-perfil { padding: 0; }
  .app-column .profile-body { padding: 0 16px 16px; }
  .profile-hero { height: 380px; }
}

/* ══ AVATAR FIJO (esquina sup. izquierda) ══ */
.profile-avatar-fixed {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top) + 40px);
  left: 14px;
  z-index: 300;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  background: var(--green-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  padding: 0;
}
.profile-avatar-fixed:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(232,168,32,0.4);
  border-color: #fff;
}
.profile-avatar-fixed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
#fixedAvatarInitials {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: -0.5px;
  line-height: 1;
}

/* Botón volver en página de perfil */
.perfil-back-btn {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top) + 40px);
  left: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: background 0.15s, transform 0.15s;
}
.perfil-back-btn:hover { background: #fff; transform: scale(1.05); }
.perfil-back-btn svg { width: 18px; height: 18px; stroke: var(--green-dark); }

/* ══ FEED SOCIAL (DESCUBRE) ══ */
#page-descubre { padding: 20px 16px; }

.feed-create-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}
.feed-create-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.feed-create-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--green-dark);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Funnel Display', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--gold);
}
.feed-create-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.feed-create-textarea {
  flex: 1;
  border: 1.5px solid var(--border-md);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
  min-height: 44px;
}
.feed-create-textarea:focus { border-color: var(--green); }
.feed-create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}
.feed-add-photo-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 100px;
  border: 1.5px solid var(--border-md);
  transition: all 0.15s;
  background: transparent;
}
.feed-add-photo-btn svg { width:16px; height:16px; stroke:var(--text-muted); }
.feed-add-photo-btn:hover { border-color: var(--green); color: var(--green); }
.feed-add-photo-btn:hover svg { stroke: var(--green); }
.feed-publish-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 20px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}
.feed-publish-btn:hover { background: var(--green-dark); }
.feed-publish-btn:active { transform: scale(0.97); }
.feed-publish-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.feed-img-preview-wrap {
  position: relative;
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
}
.feed-img-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}
.feed-img-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Post card individual */
.feed-post-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  animation: pageIn 0.25s ease forwards;
}
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.feed-post-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--green-dark);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Funnel Display', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: var(--gold);
  flex-shrink: 0;
}
.feed-post-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.feed-post-meta { flex: 1; min-width: 0; }
.feed-post-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-post-date {
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 1px;
}
.feed-post-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-word;
}
.feed-post-img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 280px;
  display: block;
  margin-bottom: 10px;
}
.feed-post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.feed-like-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 100px;
  transition: all 0.18s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.feed-like-btn svg {
  width: 17px;
  height: 17px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.18s, fill 0.18s;
}
.feed-like-btn:hover { color: #e05555; background: rgba(224,85,85,0.07); }
.feed-like-btn:hover svg { stroke: #e05555; }
.feed-like-btn.liked { color: #e05555; }
.feed-like-btn.liked svg { stroke: #e05555; fill: #e05555; }

.feed-share-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 100px;
  transition: all 0.18s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-left: auto;
}
.feed-share-btn svg {
  width: 17px;
  height: 17px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.18s;
}
.feed-share-btn:hover { color: var(--green); background: rgba(124,191,110,0.08); }
.feed-share-btn:hover svg { stroke: var(--green); }
.feed-share-btn.shared { color: var(--green); }
.feed-share-btn.shared svg { stroke: var(--green); }

.feed-loading, .feed-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.feed-loading .spinner {
  margin: 0 auto 12px;
}
.feed-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-hint);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.feed-delete-btn:hover { color: var(--red); background: var(--red-light); }

/* ══════════════════════════════════════════════════════
   GEOLOCALIZACIÓN — Banner de ubicación y badges
   ══════════════════════════════════════════════════════ */

/* ── Banner de ubicación ── */
.loc-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 12px;
  margin: 10px 0 4px;
  transition: all 0.3s ease;
}

.loc-banner.loc-pending {
  background: rgba(78, 107, 74, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(78, 107, 74, 0.15);
}

/* Punto pulsante para "detectando..." */
.loc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: locPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes locPulse {
  0%, 100% { opacity: 1; transform: scale(1);   }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

.loc-banner.loc-active {
  background: rgba(78, 107, 74, 0.10);
  color: var(--green-dark, #2E5E2A);
  border: 1px solid rgba(78, 107, 74, 0.22);
}
.loc-banner.loc-active strong {
  color: var(--green-dark, #2E5E2A);
}

.loc-banner.loc-denied {
  background: rgba(232, 168, 32, 0.08);
  color: #8B6914;
  border: 1px solid rgba(232, 168, 32, 0.20);
  flex-wrap: wrap;
  gap: 8px;
}

.loc-banner.loc-blocked {
  background: rgba(150, 150, 150, 0.08);
  color: #666;
  border: 1px solid rgba(150, 150, 150, 0.20);
  flex-wrap: wrap;
  line-height: 1.5;
}
.loc-banner.loc-blocked strong {
  color: #444;
}

/* ── Botón "Activar →" dentro del banner ── */
.loc-btn {
  margin-left: auto;
  background: rgba(232, 168, 32, 0.15);
  color: #8B6914;
  border: 1px solid rgba(232, 168, 32, 0.35);
  border-radius: 100px;
  padding: 5px 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.loc-btn:hover {
  background: rgba(232, 168, 32, 0.28);
}

/* ── Badge de distancia en tarjetas destacadas ── */
.fc-dist {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  padding: 3px 9px;
  letter-spacing: 0.02em;
}

/* ── Badge de distancia en tarjetas regulares ── */
.place-dist {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: rgba(78, 107, 74, 0.10);
  border: 1px solid rgba(78, 107, 74, 0.20);
  border-radius: 100px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════
   HOME PAGE — pantalla de bienvenida post-login
   ═══════════════════════════════════════════════ */

/* ── Hero superior ── */
.home-hero {
  position: relative;
  background: #111a10;
  overflow: hidden;
  padding: 0;
  text-align: center;
  width: 100%;
  margin: 0;
}

.home-hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  animation: videoFadeIn 1.5s ease forwards;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 60%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 60%, rgba(0,0,0,0) 100%);
}

@keyframes videoFadeIn {
  from { opacity: 0; }
  to { opacity: 0.3; }
}

.home-hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 260px;
  background: radial-gradient(ellipse at center, rgba(80,200,80,0.22) 0%, rgba(46,120,46,0.10) 50%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.home-hero-content {
  position: relative;
  z-index: 1;
  padding: 48px 24px 36px;
}

.home-logo {
  height: 78px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 12px rgba(100,200,80,0.3));
}

.home-greeting {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.home-headline {
  font-family: 'Funnel Display', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.home-tagline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  max-width: 300px;
  margin: 0 auto;
}

/* ── Texto de introducción ── */
.home-intro {
  background: #111a10;
  padding: 24px 24px 4px;
}

.home-intro-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,0.52);
  line-height: 1.75;
  border-left: 2px solid rgba(78,107,74,0.45);
  padding-left: 16px;
}

/* ── Strip de alergias activas ── */
.home-allergy-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(78,107,74,0.15);
  border: 1px solid rgba(78,107,74,0.30);
  border-radius: 0;
  padding: 10px 20px;
  color: rgba(200,230,200,0.85);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.home-allergy-strip svg {
  flex-shrink: 0;
  color: var(--gold);
}

.home-allergy-strip span {
  flex: 1;
}

.home-allergy-edit {
  background: transparent;
  border: 1px solid rgba(232,168,32,0.4);
  color: var(--gold);
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.home-allergy-edit:hover {
  background: rgba(232,168,32,0.12);
}

/* ── Grid principal 2×2 ── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px 16px 0;
  background: #111a10;
}

.home-grid-full {
  padding: 12px 16px 0;
  background: #111a10;
}

/* ── Tarjetas ── */
.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: #1a2419;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 20px 18px 18px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.home-card:active {
  transform: scale(0.97);
}

.home-card:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Glow interno de cada tarjeta */
.home-card-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.home-card:hover .home-card-glow { opacity: 0.75; }

.home-card--scanner .home-card-glow  { background: radial-gradient(circle, rgba(100,200,100,0.30) 0%, transparent 70%); }
.home-card--chat .home-card-glow     { background: radial-gradient(circle, rgba(167,139,250,0.30) 0%, transparent 70%); }
.home-card--restaurantes .home-card-glow { background: radial-gradient(circle, rgba(232,168,32,0.28) 0%, transparent 70%); }
.home-card--tiendas .home-card-glow  { background: radial-gradient(circle, rgba(100,180,240,0.28) 0%, transparent 70%); }
.home-card--descubre .home-card-glow { background: radial-gradient(circle, rgba(255,140,100,0.25) 0%, transparent 70%); }

/* Ícono circular */
.home-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-card-icon svg {
  width: 22px;
  height: 22px;
}

.home-card--scanner .home-card-icon  { background: rgba(100,200,100,0.15); color: #7ed98a; }
.home-card--chat .home-card-icon     { background: rgba(167,139,250,0.15); color: #b8a4fc; }
.home-card--restaurantes .home-card-icon { background: rgba(232,168,32,0.15); color: var(--gold); }
.home-card--tiendas .home-card-icon  { background: rgba(100,180,240,0.15); color: #88c8f5; }
.home-card--descubre .home-card-icon { background: rgba(255,140,100,0.15); color: #ffaa80; }

/* Texto de la tarjeta */
.home-card-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.home-card-title {
  font-family: 'Funnel Display', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.home-card-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
}

/* Flecha decorativa */
.home-card-arrow {
  font-size: 16px;
  color: rgba(255,255,255,0.2);
  align-self: flex-end;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
}

.home-card:hover .home-card-arrow {
  color: rgba(255,255,255,0.5);
  transform: translateX(3px);
}

/* Tarjeta DESCUBRE — fila completa */
.home-card--descubre {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.home-card--descubre .home-card-label { flex-direction: column; }
.home-card--descubre .home-card-arrow { align-self: center; margin-left: auto; }

/* ── Footer de marca ── */
.home-footer {
  background: #111a10;
  padding: 20px 16px 32px;
  text-align: center;
}

.home-footer-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.18);
  text-transform: uppercase;
}

/* ── Ajustes para que el page-home use fondo oscuro ── */
#page-home {
  background: #111a10;
  min-height: 100vh;
}

/* ── Bloqueo de orientación horizontal (fallback CSS para iOS/Safari) ── */
@media (orientation: landscape) and (max-height: 600px) {
  #rotate-overlay {
    display: flex !important;
  }
}

#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #1C2419;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
}

#rotate-overlay svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: #7CBF6E;
  stroke-width: 1.5;
  animation: rotate-hint 2s ease-in-out infinite;
}

@keyframes rotate-hint {
  0%   { transform: rotate(0deg);   }
  40%  { transform: rotate(-90deg); }
  60%  { transform: rotate(-90deg); }
  100% { transform: rotate(0deg);   }
}

#rotate-overlay p {
  color: #e8f5e9;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

#rotate-overlay span {
  color: #7CBF6E;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  text-align: center;
  opacity: 0.7;
}

/* ── BOTÓN ACTUALIZAR APP ── */
.update-app-container {
  padding: 20px;
  display: flex;
  justify-content: center;
}

.btn-update-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  padding: 12px 24px;
  border-radius: 100px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: auto;
}

.btn-update-app:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-update-app svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}