/* =========================================================
   Clínica Médica Jerusalén — Design System
   Mobile-first, fully responsive
   ========================================================= */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (min-width: 640px)  { html { scroll-padding-top: 80px; } }
@media (min-width: 1280px) { html { scroll-padding-top: 88px; } }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Navbar & Logo ---------- */
#navbar {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

#navbar.scrolled {
  box-shadow: 0 2px 20px -4px rgba(15, 64, 89, 0.14);
}

/* Logo responsivo — más grande y profesional */
.navbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  object-position: left center;
}

@media (min-width: 480px) {
  .navbar-logo { height: 62px; }
}

@media (min-width: 640px) {
  .navbar-logo { height: 68px; }
}

@media (min-width: 1024px) {
  .navbar-logo { height: 76px; }
}

@media (min-width: 1280px) {
  .navbar-logo { height: 82px; }
}

/* Active nav link */
.nav-link.active,
.mobile-link.active {
  color: #0b729f !important;
  background: #f0f7fb;
}

/* Menú móvil abierto */
body.menu-open { overflow: hidden; }
body.menu-open #navbar { box-shadow: 0 4px 24px -4px rgba(15, 64, 89, 0.15); }

/* ---------- Tipografía de secciones ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #0b729f;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.375rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 2rem;
  height: 2px;
  background: linear-gradient(90deg, #0b729f, #10b981);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}

.section-header {
  padding-bottom: 1rem;
}

/* ---------- Hero pattern ---------- */
.hero-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Hero divisor decorativo ---------- */
.hero-divider {
  display: block;
  width: 5rem;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #3da8d4);
  border-radius: 3px;
  margin: 1.25rem 0 1.5rem 0;
}

@media (min-width: 1024px) {
  .hero-divider { margin: 1.5rem 0 1.75rem 0; }
}

/* ---------- Scroll indicator ---------- */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
  animation: scrollBounce 2s ease-in-out infinite;
  cursor: pointer;
  text-decoration: none;
}

.scroll-indicator span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
}

.scroll-mouse {
  width: 1.375rem;
  height: 2.25rem;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 9999px;
  display: flex;
  justify-content: center;
  padding-top: 0.35rem;
}

.scroll-mouse-dot {
  width: 3px;
  height: 6px;
  background: white;
  border-radius: 9999px;
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%       { transform: translateY(6px); opacity: 1; }
}

@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

/* ---------- Botones ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #1da851;
  box-shadow: 0 16px 40px rgba(37, 211, 102, 0.3);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-2px);
}

/* ---------- Barra de confianza ---------- */
.trust-bar {
  border: 1.5px solid #dceef7 !important;
}

.trust-stat-number {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  color: #0b729f;
  margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .trust-stat-number { font-size: 2.25rem; }
}

.trust-stat-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.1rem;
}

.trust-stat-sub {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.trust-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .trust-icon { width: 3.25rem; height: 3.25rem; }
}

/* Separadores verticales entre stats en desktop */
.trust-item + .trust-item {
  position: relative;
}

@media (min-width: 1024px) {
  .trust-item + .trust-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #e2e8f0;
  }
}

/* ---------- Cards de servicio y médicos ---------- */
.service-card,
.doctor-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease,
              box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card.visible,
.doctor-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Service card hover: border-bottom accent */
.service-card {
  border-bottom: 3px solid transparent !important;
  transition: opacity 0.5s ease, transform 0.5s ease,
              box-shadow 0.3s ease, border-color 0.3s ease,
              border-bottom-color 0.3s ease !important;
}

.service-card:hover {
  border-bottom-color: #0b729f !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 40px -8px rgba(11, 92, 127, 0.18) !important;
}

.service-card:hover .service-icon-wrap {
  background: #0b729f;
  color: white;
}

.service-card:hover .service-icon-wrap svg {
  color: white;
}

/* Ícono circular */
.service-icon-wrap {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease;
}

@media (min-width: 640px) {
  .service-icon-wrap { width: 4.5rem; height: 4.5rem; }
}

/* Número de orden en service card */
.service-order {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.875rem;
  font-weight: 800;
  color: #cbd5e1;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}

.service-card:hover .service-order {
  color: #0b729f;
}

.doctor-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0b5c82;
  background: #f0f7fb;
  border: 1px solid #dceef7;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

/* ---------- Lab cotizador ---------- */
.lab-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1.3;
}

.lab-tag:hover {
  background: #f0f7fb;
  border-color: #7ec4e2;
  color: #0b5c82;
  transform: translateY(-1px);
}

.lab-tag.selected {
  background: #0b729f;
  border-color: #0b729f;
  color: white;
  box-shadow: 0 4px 12px rgba(11, 114, 159, 0.25);
  transform: translateY(-1px);
}

.lab-tag.selected span.w-2 {
  background: rgba(255,255,255,0.6) !important;
}

