/* Planes de Salud — custom styles
   Brand color palette, WhatsApp floating button, mobile-first responsive grids, hero. */

:root {
  /* Blues — hand, cross, "COTIZA" text */
  --brand-blue-dark: #0D47A1;
  --brand-blue: #1976D2;
  --brand-blue-light: #64B5F6;
  --brand-blue-pale: #BBDEFB;

  /* Greens — heart, "conmigo" text */
  --brand-green-dark: #1B5E20;
  --brand-green: #2E7D32;
  --brand-green-light: #66BB6A;
  --brand-green-pale: #C8E6C9;

  /* Neutrals */
  --brand-text: #1a1a2e;
  --brand-text-light: #555;
  --brand-white: #ffffff;

  /* Convenience aliases */
  --ps-success: #25d366;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--brand-text);
}

/* Navbar spacing for fixed-top */
.pt-5.mt-4 {
  padding-top: 5rem !important;
}

/* --- NAVBAR --- */
.navbar-brand {
  gap: 0.6rem;
}

.navbar-logo {
  height: 112px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}

.navbar-brand-text {
  font-size: 1.45rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  margin-left: -1.2rem;
}

.navbar-tagline {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
}

#mainNav.navbar-brand-blue {
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue) 100%);
}

#mainNav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

#mainNav .nav-link:hover {
  color: var(--brand-white);
  background-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

#mainNav .nav-link.active {
  color: var(--brand-white);
}

#mainNav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--brand-green-light);
  border-radius: 2px;
}

#mainNav .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.4);
}

#mainNav .navbar-toggler-icon {
  filter: invert(1) brightness(2);
}

/* --- SECTION HEADINGS --- */
.section-heading {
  color: var(--brand-blue-dark);
  position: relative;
  display: inline-block;
  padding-bottom: 0.4rem;
  text-shadow: 0 2px 4px rgba(13, 71, 161, 0.15);
}

.section-heading::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 60px;
  height: 3px;
  background: var(--brand-green);
  border-radius: 2px;
}

.image-caption {
  max-width: 560px;
  margin: 0.65rem auto 0;
  color: rgba(26, 26, 46, 0.62);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

/* --- HERO --- */
.hero {
  background: linear-gradient(160deg, var(--brand-blue-pale) 0%, var(--brand-green-pale) 100%);
}

.hero h1 {
  color: var(--brand-blue-dark);
  text-shadow: 0 3px 10px rgba(13, 71, 161, 0.35), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.hero-headline {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.12;
  font-weight: 800;
}

.hero .lead {
  color: var(--brand-text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.badge-tkt {
  background: var(--brand-white);
  border: 1px solid var(--brand-blue-light);
  border-radius: 999px;
  padding: 0.7rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-text);
  box-shadow: 0 3px 10px rgba(25, 118, 210, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-tkt i {
  font-size: 1.25rem;
}

/* Hero tickets layout: 2 on top, 1 centered below */
.hero-tickets {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0.8rem;
  justify-content: center;
}

.hero-tickets li {
  list-style: none;
}

.hero-ticket-center {
  grid-column: 1 / -1;
  justify-self: center;
  animation-delay: 0.8s;
}

.badge-tkt .text-success { color: var(--brand-green) !important; }
.badge-tkt .text-primary { color: var(--brand-blue) !important; }
.badge-tkt .text-info { color: var(--brand-blue-light) !important; }

.hero-placeholder {
  min-height: 280px;
  aspect-ratio: 4 / 3;
  background: var(--brand-blue-pale);
}

.hero-img-wrapper {
  position: relative;
  display: inline-block;
}

.hero-img-wrapper::before {
  content: "";
  position: absolute;
  top: -12px;
  right: -12px;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-blue-light) 100%);
  border-radius: 0.75rem;
  z-index: 0;
}

.hero-img {
  position: relative;
  z-index: 1;
  max-height: 440px;
  object-fit: cover;
  border-radius: 0.75rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

/* --- BRAND BUTTONS (pill, green gradient) --- */
.btn-brand {
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
  color: var(--brand-white);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.8rem;
  font-weight: 600;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-brand:hover {
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-green) 100%);
  color: var(--brand-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.35);
}

.btn-brand:disabled {
  opacity: 0.6;
}

.btn-brand-outline {
  border: 2px solid var(--brand-blue);
  color: var(--brand-blue);
  background: transparent;
  border-radius: 999px;
  padding: 0.6rem 1.8rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

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

/* --- HERO CTA — oversized button that pops out of the hero section --- */
.hero-cta-wrap {
  position: relative;
  z-index: 10;
}

.btn-hero-cta {
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-green) 50%, var(--brand-green-dark) 100%);
  color: var(--brand-white);
  border: 3px solid var(--brand-white);
  border-radius: 999px;
  padding: 1.1rem 3.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow:
    0 8px 24px rgba(46, 125, 50, 0.5),
    0 0 0 6px rgba(255, 255, 255, 0.15);
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  animation: hero-cta-pulse 2.5s ease-in-out infinite;
}

.btn-hero-cta:hover {
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
  color: var(--brand-white);
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 12px 32px rgba(46, 125, 50, 0.6),
    0 0 0 8px rgba(255, 255, 255, 0.2);
}

@keyframes hero-cta-pulse {
  0%, 100% {
    box-shadow:
      0 8px 24px rgba(46, 125, 50, 0.5),
      0 0 0 6px rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow:
      0 8px 24px rgba(46, 125, 50, 0.5),
      0 0 0 12px rgba(255, 255, 255, 0.05);
  }
}

/* --- ISAPRE LOGO CAROUSEL (infinite auto-scroll) --- */
.isapre-banner {
  background: var(--brand-white);
  padding: 1.5rem 0;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  overflow: hidden;
}

.isapre-banner .isapre-banner-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-text-light);
  margin-bottom: 1rem;
}

