/* ============================================
   COMPARASALUD PREMIUM DESIGN OVERLAY 2026
   Remove this file to revert to original design.
   ============================================ */

/* ---------- GOOGLE FONTS: Inter + Merriweather ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Merriweather:wght@700;900&display=swap');

/* ---------- CSS CUSTOM PROPERTIES ---------- */
:root {
  --cs-primary: #1e5ba8;
  --cs-primary-dark: #164580;
  --cs-primary-light: #3b82f6;
  --cs-accent: #10b981;
  --cs-accent-light: #34d399;
  --cs-bg: #fafbfc;
  --cs-surface: #ffffff;
  --cs-text: #1a1a2e;
  --cs-text-muted: #6b7280;
  --cs-border: #e5e7eb;
  --cs-radius: 16px;
  --cs-radius-sm: 12px;
  --cs-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --cs-shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --cs-shadow-lg: 0 10px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
  --cs-shadow-xl: 0 20px 60px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.08);
  --cs-transition: cubic-bezier(.4,0,.2,1);
}

/* ---------- GLOBAL RESETS ---------- */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--cs-bg);
  color: var(--cs-text);
  line-height: 1.7;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.5rem); }

/* Blog body text: optimal reading */
article p, .prose p {
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 680px;
}

/* ---------- SKIP LINK ---------- */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--cs-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  transition: left .2s;
}
.skip-to-content:focus {
  left: 0;
}

/* ---------- PREMIUM NAVBAR ---------- */
header.sticky {
  background: rgba(255,255,255,.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: none !important;
  transition: all .3s var(--cs-transition);
}

header.sticky .max-w-7xl {
  transition: padding .3s var(--cs-transition);
}

/* Navbar link hover effect */
header nav a {
  position: relative;
  transition: color .2s var(--cs-transition);
}
header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cs-primary);
  border-radius: 2px;
  transition: width .3s var(--cs-transition);
}
header nav a:hover::after {
  width: 100%;
}

/* ---------- CTA BUTTONS ---------- */
.bg-gradient-to-r.from-blue-700,
a[href="/comparador-seguros-salud/"].rounded-full {
  background: linear-gradient(135deg, var(--cs-primary), var(--cs-primary-light)) !important;
  box-shadow: 0 4px 14px rgba(30,91,168,.35);
  transition: all .3s var(--cs-transition) !important;
}
.bg-gradient-to-r.from-blue-700:hover,
a[href="/comparador-seguros-salud/"].rounded-full:hover {
  box-shadow: 0 6px 24px rgba(30,91,168,.45);
  transform: translateY(-2px);
}

/* White CTA on hero */
.bg-white.text-blue-700.rounded-full {
  box-shadow: 0 4px 14px rgba(255,255,255,.3);
  transition: all .3s var(--cs-transition);
}
.bg-white.text-blue-700.rounded-full:hover {
  box-shadow: 0 8px 28px rgba(255,255,255,.4);
}

/* ---------- HERO SECTION ---------- */
section.relative.bg-gradient-to-br.from-blue-800 {
  background: linear-gradient(135deg, #0f2b4c 0%, #1a4280 40%, #1e5ba8 70%, #2563eb 100%) !important;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

/* Hero floating blobs - make more premium */
section.relative.bg-gradient-to-br .absolute.inset-0 {
  opacity: .07;
}

/* ---------- CARDS ---------- */
.rounded-2xl, .rounded-xl {
  border-radius: var(--cs-radius) !important;
  transition: all .4s var(--cs-transition);
}

/* Silo cards */
a.rounded-2xl:hover {
  box-shadow: var(--cs-shadow-lg) !important;
  transform: translateY(-6px) !important;
  border-color: rgba(30,91,168,.2) !important;
}

/* Article cards */
a.rounded-xl:hover {
  box-shadow: var(--cs-shadow-md) !important;
}

/* Card gradient hover accent line */
a.rounded-2xl::before,
a.rounded-xl[href*="/blog"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cs-primary), var(--cs-accent));
  border-radius: var(--cs-radius) var(--cs-radius) 0 0;
  opacity: 0;
  transition: opacity .3s var(--cs-transition);
}
a.rounded-2xl { position: relative; overflow: hidden; }
a.rounded-2xl:hover::before,
a.rounded-xl[href*="/blog"]:hover::before {
  opacity: 1;
}

/* ---------- TRUST BAR ---------- */
section.py-6.bg-gray-50 {
  background: linear-gradient(90deg, #f9fafb, #f0f4ff, #f9fafb) !important;
}

section.py-6.bg-gray-50 .font-bold {
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--cs-text) !important;
  opacity: .6;
  transition: opacity .2s;
}
section.py-6.bg-gray-50 .font-bold:hover {
  opacity: 1;
}

