/* Contratá Ya — PERMUTAS Y TRUEQUES YA! (2026-10-09)
   Overlay a pantalla completa, scroll vertical con snap (estilo TikTok).
   z-index 55: arriba de barra (40) y tabs (45), abajo de la hoja (60) y el brindis (70). */
:root { --trq-azul: #1A6BB5; --trq-naranja: #F0A63A; }

/* Acceso desde el Muro */
.muro-trueques-pill {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 0 0 12px; padding: 12px 16px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(100deg, #1A6BB5 0%, #2284D6 100%);
  color: #fff; font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: .01em;
  box-shadow: 0 10px 22px -14px rgba(26, 107, 181, .9);
}
.muro-trueques-pill .trq-ya { font-size: 13px; }
/* v286: acceso arriba de la fila de estados, con «Ingresar →» */
.trq-acceso-app { margin: 0 calc(var(--s4, 16px) * -1); padding: 10px 10px 0; background: var(--tinta, #fff); }
.trq-acceso-app .muro-trueques-pill {
  margin: 0; justify-content: space-between; gap: 6px; text-align: left;
  padding: 9px 8px 9px clamp(10px, 3.4vw, 16px);
  font-size: clamp(13px, 3.9vw, 16px); white-space: nowrap;
}
/* v288: todo en UNA línea desde 340 px («🔄 Permutas y trueques YA!» + «Ingresar →») */
.trq-pill-txt { flex: 0 1 auto; min-width: 0; line-height: 1.2; white-space: nowrap; }
.trq-acceso-app .muro-trueques-pill .trq-ya { font-size: .82em; margin-left: 2px; }
.trq-pill-ir {
  flex: 0 0 auto; padding: 6px clamp(8px, 2.6vw, 12px); border-radius: 999px;
  background: var(--trq-naranja, #F0A63A); color: #0B1620;
  font-family: var(--display); font-weight: 800; font-size: clamp(11.5px, 3.3vw, 13.5px); white-space: nowrap;
}
@media (min-width: 760px) {
  .trq-acceso-app { margin: 0 calc(var(--s6, 24px) * -1); padding: 10px 24px 0; }
}
.muro-trueques-pill:active { transform: scale(.98); }

body.trq-abierto { overflow: hidden; }
.trq {
  position: fixed; inset: 0; z-index: 55;
  background: #0B1620; color: #fff;
  font-family: var(--texto);
  overscroll-behavior: contain;
}
.trq[hidden] { display: none; }

.trq-ya {
  display: inline-block; background: var(--trq-naranja); color: #0B1620 !important;
  padding: .08em .38em .1em; border-radius: .28em;
  font-family: var(--display); font-weight: 800; letter-spacing: .02em; line-height: 1.15;
}

/* Header flotante */
.trq-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 26px;
  background: linear-gradient(rgba(11, 22, 32, .78), rgba(11, 22, 32, 0));
  pointer-events: none;
}
.trq-head > * { pointer-events: auto; }
.trq-fila { display: flex; align-items: center; gap: 10px; }
.trq-titulo {
  flex: 1; min-width: 0; margin: 0; text-align: center;
  font-family: var(--display); font-weight: 900; font-size: clamp(15px, 4.6vw, 20px);
  letter-spacing: .01em; line-height: 1.15; color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
.trq-redondo {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
  font-size: 19px; font-weight: 800; line-height: 1;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.trq-ayuda-btn {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; color: #fff; cursor: pointer;
}
.trq-como {
  font-size: 11.5px; font-weight: 700; line-height: 1.1; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5); opacity: .95;
}
@media (max-width: 380px) {
  .trq-como { max-width: 54px; white-space: normal; text-align: right; font-size: 10.5px; }
}
.trq-filtro {
  position: relative; display: table; margin: 8px auto 0;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25);
  font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.trq-filtro select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 16px;
}

/* Feed con snap */
.trq-feed {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.trq-feed::-webkit-scrollbar { display: none; }
.trq-item {
  position: relative; height: 100%; width: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #2a5d8f 0%, #0B1620 75%);
}
.trq-foto {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.trq-foto:not([src]), .trq-foto-rota { visibility: hidden; }
.trq-grad {
  position: absolute; left: 0; right: 0; bottom: 0; height: 68%;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .88));
  pointer-events: none;
}
.trq-info {
  position: absolute; left: 14px; right: 86px;
  bottom: calc(env(safe-area-inset-bottom) + 78px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}
.trq-linea { margin: 0 0 4px; font-size: 15px; line-height: 1.25; }
.trq-linea b {
  font-family: var(--display); font-weight: 800; font-size: 20px;
  word-break: break-word;
}
.trq-rot { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.trq-rot-of { color: var(--trq-naranja); }
.trq-rot-bu { color: #8CC8FF; }
.trq-badge {
  display: inline-block; margin: 6px 0 2px; padding: 4px 10px;
  border-radius: 999px; background: rgba(26, 107, 181, .9); color: #fff;
  font-size: 12.5px; font-weight: 700; text-shadow: none;
}
.trq-meta { margin: 6px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .92); }
.trq-det {
  margin: 6px 0 0; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .92);
  white-space: pre-wrap; word-break: break-word;
  max-height: 34vh; overflow-y: auto;
}
.trq-det-corto {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.trq-mas {
  margin-top: 2px; padding: 2px 0; background: none; border: 0;
  color: #fff; font-weight: 700; font-size: 13.5px; text-decoration: underline;
}

/* Acciones al costado */
.trq-acc {
  position: absolute; right: 8px;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.trq-acc-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; background: none; border: 0; color: #fff; padding: 0;
}
.trq-acc-ico {
  width: 50px; height: 50px; border-radius: 999px;
  display: grid; place-items: center; font-size: 22px; line-height: 1;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.trq-acc-int .trq-acc-ico { background: var(--trq-azul); border-color: #4D95D8; box-shadow: 0 8px 18px -8px rgba(26, 107, 181, .9); }
.trq-acc-btn.activo .trq-acc-ico { background: rgba(255, 255, 255, .28); }
.trq-acc-txt { font-size: 11.5px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); min-height: 14px; }
.trq-acc-btn:disabled { opacity: .6; }
.trq-acc-btn:active .trq-acc-ico { transform: scale(.92); }

/* Botón flotante */
.trq-fab {
  position: absolute; z-index: 4; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  padding: 13px 22px; border: 0; border-radius: 999px;
  background: var(--trq-naranja); color: #0B1620;
  font-family: var(--display); font-weight: 900; font-size: 16px; white-space: nowrap;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .7);
}
.trq-fab[hidden] { display: none; }
.trq-fab:active { transform: translateX(-50%) scale(.97); }

/* Hint primera vez */
.trq-hint {
  position: absolute; z-index: 4; left: 50%; top: 46%;
  transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(11, 22, 32, .72); color: #fff; font-weight: 700; font-size: 15px;
  pointer-events: none; animation: trq-sube 1.4s ease-in-out infinite;
}
.trq-hint[hidden] { display: none; }
@keyframes trq-sube { 0%, 100% { margin-top: 0; opacity: .95; } 50% { margin-top: -14px; opacity: .75; } }

/* Estados: cargando / vacío / error / preparando */
.trq-estado {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 90px 28px 110px; text-align: center;
  background: linear-gradient(170deg, #1A6BB5 0%, #0E4C8A 55%, #0B1620 100%);
}
.trq-estado h2 { margin: 0; font-family: var(--display); font-weight: 900; font-size: 22px; color: #fff; }
.trq-estado p { margin: 0; max-width: 340px; color: rgba(255, 255, 255, .9); font-size: 15px; }
.trq-estado-ico { font-size: 44px; }
.trq-rueda {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  animation: trq-gira .8s linear infinite;
}
@keyframes trq-gira { to { transform: rotate(360deg); } }
.trq-btn-naranja, .trq-btn-claro {
  margin-top: 8px; padding: 12px 22px; border: 0; border-radius: 999px;
  font-family: var(--display); font-weight: 900; font-size: 16px;
}
.trq-btn-naranja { background: var(--trq-naranja); color: #0B1620; }
.trq-btn-claro { background: #fff; color: #0E4C8A; }

/* Hoja: ayuda y formulario (sobre fondo claro de la hoja) */
.trq-pasos { margin: 8px 0 0 20px; padding: 0; color: var(--cal); font-size: 15px; line-height: 1.45; }
.trq-pasos li { margin: 0 0 8px; }
.trq-seguro {
  margin-top: 6px !important; padding: 10px 12px; border-radius: 12px;
  background: #FFF4E0; color: #5A3B00 !important; font-size: 14px !important;
}
.trq-cupo { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; color: #1A6BB5 !important; min-height: 1em; }
.trq-campo { display: block; margin: 0 0 12px; }
.trq-et { display: block; margin-bottom: 5px; font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--cal); }
.trq-et em { font-style: normal; font-weight: 600; color: var(--cal-3); font-size: 13px; }
.trq-input {
  display: block; width: 100%; font: inherit; font-size: 16px;
  padding: 11px 12px; border: 1px solid var(--linea); border-radius: 12px;
  background: #fff; color: var(--cal);
}
textarea.trq-input { resize: vertical; min-height: 76px; }
.trq-input:focus { outline: 2px solid #1A6BB5; outline-offset: 0; border-color: #1A6BB5; }
.trq-ayuda {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 4px; font-size: 12.5px; color: var(--cal-3); line-height: 1.3;
}
.trq-cont { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.trq-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.trq-fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.trq-fotos .btn { flex: 1 1 140px; }
.trq-prev { margin: 0 0 8px; }
.trq-prev img {
  display: block; width: 100%; max-height: 260px; object-fit: contain;
  border-radius: 12px; background: var(--tinta-3);
}
.trq-prev[hidden] { display: none; }
.trq-check {
  display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 0;
  padding: 10px 12px; border: 1px solid var(--linea); border-radius: 12px; background: #fff;
}
.trq-check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: #1A6BB5; }
.trq-check b { display: block; font-size: 14.5px; color: var(--cal); }
.trq-check .trq-ayuda { display: block; margin-top: 2px; }
.trq-pie { margin-top: 10px !important; font-size: 13px !important; color: var(--cal-3) !important; text-align: center; }

@media (min-width: 900px) {
  .trq-feed, .trq-head { max-width: 520px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); }
  .trq { background: #050b11; }
}

/* Lista de Matches: origen Trueque */
.match-trueque { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; color: #1A6BB5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Publicidad propia en el feed (mismo formato que un trueque) */
.trq-ad-marca {
  position: absolute; z-index: 2; left: 14px;
  top: calc(env(safe-area-inset-top) + 98px);
  padding: 3px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, .85); color: #0B1620;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.trq-info-ad { right: 14px; }
.trq-ad-tit { margin: 0 0 4px; font-family: var(--display); font-weight: 900; font-size: 24px; line-height: 1.15; word-break: break-word; }
.trq-ad-l2 { margin: 0 0 10px; font-size: 15px; line-height: 1.35; color: rgba(255, 255, 255, .94); }
.trq-ad-btn {
  display: inline-block; margin-top: 2px; padding: 12px 22px; border-radius: 999px;
  background: #1A6BB5; color: #fff; text-decoration: none; text-shadow: none;
  font-family: var(--display); font-weight: 800; font-size: 16px;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .7);
}
.trq-ad-btn:active { transform: scale(.97); }
