:root {
  --cc-black: #0d0d0d;
  --cc-black-soft: #1a1a1a;
  --cc-red: #c8102e;
  --cc-red-dark: #9c0c22;
  --cc-white: #f5f3ef;
  --cc-gray: #b3b3b3;
}

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--cc-black);
  color: var(--cc-white);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.font-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

a {
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
}

/* ===== Site header (topbar + navbar) ===== */
.site-header {
  z-index: 1030;
}

.navbar-cc {
  background-color: rgba(245,243,239,0.8);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(13,13,13,0.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  padding: 0.65rem 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar-cc .navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
}

.navbar-cc .navbar-brand .brand-logo {
  height: 60px;
  width: auto;
}

.navbar-cc .nav-link {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--cc-black);
  font-size: 0.85rem;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s ease;
}

.navbar-cc .nav-link:hover,
.navbar-cc .nav-link:focus,
.navbar-cc .nav-link.active {
  color: var(--cc-red);
}

.navbar-cc .dropdown-toggle::after {
  vertical-align: 0.15em;
}

.navbar-cc .dropdown-menu {
  border: none;
  border-top: 3px solid var(--cc-red);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.14);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

@media (min-width: 992px) {
  .navbar-cc .nav-item.dropdown .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    margin-top: 0;
    padding-top: 0.9rem;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .navbar-cc .nav-item.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.navbar-cc .dropdown-item {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--cc-black);
  padding: 0.6rem 1.25rem;
}

.navbar-cc .dropdown-item:hover,
.navbar-cc .dropdown-item:focus {
  background-color: rgba(200,16,46,0.08);
  color: var(--cc-red);
}

/* ===== Page hero (sub-pages) ===== */
.hero-page {
  position: relative;
  background: linear-gradient(180deg, var(--cc-black) 0%, var(--cc-black-soft) 60%, var(--cc-black) 100%);
  color: var(--cc-white);
  padding: 8rem 0 3rem;
  overflow: hidden;
  border-bottom: 4px solid var(--cc-red);
  text-align: center;
}

.hero-page::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image: repeating-linear-gradient(135deg, rgba(200,16,46,0.1) 0px, rgba(200,16,46,0.1) 2px, transparent 2px, transparent 40px);
  pointer-events: none;
  animation: heroLinesDrift 14s linear infinite;
}

@keyframes heroLinesDrift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(56px, 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-page::before {
    animation: none;
  }
}

.hero-page .subtitle {
  position: relative;
  font-family: 'Poppins', sans-serif;
  color: var(--cc-red);
  font-weight: 800;
  letter-spacing: 2px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-transform: uppercase;
  display: block;
}

@media (max-width: 767.98px) {
  .hero-page .subtitle {
    letter-spacing: 1px;
  }
}

.hero-page h1 {
  position: relative;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.15;
  margin: 0.5rem 0 0;
}

.hero-divider {
  position: relative;
  width: 80px;
  height: 4px;
  background-color: var(--cc-red);
  margin: 1.25rem auto 0;
}

.hero-lead {
  position: relative;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--cc-gray);
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}

/* ===== Chat ===== */
.chat-wrap {
  background: var(--cc-black);
  padding: 2rem 0 3rem;
}

.chat-section {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  height: 640px;
  background: var(--cc-black-soft);
  border: 1px solid rgba(245,243,239,0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
}

/* ── SIDEBAR ── */
.chat-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #131313;
  border-right: 1px solid rgba(245,243,239,0.08);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  gap: 18px;
  overflow-y: auto;
}

.sidebar-brand-title {
  font-family: 'Poppins', sans-serif;
  color: var(--cc-white);
  font-weight: 700;
  font-size: 15px;
  text-transform: none;
  letter-spacing: normal;
}

.sidebar-brand-sub {
  color: var(--cc-gray);
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 3px;
}

.sidebar-hr {
  height: 1px;
  background: rgba(245,243,239,0.1);
  border: none;
  margin: 0;
}

.sidebar-label {
  font-family: 'Poppins', sans-serif;
  color: var(--cc-red);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topic-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--cc-gray);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Lato', sans-serif;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  text-align: left;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.topic-btn:hover {
  background: rgba(200,16,46,0.12);
  border-color: var(--cc-red);
  color: var(--cc-white);
  transform: translateX(2px);
}

.topic-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
  color: var(--cc-red);
  font-size: 1rem;
}

.sidebar-footer-text {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(245,243,239,0.1);
  color: var(--cc-gray);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ── PANEL PRINCIPAL ── */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--cc-black-soft);
}

/* ── CHAT HEADER ── */
.chat-header {
  background: #131313;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(245,243,239,0.08);
}

.bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cc-red), var(--cc-red-dark));
  color: var(--cc-white);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.bot-name {
  font-family: 'Poppins', sans-serif;
  color: var(--cc-white);
  font-weight: 600;
  font-size: 15px;
  text-transform: none;
  letter-spacing: normal;
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  color: var(--cc-gray);
  font-size: 11px;
  font-weight: 500;
}

.header-actions { margin-left: auto; }

.btn-clear-chat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px 7px 10px;
  border-radius: 50px;
  border: 1.5px solid rgba(245,243,239,0.15);
  background: transparent;
  color: var(--cc-gray);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}

.btn-clear-chat:hover {
  background: var(--cc-red);
  color: var(--cc-white);
  border-color: var(--cc-red);
}

/* ── MENSAJES ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: var(--cc-black-soft);
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--cc-red-dark); border-radius: 4px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: var(--cc-red); }

.date-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}
.date-sep::before, .date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(245,243,239,0.1);
}
.date-sep span {
  font-size: 11px;
  color: var(--cc-gray);
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── BURBUJAS ── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  animation: msgIn 0.25s ease forwards;
  opacity: 0;
  max-width: 100%;
}

.msg-row.bot  { justify-content: flex-start; --sx: -14px; align-self: flex-start; }
.msg-row.user { justify-content: flex-end;   --sx: 14px;  align-self: flex-end;  }

@keyframes msgIn {
  from { opacity: 0; transform: translateX(var(--sx, 0)); }
  to   { opacity: 1; transform: translateX(0); }
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cc-red);
  color: var(--cc-white);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 11px;
}

.msg-content { display: flex; flex-direction: column; max-width: 520px; }
.msg-row.user .msg-content { align-items: flex-end; }

.bubble {
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-line;
}

.msg-row.bot .bubble {
  background: #212121;
  color: var(--cc-white);
  border-radius: 18px 18px 18px 5px;
  border: 1px solid rgba(245,243,239,0.08);
}

.msg-row.user .bubble {
  background: linear-gradient(135deg, var(--cc-red) 0%, var(--cc-red-dark) 100%);
  color: var(--cc-white);
  border-radius: 18px 18px 5px 18px;
  box-shadow: 0 4px 14px rgba(200,16,46,0.3);
}

.msg-time {
  font-size: 10px;
  color: var(--cc-gray);
  margin-top: 4px;
  padding: 0 4px;
}

/* ── TYPING ── */
.typing-row { display: none; }
.typing-row.visible { display: flex; }

.typing-bubble {
  background: #212121;
  border-radius: 18px 18px 18px 5px;
  padding: 13px 17px;
  display: flex;
  gap: 5px;
  align-items: center;
  border: 1px solid rgba(245,243,239,0.08);
}

.tdot {
  width: 7px;
  height: 7px;
  background: var(--cc-red);
  border-radius: 50%;
  animation: tdotBounce 1.2s infinite;
}
.tdot:nth-child(2) { animation-delay: 0.2s; }
.tdot:nth-child(3) { animation-delay: 0.4s; }

@keyframes tdotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-7px); }
}

/* ── QUICK REPLIES ── */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0 2px 37px;
  animation: msgIn 0.3s ease 0.15s forwards;
  opacity: 0;
  --sx: 0;
  align-self: flex-start;
}

.quick-btn {
  background: var(--cc-red);
  border: 1.5px solid var(--cc-red);
  color: var(--cc-white);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
  font-family: 'Lato', sans-serif;
}

.quick-btn:hover {
  background: var(--cc-white);
  color: var(--cc-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

/* ── INPUT ── */
.chat-input-area {
  flex-shrink: 0;
  padding: 14px 22px 16px;
  background: #131313;
  border-top: 1px solid rgba(245,243,239,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--cc-black);
  border: 1.5px solid rgba(245,243,239,0.12);
  border-radius: 50px;
  padding: 4px 6px 4px 18px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.input-wrap:focus-within {
  border-color: var(--cc-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.15);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 13.5px;
  font-family: 'Lato', sans-serif;
  outline: none;
  color: var(--cc-white);
}

.chat-input::placeholder { color: var(--cc-gray); }
.chat-input:disabled { opacity: 0.6; }

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cc-red), var(--cc-red-dark));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(200,16,46,0.4);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  outline: none;
}

.btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #d92840, var(--cc-red));
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(200,16,46,0.55);
}

.btn-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .chat-sidebar { width: 220px; padding: 20px 14px 16px; }
  .chat-section { height: 600px; }
}

@media (max-width: 767.98px) {
  .hero-page { padding: 6rem 0 2.5rem; }

  .chat-wrap { padding: 1.25rem 0.75rem 2rem; }
  .chat-section {
    border-radius: 14px;
    height: calc(100vh - 220px);
    min-height: 460px;
  }
  .chat-sidebar { display: none; }
  .chat-messages { padding: 16px 14px; }
  .chat-input-area { padding: 10px 14px 12px; }
  .msg-content { max-width: 78vw; }
}