.isapre-carousel {
  overflow: hidden;
  position: relative;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.isapre-carousel-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: isapre-scroll 30s linear infinite;
}

.isapre-carousel-track:hover {
  animation-play-state: paused;
}

.isapre-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.isapre-logo img {
  height: 70px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: grayscale(30%) opacity(0.85);
  transition: filter 0.3s ease;
}

.isapre-logo img:hover {
  filter: grayscale(0%) opacity(1);
}

@keyframes isapre-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- BADGES --- */
.badge-card {
  background: var(--brand-white);
  border: 1px solid #e9ecef;
  border-top: 4px solid var(--brand-blue);
  border-radius: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(13, 71, 161, 0.12);
}

.badge-card .fw-semibold,
.badge-card p {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.badge-card .badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-green-light);
  color: var(--brand-white);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* --- ABOUT / SOBRE NOSOTROS --- */
.about-text {
  color: var(--brand-text);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.about-feature {
  background: var(--brand-white);
  border: 1px solid #d0e8d1;
  border-radius: 0.75rem;
  padding: 1.2rem 0.8rem;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
}

.about-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.15);
}

.about-feature i {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  display: block;
}

.about-feature-emoji {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 0.4rem;
  display: block;
}

.about-feature p {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-text);
}

/* --- WHY US --- */
.why-us {
  background: linear-gradient(160deg, var(--brand-blue-pale) 0%, var(--brand-green-pale) 60%, #B3D9B5 100%);
  position: relative;
}

/* Decorative diagonal accent */
.why-us::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-green) 100%);
}

.why-us .section-heading {
  color: var(--brand-blue-dark);
}

.why-us-list {
  max-width: 540px;
  margin-left: 0;
}

/* Bullet items as individual mini-cards instead of flat list */
.why-us-list .list-group-item {
  background: var(--brand-white);
  border: 1px solid #d0e8d1;
  border-left: 4px solid var(--brand-green);
  border-radius: 0.5rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.why-us-list .list-group-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.12);
}

.why-us-list .list-group-item i {
  color: var(--brand-green);
  font-size: 1.2rem;
}

.why-us-img-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 2.5rem;
}

.why-us-img {
  border-radius: 0.75rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  object-fit: cover;
  width: 100%;
}

/* Decorative accent behind the image */
.why-us-img-wrapper::before {
  content: "";
  position: absolute;
  top: -12px;
  right: -12px;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-blue-light) 100%);
  border-radius: 0.75rem;
  z-index: 0;
}

.why-us-img-wrapper .why-us-img {
  position: relative;
  z-index: 1;
}