.lab-tag-combo {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.lab-tag-combo:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

.lab-tag-combo.selected {
  background: #f59e0b;
  border-color: #d97706;
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* legacy .lab-option kept for JS compatibility */
.lab-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lab-option:hover   { border-color: #7ec4e2; background: #f0f7fb; }
.lab-option.selected {
  border-color: #0b729f;
  background: #f0f7fb;
  color: #0b5c82;
  box-shadow: 0 0 0 3px rgba(11, 114, 159, 0.12);
}
.lab-option.selected::after { content: ' ✓'; color: #059669; font-weight: 800; }

.lab-input:focus { border-color: #0b729f; }

/* Summary list items */
#lab-summary-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #334155;
  padding: 0.375rem 0.625rem;
  background: #f8fafc;
  border-radius: 0.5rem;
}

#lab-summary-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #0b729f;
  flex-shrink: 0;
}

/* ---------- Promociones ---------- */
.promo-badge {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  z-index: 1;
  background: #0b729f;
  color: white;
  box-shadow: 0 4px 12px rgba(11, 114, 159, 0.35);
}

.promo-badge-hot {
  background: #f59e0b;
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.promo-img-fallback { background: linear-gradient(135deg, #dceef7 0%, #b8ddef 100%); }

.promo-img-fallback::after {
  content: 'Imagen próximamente';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b5c82;
  font-weight: 600;
  font-size: 0.875rem;
}

.promo-card {
  background: white;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 16px -4px rgba(15, 23, 42, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.promo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px -8px rgba(11, 92, 127, 0.18);
  border-color: #bfdbfe;
}

.promo-card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0f7fb;
}

.promo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.promo-card:hover .promo-card-img img { transform: scale(1.08); }

.promo-card-body {
  padding: 1rem 1.125rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .promo-card-body { padding: 1.125rem 1.375rem 1.375rem; }
}

.promo-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0b729f;
  transition: color 0.2s ease, gap 0.2s ease;
}

.promo-card:hover .promo-card-link {
  color: #0b5c82;
  gap: 0.5rem;
}

/* ---------- Galería de flyers / promociones vigentes ---------- */
.promo-flyer-frame {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px -6px rgba(15, 23, 42, 0.1);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.promo-flyer-frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.promo-flyer:hover .promo-flyer-frame {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -12px rgba(11, 92, 127, 0.22);
  border-color: #fcd34d;
}

.promo-flyer:hover .promo-flyer-frame img {
  transform: scale(1.03);
}

.promo-flyer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 42, 61, 0.75) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.promo-flyer:hover .promo-flyer-overlay {
  opacity: 1;
}

.promo-flyer-cta {
  color: white;
  font-size: 0.8125rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
}

.promo-flyer-caption {
  padding: 0.875rem 0.25rem 0;
}

/* ---------- Planes médicos — scroll horizontal en móvil ---------- */
.plans-grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.plans-grid-scroll::-webkit-scrollbar { display: none; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 1.25rem;
  min-width: max-content;
  width: 100%;
}

@media (min-width: 900px) {
  .plans-grid-scroll {
    overflow-x: visible;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
  }

  .plans-grid {
    min-width: 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1280px) {
  .plans-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
  }
}

/* ---------- FAQ acordeón ---------- */
.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item.open {
  border-color: #7ec4e2;
  box-shadow: 0 4px 20px -4px rgba(11, 114, 159, 0.12);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  background: white;
  border: none;
  cursor: pointer;
  min-height: 56px;
  transition: background 0.2s ease;
}

@media (min-width: 640px) {
  .faq-question { padding: 1.125rem 1.5rem; font-size: 1rem; }
}

.faq-question:hover            { background: #f8fafc; }
.faq-item.open .faq-question   { background: #f0f7fb; color: #0b5c82; }

.faq-icon {
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.3s ease, color 0.2s ease;
}

.faq-item.open .faq-icon { transform: rotate(180deg); color: #0b729f; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

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

.faq-answer p {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #475569;
}

@media (min-width: 640px) {
  .faq-answer p { padding: 0 1.5rem 1.5rem; font-size: 0.9375rem; }
}

.faq-answer a { text-decoration: underline; text-underline-offset: 2px; }
.faq-answer a:hover { color: #0b5c82; }

/* ---------- Botones flotantes ---------- */
.whatsapp-fab {
  bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
  right:  max(1.25rem, env(safe-area-inset-right,  1.25rem));
}

.back-to-top {
  position: fixed;
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 5.5rem));
  right:  max(1.25rem, env(safe-area-inset-right, 1.25rem));
  z-index: 49;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: #0b729f;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(11, 114, 159, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease,
              transform 0.3s ease, background 0.2s ease;
}

.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover   { background: #0b5c82; }

/* ---------- Mapas responsive ---------- */
iframe[title*="Mapa"] { min-height: 220px; }

@media (min-width: 640px) { iframe[title*="Mapa"] { min-height: 280px; } }

/* ---------- Footer social icons ---------- */
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  transition: all 0.2s ease;
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateY(-2px);
}

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

@keyframes bounceSubtle {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

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

.animate-fade-up.delay-200 {
  animation-delay: 0.2s;
  opacity: 0;
}

.animate-bounce-subtle { animation: bounceSubtle 2.5s ease-in-out infinite; }

/* ---------- Scroll reveal genérico ---------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ---------- Reduce motion (accesibilidad) ---------- */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .animate-bounce-subtle,
  .service-card,
  .doctor-card,
  .reveal-on-scroll,
  .scroll-indicator,
  .scroll-mouse-dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