/* ---------- SECTION HEADINGS ---------- */
section h2 {
  position: relative;
}

.text-center h2::after,
section > div > .text-center > h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--cs-primary), var(--cs-accent));
  border-radius: 4px;
  margin: 16px auto 0;
}

/* ---------- HOW IT WORKS (steps) ---------- */
section.py-16.bg-white .w-16.h-16 {
  transition: transform .3s var(--cs-transition), box-shadow .3s;
}
section.py-16.bg-white .w-16.h-16:hover {
  transform: scale(1.1);
  box-shadow: var(--cs-shadow-md);
}

/* Step numbers connector line */
section.py-16.bg-white .grid.grid-cols-1.md\:grid-cols-3 {
  position: relative;
}

/* ---------- YMYL TRUST SECTION ---------- */
section.py-16.bg-blue-50 {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%) !important;
}

section.py-16.bg-blue-50 .rounded-xl {
  border: 1px solid var(--cs-border);
  transition: all .3s var(--cs-transition);
}
section.py-16.bg-blue-50 .rounded-xl:hover {
  border-color: rgba(30,91,168,.2);
  box-shadow: var(--cs-shadow-md);
  transform: translateY(-4px);
}

section.py-16.bg-blue-50 .fas {
  transition: transform .3s;
}
section.py-16.bg-blue-50 .rounded-xl:hover .fas {
  transform: scale(1.15);
}

/* ---------- TOOLS SECTION ---------- */
section.py-12.bg-gradient-to-br {
  background: linear-gradient(135deg, #eff6ff 0%, #fafbfc 50%, #ecfdf5 100%) !important;
}

/* ---------- FOOTER ---------- */
footer.bg-gray-900 {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
}

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

.animate-in {
  animation: fadeInUp .6s var(--cs-transition) both;
}

/* Stagger children */
.animate-stagger > *:nth-child(1) { animation-delay: 0s; }
.animate-stagger > *:nth-child(2) { animation-delay: .08s; }
.animate-stagger > *:nth-child(3) { animation-delay: .16s; }
.animate-stagger > *:nth-child(4) { animation-delay: .24s; }
.animate-stagger > *:nth-child(5) { animation-delay: .32s; }
.animate-stagger > *:nth-child(6) { animation-delay: .40s; }

/* ---------- READING PROGRESS BAR ---------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cs-primary), var(--cs-accent));
  z-index: 9999;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ---------- SMOOTH FOCUS STYLES ---------- */
*:focus-visible {
  outline: 3px solid var(--cs-primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #reading-progress { transition: none; }
}

/* ---------- COOKIE BANNER PREMIUM ---------- */
#cookie-banner {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,.95) !important;
  border-top: 1px solid var(--cs-border) !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08) !important;
}

/* ---------- BLOG ARTICLE ENHANCEMENTS ---------- */
article table {
  border-radius: var(--cs-radius-sm);
  overflow: hidden;
  box-shadow: var(--cs-shadow-sm);
}

article table th {
  background: var(--cs-primary) !important;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .05em;
}

article table td {
  border-color: var(--cs-border);
}

article table tr:hover td {
  background: #f9fafb;
}

/* FAQ details styling */
details {
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: all .3s var(--cs-transition);
}

details[open] {
  box-shadow: var(--cs-shadow-sm);
  border-color: rgba(30,91,168,.2);
}

details summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  background: var(--cs-primary);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  transition: transform .3s;
  flex-shrink: 0;
}

details[open] summary::before {
  content: '−';
  transform: rotate(180deg);
}

details summary:hover { background: #f9fafb; }

details > div, details > p {
  padding: 0 20px 16px 56px;
}

/* Key points box */
.border-l-4.border-blue-500,
div[style*="border-left: 4px solid"] {
  border-radius: 0 var(--cs-radius-sm) var(--cs-radius-sm) 0 !important;
  box-shadow: var(--cs-shadow-sm);
}

/* ---------- MEDICAL DISCLAIMER BOX ---------- */
div[style*="border-left: 4px solid #e74c3c"],
.medical-disclaimer {
  border-radius: 0 var(--cs-radius-sm) var(--cs-radius-sm) 0 !important;
  box-shadow: var(--cs-shadow-sm);
}

/* ---------- MOBILE IMPROVEMENTS ---------- */
@media (max-width: 768px) {
  header.sticky {
    backdrop-filter: blur(12px);
  }

  /* Larger touch targets */
  nav a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Mobile card spacing */
  .grid.gap-6 { gap: 16px; }
}

/* ---------- PRINT STYLES ---------- */
@media print {
  header, footer, #cookie-banner, .skip-to-content, #reading-progress { display: none !important; }
  body { background: white; color: black; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; color: #666; }
}
