/* ============================================================
   COMPONENTS — Botones, marquee, footer, FAB, chatbot, animaciones
   ============================================================ */

/* ---------------- BOTONES ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.btn--primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}

.btn--primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid #333;
}

.btn--ghost:hover { border-color: var(--text); transform: translateY(-2px); }

/* ---------------- COMBAT BOARD ---------------- */
.combat {
  background: #000;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 44px 24px;
  overflow: hidden;
}

.combat__board {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
}

/* Columnas que entran deslizándose desde fuera hacia el centro */
.combat__col {
  opacity: 0;
  padding: 8px 40px;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}
.combat__col--left  { text-align: right; transform: translateX(-70px); }
.combat__col--right { text-align: left;  transform: translateX(70px); }

.combat__board.is-visible .combat__col { opacity: 1; transform: translateX(0); }

.combat__disc {
  font-family: var(--font-title);
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 14px;
}

.combat__list li {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 3px 0;
}

/* VS central: rojo sangre, grande, glow rojo sutil, sobre línea roja */
.combat__vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-left: 1px solid var(--red-dark);
  border-right: 1px solid var(--red-dark);
  align-self: stretch;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.25s;
}
.combat__board.is-visible .combat__vs { opacity: 1; }

.combat__vs-text {
  font-family: var(--font-title);
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  letter-spacing: 0.06em;
  color: var(--red);
  line-height: 0.9;
  text-shadow: 0 0 18px rgba(204,0,0,0.55);
}

.combat__star { color: var(--red); font-size: 0.85rem; opacity: 0.85; }

@media (max-width: 640px) {
  .combat__board {
    grid-template-columns: 1fr;
    gap: 22px;
    text-align: center;
  }
  .combat__col { padding: 0; }
  .combat__col--left, .combat__col--right { text-align: center; }
  .combat__col--left  { transform: translateX(-40px); }
  .combat__col--right { transform: translateX(40px); }
  .combat__vs {
    border-left: none; border-right: none;
    border-top: 1px solid var(--red-dark);
    border-bottom: 1px solid var(--red-dark);
    padding: 14px 0;
    flex-direction: row;
    gap: 14px;
  }
}

/* ---------------- FOOTER ---------------- */
.footer {
  background: #060606;
  border-top: 1px solid var(--line);
  padding: 60px 24px 28px;
}

.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.footer__brand { display: flex; flex-direction: column; gap: 8px; }
.footer__logo { height: 54px; width: auto; }
.footer__title { font-family: var(--font-title); font-size: 1.4rem; letter-spacing: 0.14em; }
.footer__tag { font-size: 0.8rem; letter-spacing: 0.1em; color: var(--gold); text-transform: uppercase; }

.footer__links { display: flex; flex-direction: column; gap: 12px; }
.footer__links a { font-size: 0.9rem; color: var(--muted); transition: color 0.25s var(--ease); }
.footer__links a:hover { color: var(--text); }

.footer__socials { display: flex; flex-direction: column; gap: 12px; }
.footer__socials a {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  transition: color 0.25s var(--ease);
}
.footer__socials a:hover { color: var(--red); }

.footer__bottom {
  max-width: var(--maxw);
  margin: 20px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer__bottom a { color: var(--muted); }
.footer__bottom a:hover { color: var(--red); }

/* ---------------- FAB (chat flotante) ----------------
   Botón cuadrado, rojo oscuro, con parpadeo del borde cada 3s. */
.fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 200;
  width: 58px; height: 58px;
  border-radius: 4px;
  background: #8b0000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  transition: transform 0.25s ease-out, background 0.25s ease-out;
  animation: fabBlink 3s ease-in-out infinite;
}

/* Parpadeo rápido del borde rojo cada 3 segundos */
@keyframes fabBlink {
  0%, 84%, 100% { border-color: transparent; }
  88%           { border-color: var(--red); }
  92%           { border-color: transparent; }
  96%           { border-color: var(--red); }
}

.fab:hover { transform: translateY(-2px); background: #a00000; }
.fab.is-hidden { transform: scale(0); pointer-events: none; }

/* ---------------- CHATBOT ---------------- */
.chat {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 201;
  width: min(370px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 40px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.chat.is-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0d0d0d;
  border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--line);
}

.chat__header-info { display: flex; align-items: center; gap: 12px; }
.chat__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; background: #000; padding: 4px; }
.chat__name { display: block; font-weight: 700; font-size: 0.95rem; }
.chat__status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.chat__status i { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }

.chat__close { font-size: 1.6rem; color: var(--muted); line-height: 1; padding: 0 4px; transition: color 0.2s; }
.chat__close:hover { color: var(--text); }

.chat__body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Burbujas */
.msg {
  max-width: 82%;
  padding: 11px 15px;
  font-size: 0.92rem;
  line-height: 1.5;
  border-radius: 4px;
  animation: msgIn 0.35s var(--ease);
}

.msg--bot { align-self: flex-start; background: #1e1e1e; color: var(--text); border-left: 2px solid #333; }
.msg--user { align-self: flex-end; background: var(--red); color: #fff; }

@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Opciones rápidas */
.chat__options { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }

.chat-opt {
  text-align: left;
  padding: 11px 15px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid #333;
  border-radius: 4px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.chat-opt:hover { border-color: var(--red); background: rgba(204,0,0,0.08); }

.chat-opt--wa { border-color: var(--red); color: #fff; background: var(--red); }
.chat-opt--wa:hover { background: var(--red-dark); border-color: var(--red-dark); }

/* Input de nombre */
.chat__input-row { display: flex; gap: 8px; margin-top: 4px; }
.chat__input {
  flex: 1;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 4px;
  outline: none;
}
.chat__input:focus { border-color: var(--red); }
.chat__send {
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  transition: background 0.2s var(--ease);
}
.chat__send:hover { background: var(--red-dark); }

.chat__footer { padding: 10px 16px; border-top: 1px solid var(--line); }
.chat__home {
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 6px;
  transition: color 0.2s var(--ease);
}
.chat__home:hover { color: var(--text); }

/* ---------------- ANIMACIONES SCROLL-REVEAL ----------------
   Cerberus: entrada directa desde la izquierda, rápida y recta. */
.reveal {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  will-change: opacity, transform;
}

.reveal.is-visible { opacity: 1; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__in { opacity: 1; transform: none; animation: none; }
  .combat__col, .combat__vs { opacity: 1; transform: none; transition: none; }
  .hero__logo, .fab { animation: none; }
  html { scroll-behavior: auto; }
}
