/* ════════════════════════════════════════════
   ORTOPÉDICA BRITÁNICA — Estilos personalizados
   ════════════════════════════════════════════ */

/* ── Base ── */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Animaciones de entrada ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.7s ease-out forwards;
  opacity: 0;
}

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}

/* ── WhatsApp flotante — anillo de pulso ── */
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.whatsapp-pulse {
  position: relative;
}

.whatsapp-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: #25D366;
  animation: pulse-ring 1.5s ease-out infinite;
  z-index: -1;
}

/* ── Skeleton de carga ── */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #F4F6FA 25%, #e8ecf2 50%, #F4F6FA 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ── Navegación — subrayado animado ── */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #E31D1A;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ── FAQ acordeón ── */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-content.open {
  max-height: 500px;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-icon.rotated {
  transform: rotate(180deg);
}

/* ── Tarjetas de producto ── */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(27, 42, 107, 0.1);
}

/* ── Filtros de categoría ── */
.cat-btn {
  transition: all 0.25s ease;
}

.cat-btn.active {
  background: #1B2A6B;
  color: white;
  border-color: #1B2A6B;
}

/* ── Toast notificaciones ── */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast {
  animation: slideInRight 0.4s ease-out forwards;
}

/* ── Utilidad: truncar líneas ── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Accesibilidad: foco visible en teclado ── */
*:focus-visible {
  outline: 2px solid #1B2A6B;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Accesibilidad: reducir movimiento si el usuario lo prefiere ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-fade-up {
    animation: none;
    opacity: 1;
  }

  .whatsapp-pulse::before {
    animation: none;
  }

  .skeleton {
    animation: none;
  }

  .product-card {
    transition: none;
  }

  .faq-content {
    transition: none;
  }

  .faq-icon {
    transition: none;
  }

  .cat-btn {
    transition: none;
  }

  .toast {
    animation: none;
  }
}
