/* ==========================================================================
   CENTRO MEDICO RIVAS - OFFICIAL BRAND DESIGN SYSTEM
   Color Tokens extracted directly from official logo:
   - Primary Brand Emerald: #006C3B
   - Dark Forest Green: #034524
   - Warm Amber Gold: #CE7A06 / #EEA01F / #C67104
   - Soft Background Tint: #F4F8F5 / #EBF7F0
   - Deep Text: #0A2518 / #0F172A
   - Slate Neutral: #334155 / #475569
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --brand-emerald: #006C3B;
  --brand-emerald-dark: #034524;
  --brand-emerald-light: #EBF7F0;
  --brand-emerald-subtle: #F4F8F5;
  
  --brand-gold: #CE7A06;
  --brand-gold-bright: #EEA01F;
  --brand-gold-dark: #A85B00;
  --brand-gold-light: #FEF8EC;
  
  --text-dark: #0A2518;
  --text-slate: #334155;
  --text-muted: #64748B;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
  background-color: var(--brand-emerald-subtle);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  color: var(--text-dark);
  letter-spacing: -0.025em;
}

/* Background utilities */
.bg-brand-subtle {
  background-color: var(--brand-emerald-subtle);
}

.bg-brand-light {
  background-color: var(--brand-emerald-light);
}

/* Top Action Ribbon Strip */
.acc-ribbon-bar {
  background: linear-gradient(90deg, #034524 0%, #006C3B 50%, #034524 100%);
  color: #FFFFFF;
  border-bottom: 2px solid #CE7A06;
  box-shadow: 0 4px 12px rgba(0, 108, 59, 0.2);
}

/* Highlight Banner */
.acc-highlight-banner {
  background: linear-gradient(135deg, #006C3B 0%, #034524 100%);
  color: #FFFFFF;
  border-top: 2px solid #EEA01F;
  border-bottom: 2px solid #EEA01F;
}

/* Buttons */
.btn-brand-emerald {
  background: #006C3B;
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 9999px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 108, 59, 0.3);
}

.btn-brand-emerald:hover {
  background: #034524;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 108, 59, 0.45);
}

.btn-brand-gold {
  background: linear-gradient(135deg, #EEA01F 0%, #CE7A06 100%);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 9999px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(206, 122, 6, 0.3);
}

.btn-brand-gold:hover {
  background: linear-gradient(135deg, #CE7A06 0%, #A85B00 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(206, 122, 6, 0.45);
}

.btn-acc-directorio {
  background: linear-gradient(135deg, #006C3B 0%, #034524 100%);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 9999px;
  border: 1.5px solid #EEA01F;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 108, 59, 0.25);
}

.btn-acc-directorio:hover {
  background: linear-gradient(135deg, #034524 0%, #006C3B 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(238, 160, 31, 0.35);
}

/* Hero Frame & Multi-image Crossfade */
.acc-hero-container {
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 20px 50px -10px rgba(0, 108, 59, 0.15);
  background: #FFFFFF;
  border: 1px solid rgba(0, 108, 59, 0.15);
  position: relative;
}

.hero-slider-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1.05);
}

.hero-dots-container {
  position: absolute;
  bottom: 20px;
  right: 24px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(3, 69, 36, 0.6);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(238, 160, 31, 0.4);
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-dot.active {
  width: 24px;
  border-radius: 12px;
  background: #EEA01F;
  box-shadow: 0 0 8px rgba(238, 160, 31, 0.6);
}

/* Specialty Photo Cards */
.specialty-photo-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  height: 230px;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid rgba(0, 108, 59, 0.12);
}

.specialty-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.specialty-photo-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0A2518;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1.5px solid rgba(0, 108, 59, 0.2);
  transition: all 0.25s ease;
}

.specialty-photo-card:hover .specialty-photo-badge {
  background: #006C3B;
  color: #FFFFFF;
  border-color: #EEA01F;
}

.specialty-photo-card:hover .specialty-photo-badge i {
  color: #EEA01F !important;
}

/* Curved Study Cards */
.study-curved-card {
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  min-height: 290px;
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.18);
  transition: all 0.35s ease;
  border: 1px solid rgba(0, 108, 59, 0.15);
}

.study-curved-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -8px rgba(0, 108, 59, 0.25);
  border-color: #EEA01F;
}

