/* ==========================================================================
   TRACK MOTO CHILE - COMPONENTES REUTILIZABLES (COMPONENTS.CSS)
   Botón WhatsApp flotante, Botones CTA, Tarjetas, Formularios y Avisos
   ========================================================================== */

/* ==========================================================================
   BOTONES
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  min-height: 48px; /* Supera WCAG 44x44px */
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease-out, background-color 150ms ease-out, border-color 140ms ease-out, box-shadow 160ms ease-out, color 150ms ease-out;
  text-align: center;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 140ms ease-out;
}

/* Botón Rojo Intenso Primario (CTA Principal) */
.btn-primary {
  background: linear-gradient(135deg, var(--red-primary) 0%, #b81b28 100%);
  color: #ffffff;
  box-shadow: var(--shadow-red);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(227, 38, 54, 0.3);
}

/* Botón Secundario Grafito Metálico */
.btn-secondary {
  background-color: var(--bg-graphite);
  color: var(--text-smoke);
  border-color: var(--border-subtle);
}

/* Botón Delineado */
.btn-outline {
  background-color: transparent;
  color: var(--text-smoke);
  border-color: rgba(135, 145, 154, 0.35);
}

/* Botón WhatsApp Verde */
.btn-whatsapp {
  background-color: var(--green-wa);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover svg {
    transform: scale(1.08);
  }
  .btn-primary:hover {
    background: linear-gradient(135deg, #f02d3e 0%, var(--red-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(227, 38, 54, 0.4);
    color: #ffffff;
  }
  .btn-secondary:hover {
    background-color: var(--bg-graphite-elevated);
    border-color: var(--border-active);
    color: #ffffff;
    transform: translateY(-2px);
  }
  .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
  }
  .btn-whatsapp:hover {
    background-color: var(--green-wa-dark);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
    transform: translateY(-2px);
  }
}

.btn-whatsapp:hover {
  background-color: var(--green-wa-dark);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

/* Botón Tamaño Grande Hero */
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.08rem;
  min-height: 54px;
}

/* Botón Ancho Completo */
.btn-block {
  width: 100%;
}

/* ==========================================================================
   BOTÓN FLOTANTE OFICIAL DE WHATSAPP
   ========================================================================== */

.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.floating-whatsapp-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: var(--green-wa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(37, 211, 102, 0.7);
  position: relative;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  animation: waPulse 2.8s infinite;
}

.floating-whatsapp-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

.floating-whatsapp:hover .floating-whatsapp-btn {
  transform: scale(1.08);
  background-color: var(--green-wa-dark);
  animation: none;
}

/* Tooltip emergente "¿Necesitas ayuda?" */
.floating-whatsapp-tooltip {
  background-color: var(--bg-graphite);
  color: var(--text-smoke);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.95;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.floating-whatsapp:hover .floating-whatsapp-tooltip {
  opacity: 1;
  transform: translateX(-4px);
  border-color: rgba(37, 211, 102, 0.4);
}

@keyframes waPulse {
  0% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  70% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@media (max-width: 500px) {
  .floating-whatsapp {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }
  .floating-whatsapp-tooltip {
    display: none; /* Ocultar texto en móviles para evitar tapar contenido */
  }
  .floating-whatsapp-btn {
    width: 52px;
    height: 52px;
  }
}

/* ==========================================================================
   TARJETAS Y MÓDULOS DE CONTENIDO
   ========================================================================== */

.card {
  background-color: var(--bg-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  transition: transform 160ms ease-out, border-color 140ms ease-out, box-shadow 160ms ease-out, background-color 160ms ease-out;
  display: flex;
  flex-direction: column;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(227, 38, 54, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(227, 38, 54, 0.16);
  }
}

/* Esquina deportiva técnica */
.card-technical::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--red-primary);
  border-top-left-radius: var(--radius-md);
}

.card-title {
  color: #ffffff;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-desc {
  color: var(--text-steel);
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-icon {
  width: 52px;
  height: 52px;
  background-color: rgba(227, 38, 54, 0.1);
  border: 1px solid rgba(227, 38, 54, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-primary);
  margin-bottom: 1.25rem;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* ==========================================================================
   FORMULARIOS DE ALTA CONVERSIÓN
   ========================================================================== */

.form-box {
  background-color: var(--bg-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
}

.form-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.form-header h3 {
  font-size: 1.35rem;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.form-header p {
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-smoke);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-label .required {
  color: var(--red-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: #0d1013;
  border: 1px solid rgba(135, 145, 154, 0.25);
  border-radius: var(--radius-sm);
  color: var(--text-smoke);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(227, 38, 54, 0.2);
  background-color: #111519;
}

.form-input:invalid:not(:placeholder-shown) {
  border-color: rgba(227, 38, 54, 0.5);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   ALERTAS Y AVISOS TRANSPARENTES (DISCLAIMERS)
   ========================================================================== */

.alert-notice {
  background-color: rgba(22, 26, 30, 0.8);
  border-left: 4px solid var(--red-primary);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  color: var(--text-steel);
}

.alert-notice svg {
  width: 22px;
  height: 22px;
  color: var(--red-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-notice strong {
  color: var(--text-smoke);
}

/* Badges / Etiquetas */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-red {
  background-color: rgba(227, 38, 54, 0.15);
  color: #ff5e6c;
  border: 1px solid rgba(227, 38, 54, 0.3);
}

.badge-steel {
  background-color: rgba(135, 145, 154, 0.12);
  color: var(--text-smoke);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 650px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-box {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   NOTA TÉCNICA COMPACTA (DISCLAIMER REDISEÑADO)
   ========================================================================== */

.technical-disclaimer {
  position: relative;
  background: rgba(22, 26, 30, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(135, 145, 154, 0.18);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.6rem;
  max-width: 760px;
  margin: 2.5rem auto 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.technical-disclaimer-accent {
  position: absolute;
  top: 0;
  left: 1.75rem;
  width: 38px;
  height: 3px;
  background: var(--red-primary);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 0 10px rgba(227, 38, 54, 0.7);
}

.technical-disclaimer-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.technical-disclaimer-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(227, 38, 54, 0.12);
  border: 1px solid rgba(227, 38, 54, 0.25);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.technical-disclaimer-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.technical-disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-steel);
  line-height: 1.5;
}

.technical-disclaimer strong {
  color: var(--text-smoke);
}

/* ==========================================================================
   BARRA INFORMATIVA EN LOOP (TICKER HORIZONTAL)
   ========================================================================== */

.info-ticker-bar {
  position: relative;
  z-index: 15;
  width: 100%;
  height: 52px;
  background-color: #0b0e11;
  border-top: 1px solid rgba(227, 38, 54, 0.45);
  border-bottom: 1px solid rgba(227, 38, 54, 0.45);
  overflow: hidden;
  display: flex;
  align-items: center;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: tickerLoop 30s linear infinite;
}

.ticker-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-item {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-smoke);
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
}

.ticker-item .text-red {
  color: var(--red-primary);
  font-weight: 800;
  margin: 0 0.25rem;
}

.ticker-separator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--red-primary);
  box-shadow: 0 0 6px rgba(227, 38, 54, 0.85);
  display: inline-block;
  flex-shrink: 0;
}

@keyframes tickerLoop {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 768px) {
  .info-ticker-bar {
    height: 46px;
  }
  .ticker-item {
    font-size: 0.78rem;
    padding: 0 0.9rem;
  }
  .ticker-track {
    animation-duration: 25s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .info-ticker-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ticker-track {
    animation: none !important;
  }
}


