/* ============================================================
   TABAS STORIES — CSS de producción (basado en la v6 aprobada)
   Ruta sugerida: rey-child/assets/tabas-stories.css
   ============================================================ */

:root {
  --tabas-accent: #16a34a;
  --tabas-border: #e2e2e2;        /* color del borde del botón en reposo — cámbialo aquí */
  --tabas-border-hover: #16a34a;  /* color más fuerte del borde al hacer hover — cámbialo aquí */
  --overlay-dim: rgba(0,0,0,0.75);
}

/* ---------- BOTÓN TRIGGER ---------- */
.tabas-stories-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: auto;
  max-width: 100%;
  margin-bottom: 16px; /* espacio antes de la descripción corta */
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--tabas-border, #e2e2e2); /* ← LÍNEA DEL COLOR DE BORDE — cambia el valor por defecto o la variable abajo */
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tabas-stories-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border-color: var(--tabas-border-hover, #16a34a); /* ← color más fuerte al pasar el mouse */
}

.tabas-stories-avatars { display: flex; flex-shrink: 0; }
/* Selector reforzado (mayor especificidad que el reset de imágenes del
   theme Rey, que suele traer "img { height:auto }") + !important como
   respaldo, para que el tamaño cuadrado SIEMPRE se aplique antes del
   recorte circular — si no, la imagen mantiene su proporción original
   y el círculo sale ovalado/deformado, como en la captura. */
.tabas-stories-trigger .tabas-stories-avatars img {
  width: 38px !important;
  height: 38px !important;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover !important;
  box-shadow: 0 0 0 2px var(--tabas-accent);
  margin-left: -10px;
  background: #fff;
  flex-shrink: 0;
}
.tabas-stories-avatars img:first-child { margin-left: 0; }

.tabas-stories-label {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}
.tabas-stories-label small {
  display: block;
  font-weight: 500;
  color: var(--tabas-accent);
  font-size: 12px;
  margin-top: 2px;
}

/* ---------- OVERLAY ---------- */
.tabas-stories-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-dim);
  z-index: 999999; /* muy por encima de admin bar (99999) y headers sticky */
  justify-content: center;
  align-items: center;
}
.tabas-stories-overlay.active { display: flex; }
body.tabas-stories-open { overflow: hidden; }

/* ---------- CAJA / FOTO — proporcional, nunca pantalla completa ---------- */
.tabas-stories-box {
  position: relative;
  width: 88vw;
  max-width: 380px;
  aspect-ratio: 9 / 16;
  max-height: 82vh;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: popupIn 0.35s ease;
}
@keyframes popupIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.tabas-stories-slides { position: relative; width: 100%; height: 100%; }
.tabas-stories-slide { position: absolute; inset: 0; display: none; }
.tabas-stories-slide.active { display: block; }
.tabas-stories-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- BARRAS DE PROGRESO ---------- */
.tabas-stories-progress {
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  display: flex; gap: 4px; z-index: 20;
}
.tabas-stories-progress .segment {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  overflow: hidden;
}
.tabas-stories-progress .segment .fill {
  display: block; /* FIX del bug raíz: sin esto, .fill (un <span>, inline por
                      defecto) ignora cualquier width que se le asigne */
  height: 100%;
  width: 0%;
  background: #fff;
}
.tabas-stories-progress .segment.completed .fill { width: 100%; }

/* ---------- CONTROLES (pausa / cerrar) — debajo de las barras ---------- */
.tabas-stories-controls {
  position: absolute;
  top: 22px;
  right: 10px;
  z-index: 25;
  display: flex;
  gap: 8px;
}
.tabas-circle-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- FLECHAS LATERALES ---------- */
.tabas-stories-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tabas-stories-arrow.prev { left: 8px; }
.tabas-stories-arrow.next { right: 8px; }