/* Step Cards in "Reserva tu hora" */
.acc-emerald-step-card {
  background: linear-gradient(135deg, #006C3B 0%, #034524 100%);
  border-radius: 26px;
  color: #FFFFFF;
  padding: 28px 24px;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px -5px rgba(0, 108, 59, 0.35);
  border: 1px solid rgba(238, 160, 31, 0.3);
}

.acc-emerald-step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -6px rgba(0, 108, 59, 0.45);
  border-color: #EEA01F;
}

/* Step Wizard */
.wizard-box {
  background: #FFFFFF;
  border: 2px solid #006C3B;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 108, 59, 0.08);
  overflow: hidden;
}

.wizard-header-pill {
  background: #EBF7F0;
  border-bottom: 2px solid #006C3B;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
  color: #034524;
}

.wizard-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 28px;
}

.wizard-step-indicator::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: #E2E8F0;
  z-index: 1;
}

.wizard-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.wizard-step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  transition: all 0.25s ease;
}

.wizard-step-item.active .wizard-step-circle {
  background: #006C3B;
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(238, 160, 31, 0.35);
}

.wizard-step-item.done .wizard-step-circle {
  background: #CE7A06;
  color: #FFFFFF;
}

.wizard-step-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
}

.wizard-step-item.active .wizard-step-label {
  color: #006C3B;
}

/* ==========================================================================
   INTERACTIVE LOWER GALLERY THREAD (Carrusel en hilo de 5 imágenes clickeables)
   ========================================================================== */
.gallery-thread-wrapper {
  position: relative;
  overflow: hidden;
  padding: 10px 0;
}

.gallery-thread-track {
  display: flex;
  gap: 20px;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: grab;
  user-select: none;
}

.gallery-thread-track:active {
  cursor: grabbing;
}

.gallery-thread-card {
  flex: 0 0 280px;
  height: 220px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(0, 108, 59, 0.15);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  background: #034524;
}

@media (min-width: 640px) {
  .gallery-thread-card {
    flex: 0 0 320px;
    height: 240px;
  }
}

.gallery-thread-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-thread-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #EEA01F;
  box-shadow: 0 16px 35px -6px rgba(0, 108, 59, 0.3);
}

.gallery-thread-card:hover img {
  transform: scale(1.1);
}

.gallery-thread-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 69, 36, 0.92) 0%, rgba(3, 69, 36, 0.4) 50%, transparent 100%);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #FFFFFF;
}

.gallery-thread-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(238, 160, 31, 0.95);
  color: #034524;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-btn-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #006C3B;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 1.5px solid #006C3B;
  transition: all 0.25s ease;
  cursor: pointer;
}

.gallery-btn-nav:hover {
  background: #006C3B;
  color: #FFFFFF;
  transform: scale(1.08);
}

/* Slide-over Drawer Panel */
.acc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 69, 36, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.acc-overlay.active {
  opacity: 1;
  visibility: visible;
}

.acc-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 420px;
  max-width: 100vw;
  height: 100dvh;
  background: #FFFFFF;
  z-index: 9999;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
}

.acc-drawer.active {
  right: 0;
}

.acc-drawer-header {
  background: linear-gradient(135deg, #034524 0%, #006C3B 100%);
  color: #FFFFFF;
  border-bottom: 3px solid #EEA01F;
}

/* Accordion FAQs */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease, padding 0.3s ease;
  opacity: 0;
}

.faq-item.active .faq-content {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

/* Floating WhatsApp */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  animation: floatPulse 3s infinite ease-in-out;
}

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

/* Modal Animations */
dialog::backdrop {
  background: rgba(3, 69, 36, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog[open] {
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* 3-Tier Footer Bands (Rivas Brand Colors) */
.footer-tier-1 {
  background: #EBF7F0;
  color: #034524;
}

.footer-tier-2 {
  background: #034524;
  color: #FFFFFF;
  border-top: 3px solid #EEA01F;
}

.footer-tier-3 {
  background: #012613;
  color: #A3D9C9;
}