/* --- PLANS --- */
.plan-card {
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.plan-card:hover {
  box-shadow: 0 8px 24px rgba(13, 71, 161, 0.12);
}

.plan-img,
.plan-img-placeholder {
  height: 180px;
  object-fit: cover;
}

.plan-img-placeholder {
  background: var(--brand-blue-pale);
}

.plan-price {
  color: var(--brand-blue-dark);
}

.plans-ranking-img {
  max-width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* --- FAQ accordion tweaks --- */
.faq .accordion-item {
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.faq .accordion-button {
  background-color: var(--brand-blue-pale);
  color: var(--brand-text);
  font-weight: 600;
}

.faq .accordion-button:not(.collapsed) {
  background-color: var(--brand-white);
  color: var(--brand-blue-dark);
  border-left: 4px solid var(--brand-green);
  box-shadow: none;
}

.faq .accordion-button:focus {
  box-shadow: none;
  border-color: var(--brand-blue-light);
}

.faq .accordion-body {
  background: var(--brand-white);
  color: var(--brand-text-light);
}

/* --- CONTACT FORM --- */
.contact .card {
  border: 1px solid var(--brand-blue-light);
  border-radius: 0.75rem;
  overflow: hidden;
}

.contact .card-header-form {
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue) 100%);
  color: var(--brand-white);
}

.contact .form-control:focus,
.contact .form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.15);
}

/* --- SURVEY / TEST SECTION --- */
.contact .card-header-survey {
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue) 100%);
  color: var(--brand-white);
}

.survey-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--brand-green-light);
  outline: none;
}

.survey-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-green-dark);
  cursor: pointer;
  border: 2px solid var(--brand-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.survey-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-green-dark);
  cursor: pointer;
  border: 2px solid var(--brand-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* --- FOOTER --- */
.footer {
  background: var(--brand-blue-dark) !important;
  color: rgba(255, 255, 255, 0.7);
}

.footer a {
  color: var(--brand-green-light);
  text-decoration: none;
}

/* --- WhatsApp floating button --- */
.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1050;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: var(--brand-green);
  border-color: var(--brand-green);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.4);
  animation: whatsapp-pulse 2.4s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  background-color: var(--brand-green-dark);
}

.whatsapp-float i {
  color: #fff;
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5); }
  50%      { box-shadow: 0 0 0 14px rgba(46, 125, 50, 0); }
}

/* --- SCROLL REVEAL ANIMATION --- */
/* Fallback: if JS is disabled or fails, .reveal stays visible */
.no-js .reveal,
.reveal.no-js {
  opacity: 1;
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible,
.reveal.failsafe {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children inside revealed sections */
.reveal .badge-card,
.reveal .plan-card,
.reveal .accordion-item,
.reveal .why-us-list .list-group-item,
.reveal .col-sm-4 {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible .badge-card,
.reveal.visible .plan-card,
.reveal.visible .accordion-item,
.reveal.visible .why-us-list .list-group-item,
.reveal.visible .col-sm-4 {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for children */
.reveal.visible .badge-card:nth-child(1),
.reveal.visible .plan-card:nth-child(1),
.reveal.visible .accordion-item:nth-child(1) { transition-delay: 0.1s; }
.reveal.visible .badge-card:nth-child(2),
.reveal.visible .plan-card:nth-child(2),
.reveal.visible .accordion-item:nth-child(2) { transition-delay: 0.2s; }
.reveal.visible .badge-card:nth-child(3),
.reveal.visible .plan-card:nth-child(3),
.reveal.visible .accordion-item:nth-child(3) { transition-delay: 0.3s; }
.reveal.visible .badge-card:nth-child(4),
.reveal.visible .plan-card:nth-child(4),
.reveal.visible .accordion-item:nth-child(4) { transition-delay: 0.4s; }

/* Hide Alpine pre-init flicker */
[x-cloak] { display: none !important; }

@media (max-width: 991.98px) {
  .navbar-logo { height: 72px; }
  .navbar-brand-text { font-size: 1.25rem; margin-left: -0.8rem; }
}

/* --- Mobile-first (360px) --- */
@media (max-width: 360px) {
  .display-5 { font-size: 1.6rem; }
  .btn-lg { padding: 0.5rem 1rem; font-size: 1rem; }
  .btn-brand { padding: 0.5rem 1.2rem; font-size: 1rem; }
  .btn-hero-cta { padding: 0.9rem 2rem; font-size: 1.1rem; border-width: 2px; }
  .badge-tkt {
    flex: 1 1 100%;
    justify-content: center;
  }
  .whatsapp-float {
    right: 10px;
    bottom: 10px;
    width: 48px;
    height: 48px;
  }
  .whatsapp-float i { font-size: 1.3rem; }
  .navbar-logo { height: 56px; }
  .navbar-brand-text { font-size: 1.15rem; margin-left: -0.6rem; }
}

/* --- Desktop multi-column grids --- */
@media (min-width: 768px) {
  .badges .row,
  .why-us .row {
    --bs-gutter-x: 1.5rem;
  }
}

@media (min-width: 992px) {
  .hero-img-wrapper {
    transform: translateX(2rem);
    max-width: calc(100% - 2rem);
  }
}
