/* Estructura común de las páginas públicas: encabezado, contenedor, barra inferior móvil y pie. */

.tm-shell { width: min(100% - 2 * var(--tm-margen-lateral), var(--tm-ancho-max)); margin-inline: auto; }
@media (max-width: 599px) { :root { --tm-margen-lateral: 12px; } }

/* Encabezado */
.tm-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 20, 38, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tm-borde-suave);
}
.tm-header__fila { display: flex; align-items: center; gap: var(--tm-esp-3); min-height: var(--tm-alto-header); }
.tm-marca { display: flex; align-items: center; gap: 10px; color: var(--tm-texto); flex-shrink: 0; }
.tm-marca:hover { color: var(--tm-texto); }
.tm-marca img { width: 36px; height: 36px; border-radius: 50%; }
.tm-marca span { font-family: var(--tm-fuente-marca); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.3px; }
.tm-marca b { color: var(--tm-ambar); font-weight: 700; }

.tm-header__busqueda { flex: 1 1 auto; max-width: 520px; display: none; }
.tm-header__acciones { display: flex; align-items: center; gap: var(--tm-esp-2); margin-left: auto; }
.tm-header__enlaces { display: none; gap: var(--tm-esp-1); }
.tm-header__enlaces a { color: var(--tm-texto-medio); font-size: var(--tm-texto-sm); font-weight: 500; padding: 8px 10px; border-radius: var(--tm-radio-sm); }
.tm-header__enlaces a:hover { color: var(--tm-texto); background: var(--tm-superficie); }

/* Selector de país */
.tm-pais { position: relative; }
.tm-pais summary {
  list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer;
  min-height: 40px; padding: 0 10px; border-radius: var(--tm-radio-md);
  background: var(--tm-superficie); border: 1px solid var(--tm-borde); font-size: var(--tm-texto-sm);
}
.tm-pais summary::-webkit-details-marker { display: none; }
.tm-pais summary img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }
.tm-pais__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px;
  padding: var(--tm-esp-2); margin: 0; list-style: none;
  background: var(--tm-superficie); border: 1px solid var(--tm-borde); border-radius: var(--tm-radio-md); box-shadow: var(--tm-sombra);
}
.tm-pais__menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--tm-radio-sm); color: var(--tm-texto); font-size: var(--tm-texto-sm); }
.tm-pais__menu a:hover { background: var(--tm-superficie-alta); }
.tm-pais__menu a[aria-current="true"] { background: var(--tm-ambar-tenue); color: var(--tm-ambar); font-weight: 600; }
.tm-pais__menu a span { flex: 1; }
.tm-pais__check { width: 16px; height: 16px; flex-shrink: 0; }
.tm-pais__menu img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }

/* Barra inferior (solo móvil) */
.tm-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tm-alto-dock) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  background: rgba(11, 20, 38, 0.97); border-top: 1px solid var(--tm-borde-suave);
}
.tm-dock a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--tm-texto-suave); font-size: 0.6875rem; min-height: var(--tm-toque-min); justify-content: center; }
.tm-dock a[aria-current="page"] { color: var(--tm-ambar); font-weight: 600; }
.tm-dock svg { width: 23px; height: 23px; }
.tm-dock .tm-dock__publicar {
  justify-self: center; width: 52px; height: 52px; margin-top: -12px; border-radius: 18px;
  background: var(--tm-ambar); color: var(--tm-sobre-ambar);
}
.tm-dock .tm-dock__publicar svg { width: 26px; height: 26px; }

/* Pie */
.tm-pie { border-top: 1px solid var(--tm-borde-suave); margin-top: var(--tm-esp-7); padding: var(--tm-esp-6) 0 calc(var(--tm-alto-dock) + var(--tm-esp-6)); color: var(--tm-texto-suave); font-size: var(--tm-texto-sm); }
.tm-pie__fila { display: flex; flex-wrap: wrap; gap: var(--tm-esp-5); justify-content: space-between; }
.tm-pie nav { display: flex; flex-wrap: wrap; gap: var(--tm-esp-2) var(--tm-esp-4); }
.tm-pie__lema { margin-top: var(--tm-esp-2); }
.tm-pie a { color: var(--tm-texto-medio); }
.tm-pie a:hover { color: var(--tm-ambar); }

@media (min-width: 900px) {
  .tm-header__busqueda { display: block; }
  .tm-header__enlaces { display: flex; }
  .tm-dock { display: none; }
  .tm-pie { padding-bottom: var(--tm-esp-6); }
}

/* Botones del inicio (Todo · Para ti · Cerca de mí · Filtros) dentro de la cabecera: solo en pantallas anchas.
   En celular y tablet siguen arriba del feed. */
.tm-header__chips { display: none; }
@media (min-width: 1200px) {
  .tm-header__chips { display: flex; gap: 6px; flex-shrink: 0; }
  .tm-header__chips .tm-chip { min-height: 38px; padding: 0 12px; font-size: var(--tm-texto-sm); }
  .tm-header__chips .tm-chip svg { width: 16px; height: 16px; }
  .tm-header__busqueda { flex: 1 1 200px; min-width: 160px; max-width: 420px; }
  .tm-header__enlaces a { padding: 8px 8px; }
  .tm-chips__principales { display: none; }
}
@media (min-width: 1200px) and (max-width: 1499px) {
  .tm-marca span { display: none; }
}
.tm-chips__principales { display: contents; }
@media (min-width: 1200px) { .tm-home__barra .tm-chips__principales { display: none; } }
