/* ==========================================================================
   Design System - Dr. Héctor Hernández, Pediatra
   ========================================================================== */

/* --- Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --clinical-blue: #1B3B5A;
  --clinical-blue-dark: #12283e;
  --clinical-blue-light: #2c5987;
  --warm-beige: #F9F7F2;
  --jungle-green: #4facaf;
  --jungle-hover: #3b8e8f;
  --jungle-light: rgba(79, 172, 175, 0.1);
  --marble-white: #FAFAFA;
  --soft-blue: #E0F2F1;
  --soft-blue-light: rgba(224, 242, 241, 0.3);
  --alert-red: #E57373;
  --alert-red-light: #fbe3e3;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typography */
  --font-sans: 'Montserrat', sans-serif;
  --font-serif: 'Playfair Display', serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease-in-out;
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Base Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-700);
  background-color: var(--marble-white);
  background-image: url('https://www.transparenttextures.com/patterns/white-wall-3.png');
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--clinical-blue);
  line-height: 1.2;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

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

ul {
  list-style: none;
}

/* --- Utilities & Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 3rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
  .md\:flex-row { flex-direction: row; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
  .lg\:w-1\/2 { width: 50%; }
}

.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

/* --- Components --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background-color: var(--jungle-green);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(46, 139, 87, 0.39);
}

.btn-primary:hover {
  background-color: var(--jungle-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 139, 87, 0.23);
}

.btn-clinical {
  background-color: var(--clinical-blue);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(27, 59, 90, 0.39);
}

.btn-clinical:hover {
  background-color: var(--clinical-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 59, 90, 0.23);
}

.btn-outline {
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border: 2px solid var(--clinical-blue);
  color: var(--clinical-blue);
}

.btn-outline:hover {
  background-color: var(--clinical-blue);
  color: white;
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-glass);
}

/* Service Card */
.service-card {
  background-color: white;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-bounce);
  height: 100%;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
  border-color: var(--jungle-green);
}

.service-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  transition: all var(--transition-normal);
}

.service-card:hover .service-icon-wrapper {
  background-color: var(--jungle-green);
  color: white;
  transform: scale(1.1) rotate(5deg);
}

/* Check List */
.check-list-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
}

.check-list-item::before {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: var(--jungle-green);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-outline {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  color: var(--jungle-green);
}

.badge-solid {
  background-color: var(--jungle-green);
  color: white;
}

/* --- Layout Specifics --- */

/* Top Bar */
.top-bar {
  background-color: var(--clinical-blue);
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  position: relative;
  z-index: 50;
}

/* Header */
.main-header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--gray-100);
  transition: padding var(--transition-normal);
}

.main-header.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
}

.nav-link {
  color: var(--clinical-blue);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 12px;
  border: 3px solid transparent;
  border-bottom-color: var(--jungle-green);
  border-radius: 50%;
  transition: all var(--transition-bounce);
  opacity: 0;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
  opacity: 1;
}

/* Footer */
.main-footer {
  background-color: var(--clinical-blue);
  color: white;
  padding: 4rem 0 2rem;
  position: relative;
  margin-top: 4rem;
}

.wave-container {
  position: absolute;
  top: -59px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-container svg {
  display: block;
  width: 100%;
  height: 60px;
  fill: var(--clinical-blue);
}

/* --- Animations & Effects --- */

.reveal-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

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

@keyframes pulse-slow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.animate-pulse-slow {
  animation: pulse-slow 3s infinite;
}

/* Efecto Desbordamiento (Overflow Silhouette) */
.silhouette-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.silhouette-img {
  position: absolute;
  bottom: 0;
  max-width: 90%;
  left: 50%;
  transform: translateX(-50%);
  max-height: 120%; /* Makes it overflow the container */
  width: auto;
  z-index: 20;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15));
}

.shape-blob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding-bottom: 100%; /* Aspect ratio 1:1 */
  background: linear-gradient(135deg, var(--soft-blue) 0%, var(--jungle-light) 100%);
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  animation: morph 8s ease-in-out infinite;
  z-index: 10;
}

@keyframes morph {
  0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
}

/* Interactive Image Slider (Original -> Caricatura) */
.image-slider-container {
  position: relative;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  aspect-ratio: 4/5;
}

.image-slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%; /* Ajuste para zoom o recortar marca de agua si es necesario */
}

.image-slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%; /* Initial position */
  height: 100%;
  overflow: hidden;
  z-index: 20;
}

.image-slider-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  max-width: 550px;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%; /* Initial position */
  width: 4px;
  height: 100%;
  background: white;
  z-index: 30;
  cursor: ew-resize;
  transform: translateX(-50%);
}

.slider-handle::after {
  content: '\f337'; /* FontAwesome arrows-left-right */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--jungle-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  border: 3px solid white;
}

/* Blog & Article Styles */
.article-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.article-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-card:hover .article-img {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

/* Prose (Content formatting for articles) */
.prose {
  max-width: 65ch;
  margin: 0 auto;
}

.prose h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 0.5rem;
}

.prose h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--jungle-green);
}

.prose p {
  margin-bottom: 1.25rem;
  color: var(--gray-600);
  font-size: 1.1rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
  color: var(--gray-600);
}

.prose strong {
  color: var(--gray-800);
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background: white;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clinical-blue);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
}

.faq-icon {
  transition: transform var(--transition-fast);
  color: var(--jungle-green);
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
  background: var(--gray-50);
}

.faq-answer-inner {
  padding: 0 1.5rem 1.25rem;
  color: var(--gray-600);
}

/* Floating WhatsApp */
.floating-wa {
  position: fixed;
  bottom: 5.5rem; /* Ajustado para no chocar con el bottom bar en movil */
  right: 1.5rem;
  background-color: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: transform var(--transition-fast);
}

@media (min-width: 768px) {
  .floating-wa {
    bottom: 2rem;
    right: 2rem;
  }
}

.floating-wa:hover {
  transform: scale(1.1);
}

/* Mobile Bottom Bar */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.bottom-bar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  gap: 0.25rem;
  width: 25%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.bottom-bar-link i {
  font-size: 1.25rem;
}

.bottom-bar-link.active,
.bottom-bar-link:hover {
  color: var(--clinical-blue);
}

.bottom-bar-cta {
  color: var(--jungle-green);
}
.bottom-bar-cta i {
  font-size: 1.5rem;
}
.bottom-bar-cta:hover {
  color: var(--jungle-hover);
}

/* Tailwind-like utilities for rapid development */
.w-full { width: 100%; }
.h-full { height: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.hidden { display: none; }
@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
}

.text-white { color: white; }
.text-clinical-blue { color: var(--clinical-blue); }
.text-jungle-green { color: var(--jungle-green); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }

.bg-white { background-color: white; }
.bg-clinical-blue { background-color: var(--clinical-blue); }
.bg-jungle-green { background-color: var(--jungle-green); }
.bg-warm-beige { background-color: var(--warm-beige); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
