/* SugarSlay — layout.css
   Armazón: barra superior fija, menú lateral, barra inferior de celular.
   El teléfono manda: la barra inferior es la navegación real del sitio y el
   menú lateral solo aparece a partir de 900px. */

/* ── Barra superior (fija) ───────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: var(--bw) solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.navbar-in {
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding-inline: 12px;
  max-width: 1400px; margin-inline: auto;
}
.navbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; }
.brand-text {
  font-family: var(--font-display); font-size: 1.22rem; font-weight: 600;
  letter-spacing: .01em;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.brand-text.lg { font-size: 1.9rem; }

.nav-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 50%;
  background: none; color: var(--text); text-decoration: none;
}
.nav-icon:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }

/* La marca de "hay algo nuevo". Se usa igual en la campana y en la barra
   inferior, así que vive aquí una sola vez. */
.dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; font-style: normal; line-height: 1;
}

.lang-switch { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-2); }
.lang-opt {
  padding: 4px 9px; border-radius: var(--radius-pill);
  font-size: .72rem; font-weight: 700; color: var(--muted); text-decoration: none;
}
.lang-opt.is-active { background: var(--accent); color: var(--accent-ink); }
.lang-opt:hover { text-decoration: none; color: var(--text); }

/* Sol y luna: se muestra el que representa a dónde vas, no dónde estás. */
.theme-sun  { display: none; }
[data-theme="dark"] .theme-sun  { display: inline-flex; }
[data-theme="dark"] .theme-moon { display: none; }

.usermenu { position: relative; }
.usermenu-btn { display: flex; padding: 0; border: 0; background: none; border-radius: 50%; }
.usermenu-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  min-width: 232px; padding: 8px;
  background: var(--surface); border: var(--bw) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.usermenu-pop[hidden] { display: none; }
.usermenu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: grid; gap: 2px; }
.usermenu-head .muted { font-size: .8rem; }
.usermenu-pop a, .usermenu-out {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border: 0; background: none;
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .92rem; text-align: left; text-decoration: none;
}
.usermenu-pop a:hover, .usermenu-out:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.usermenu-out { color: var(--danger); }

/* Barra de "estás dentro de la cuenta de otra persona". Naranja y ancha a
   propósito: tiene que ser imposible no verla. */
.impersonating {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 7px 14px; background: var(--warning); color: #12100b;
  font-size: .82rem; font-weight: 600;
}
.impersonating .btn { color: #12100b; text-decoration: underline; }

/* ── Armazón ─────────────────────────────────────────────────────────────── */
.shell {
  display: flex;
  padding-top: calc(58px + env(safe-area-inset-top));
  min-height: 100dvh;
}
.main {
  flex: 1;
  min-width: 0;                    /* sin esto, una tabla ancha estira el flex y rompe el móvil */
  padding: 18px 16px calc(94px + env(safe-area-inset-bottom));
  max-width: 100%;
}
@media (min-width: 900px) {
  .main { padding: 26px 30px 40px; }
}

/* ── Menú lateral ────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
  width: 264px; padding: 18px 12px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border-right: var(--bw) solid var(--border);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .22s ease;
}
.sidebar.is-open { transform: translateX(0); }
.sidebar[data-style="glass"] { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); }
.sidebar[data-style="dark"]  { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }

.sidebar-veil { position: fixed; inset: 0; z-index: 75; background: rgba(0,0,0,.55); }
.sidebar-veil[hidden] { display: none; }
.sidebar-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px;
                 display: flex; align-items: center; justify-content: center;
                 border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 34px; }
.sidebar-section {
  padding: 16px 12px 6px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px; border-radius: var(--radius-sm);
  color: var(--text); font-size: .93rem; text-decoration: none;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.sidebar-link.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
[data-theme="dark"] .sidebar-link.is-active { color: var(--accent); }
.sidebar-link.is-active .sidebar-ic { color: var(--accent); }
.sidebar-ic { color: var(--muted); }
.sidebar-link .pill {
  margin-left: auto; padding: 1px 8px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: .68rem; font-weight: 700; font-style: normal;
}

@media (min-width: 900px) {
  .sidebar { top: calc(58px + env(safe-area-inset-top)); transform: none; }
  .sidebar-nav { margin-top: 4px; }
  .sidebar-veil { display: none !important; }
  .shell { padding-left: 264px; }
}

/* ── Barra inferior (celular) ────────────────────────────────────────────── */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: var(--bw) solid var(--border);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 10px; color: var(--muted); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.bn-item:hover { text-decoration: none; }
.bn-ic { position: relative; display: flex; }
.bn-label { font-size: .66rem; font-weight: 600; letter-spacing: .01em; }
.bn-item.is-active { color: var(--accent); }

/* ── Pantallas de entrar / registro ──────────────────────────────────────── */
.auth-shell {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 30px 16px calc(30px + env(safe-area-inset-bottom));
}
.auth-brand { display: block; text-decoration: none; }
.auth-brand img { height: 44px; }
.auth-card {
  width: 100%; max-width: 430px; padding: 26px 22px;
  background: var(--surface); border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--muted); }

/* El alta es larga: en pantalla grande se ensancha para que quepan las
   opciones tocables sin que la persona tenga que hacer scroll eterno. */
.auth-card-wide { max-width: 680px; }

/* ── Portada ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 84dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 60px 20px; text-align: center;
}
.hero h1 { font-size: clamp(2rem, 8vw, 3.4rem); margin-bottom: 0; }
.hero h1 em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { max-width: 520px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; width: min(100%, 320px); }
@media (min-width: 600px) { .hero-actions { flex-direction: row; justify-content: center; width: auto; } }

.feature { display: grid; gap: 8px; padding: 22px 18px; text-align: center; }
.feature .ic { color: var(--accent); margin: 0 auto; }
.feature h3 { margin: 0; font-size: 1rem; }
.feature p  { margin: 0; font-size: .88rem; color: var(--muted); }

/* ── Perfil ──────────────────────────────────────────────────────────────── */
.profile-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 9 / 12; }
@media (min-width: 700px) { .profile-hero { aspect-ratio: 16 / 10; } }
.profile-hero img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,.9), transparent); pointer-events: none;
}
.profile-hero-body { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; color: #fff; }
.profile-hero-body h1 { color: #fff; margin-bottom: 2px; text-shadow: 0 2px 6px rgba(0,0,0,.5); }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact { padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.fact dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.fact dd { margin: 0; font-size: .94rem; font-weight: 500; }

/* Tira de fotos: se desliza con el dedo y cada foto se ancla al centro. */
.photo-strip {
  display: flex; gap: 10px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-bottom: 4px; margin-inline: -16px; padding-inline: 16px;
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip img {
  flex: none; width: 62%; max-width: 260px; aspect-ratio: 9 / 16;
  object-fit: cover; border-radius: var(--radius); scroll-snap-align: center;
}

/* ── Mapa ────────────────────────────────────────────────────────────────── */
.map-box { width: 100%; height: 260px; border-radius: var(--radius); overflow: hidden; border: var(--bw) solid var(--border); background: var(--surface-2); }
.map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; color: var(--muted); font-size: .85rem; text-align: center; padding: 20px; }

/* ── Panel del admin ─────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 800px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--radius); }
.stat-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat-lbl { font-size: .78rem; color: var(--muted); }

.swatch { display: flex; align-items: center; gap: 10px; }
.swatch input[type="color"] { width: 46px; height: 46px; padding: 0; border: var(--bw) solid var(--border); border-radius: var(--radius-sm); background: none; }
