/* ============================================================
   TABAS SIDE CARD — CSS
   Patrón "botón flotante + card" (como el de WhatsApp):
   - La pestaña 🎁 es un cuadrado ámbar flotante que NO se mueve,
     a --tsc-edge (15 px) del borde de la pantalla.
   - La card se despliega DEBAJO de la pestaña, a la misma distancia
     del borde, y entra deslizándose desde ese lado.
   - Con la card abierta, la pestaña muestra una ✕ para cerrarla.
   z-index 99980: por debajo de la prueba social (99990) y del
   pop-up principal (99999).
   ============================================================ */

:root {
  --tsc-top-n: 30;        /* % de la altura de pantalla (se escribe desde Ajustes) */
  --tsc-w: 290px;
  --tsc-edge: 15px;       /* distancia al borde, igual que el botón de WhatsApp */
  --tsc-gap: 12px;        /* espacio entre la pestaña y la card */
  --tsc-tab-size: 44px;
}

.tsc-wrap {
  position: fixed;
  /* vh/svh fijos: no cambian cuando la barra del navegador móvil sube o baja,
     que era lo que hacía que el botón se viera "atascado" al hacer scroll */
  top: calc(var(--tsc-top-n) * 1vh);
  top: calc(var(--tsc-top-n) * 1svh);
  z-index: 99980;
  display: flex;
  flex-direction: column;
  gap: var(--tsc-gap);
  pointer-events: none; /* el contenedor no intercepta clics; sí sus hijos */
  font-family: Arial, Helvetica, sans-serif;
  will-change: transform;
  transform: translateZ(0);
}
.tsc-wrap > * { pointer-events: auto; }

.tsc-wrap.tsc-left  { left: var(--tsc-edge);  align-items: flex-start; }
.tsc-wrap.tsc-right { right: var(--tsc-edge); align-items: flex-end; }

/* ---------- Pestaña: cuadrado ámbar con emoji ---------- */
.tsc-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tsc-tab-size);
  height: var(--tsc-tab-size);
  padding: 0;
  border: none;
  border-radius: 10px;
  font-size: 28px;
  line-height: 1;
  color: #b45309;
  cursor: pointer;
  overflow: hidden;
  background:
    radial-gradient(at 50% 150%, #f59e0b26 0, #fde68a1a 50%, #0000 100%),
    linear-gradient(#fffbebf2, #fef3c7fa);
  /* borde ámbar interno + sombra suave tipo botón flotante de WhatsApp */
  box-shadow: inset 0 0 0 1px #f59e0b59, 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tsc-tab:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px #f59e0b59, 0 8px 18px rgba(0, 0, 0, 0.3);
}
.tsc-tab:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }

/* Con la card abierta, la pestaña muestra ✕ */
.tsc-tab.tsc-tab-x {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: bold;
}

/* ---------- Card (estilo Intelicom: zona de texto negra, borde blanco) ---------- */
.tsc-card {
  position: relative;
  width: var(--tsc-w);
  box-sizing: border-box;
  background: #000;
  color: #fff;
  border: 3px solid #fff;
  outline: 3px solid #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  /* cerrada: fuera de pantalla, invisible y sin recibir clics */
  opacity: 0;
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease,
              translate 0.15s ease, box-shadow 0.15s ease, visibility 0s linear 0.5s;
}
.tsc-left .tsc-card  { transform: translateX(calc(-1 * (var(--tsc-w) + var(--tsc-edge) + 10px))); }
.tsc-right .tsc-card { transform: translateX(calc(var(--tsc-w) + var(--tsc-edge) + 10px)); }

.tsc-open .tsc-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease,
              translate 0.15s ease, box-shadow 0.15s ease, visibility 0s;
}
.tsc-open .tsc-card:hover {
  translate: 0 -3px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.tsc-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  border-bottom: 3px solid #fff;
}

/* ---------- Zona de texto ---------- */
.tsc-body {
  position: relative;
  overflow: hidden;
  background: #000;
  padding: 14px 16px 18px;
}
.tsc-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0;
  pointer-events: none;
}
@keyframes tscSlide { 0% { left: -100%; } 100% { left: 100%; } }
.tsc-card:hover .tsc-body::before { opacity: 1; animation: tscSlide 2s infinite; }

.tsc-title,
.tsc-text,
.tsc-link { position: relative; z-index: 1; }

.tsc-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
  transition: transform 0.2s ease-out;
}
.tsc-card:hover .tsc-title { transform: skew(-5deg); }

.tsc-text {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #e6e6e6;
}

/* ---------- Enlace de texto ---------- */
.tsc-link {
  display: inline-block;
  color: #fff !important;
  font-size: 13.5px;
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  transition: color 0.15s ease;
}
.tsc-link:hover,
.tsc-link:focus-visible { color: #fde68a !important; }

/* ---------- Móvil y pantallas bajas ---------- */
@media (max-width: 480px) {
  :root { --tsc-w: min(78vw, 280px); }
  .tsc-img { max-height: 120px; }
  .tsc-body { padding: 12px 14px 16px; }
  .tsc-title { font-size: 15px; }
  .tsc-text { font-size: 13px; }
  .tsc-wrap.tsc-no-mobile { display: none; }
}
@media (max-height: 720px) {
  .tsc-img { max-height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .tsc-card { transition: none; }
  .tsc-card:hover .tsc-body::before { animation: none; }
}
