

.section-primary {
  position: relative;
  background: var(--primary);
  color: var(--primary-foreground);
}

@keyframes teamFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Ondas decorativas --- */
.wave-top,
.wave-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  line-height: 0;
  pointer-events: none;
}

.wave-top {
  top: -89px;
}

.wave-bottom {
  bottom: -89px;
}

.wave-top svg,
.wave-bottom svg {
  display: block;
  width: 100%;
  height: 90px;
}

.wave-bottom svg {
  transform: rotate(180deg);
}

/* --- Hero --- */
.hero {
  overflow: hidden;
  background-image:
    linear-gradient(to bottom right,
      color-mix(in oklab, var(--cream) 75%, transparent),
      color-mix(in oklab, var(--background) 70%, transparent)),
    url('/assets/headBackground.jpg');
  background-size: 120%;
  background-position: right 80% bottom 55%;
  background-repeat: no-repeat;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.eyebrow span {
  color: #788538;
  font-size: clamp(1.5rem, 2vw, 4rem);
  font-weight: 400;
  margin: 0px;
}

.hero-logo {
  height: auto;
  aspect-ratio: 1502 / 455;
  margin-top: 2rem;
  margin-bottom: 2rem;
  max-width: 60%;
}

.lead {
  color: black;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

/* --- Padding de secciones --- */
.hero {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.servicios {
  padding-top: 3rem;
  padding-bottom: 6rem;
}

.planes {
  padding-top: 1rem;
  padding-bottom: 5rem;
}

.equipo,
.porqueElegirnos,
.testimonios,
.contacto {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.sobre {
  padding-top: 5rem;
  padding-bottom: 0rem;
}

.section-tint {
  background: color-mix(in oklab, var(--secondary) 40%, transparent);
}

.section-header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 3rem;
}

.section-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-header h2 {
  font-size: 3rem;
  font-weight: 800;
}

/* --- Servicios --- */
.cards-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, 1fr);
}

.card {
  display: flex;
  border-radius: 1.5rem;
  background: var(--card);
  color: var(--foreground);
  padding: 1.5rem;
}

.card-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 4rem;
  min-width: 4rem;
  border-radius: 1rem;
  background: var(--secondary);
  border: 2px solid var(--border);
  margin-right: 1rem;
}

.card-icon-img {
  height: auto;
  width: 3rem;
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.card p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* --- Planes de salud (tarjetas de la portada) --- */
.campaign-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  max-width: 70rem;
  margin: 0 auto;
}

.campaign-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  border-radius: 1.5rem;
  background: var(--card);
  padding: 1rem;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
  color: var(--foreground);
  text-decoration: none;
  height: 100%;
}

.campaign-card:hover {
  transform: scale(1.03);
  background: var(--background);
}

.campaign-card:hover .campaign-cta {
  background: white;
}

.campaign-img {
  border-radius: 20px;
  margin-bottom: 1rem;
}

.campaign-body {
  flex: 1;
}

.campaign-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.campaign-card p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.campaign-cta {
  background: var(--background);
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: bold;
  font-size: 0.7rem;
  color: var(--primary);
  padding: 0.3rem 0.5rem;
  border-radius: 9999px;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
  animation: llamarAtencion 2s ease-in-out 1s infinite;
  transition: all 0.2s ease;
}

/* --- Sobre --- */
.about-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  text-align: center;
  color: var(--foreground);
}

.about-copy h2 {
  font-size: 3rem;
  font-weight: 800;
}

/* --- Galería (carrusel de la portada) --- */
.gallery {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.gallery-viewport {
  overflow: hidden;
  flex: 1;
}

.gallery-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.4s ease;
}

.gallery-item {
  /* 3 fotos por fila en escritorio */
  flex: 0 0 calc((100% - 2rem) / 3);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 1rem;
  border: 2px solid var(--border);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  transition: all 0.5s ease;
}

.gallery-item:hover {
  border: 2px solid var(--primary);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.btn-full-gallery {
  padding: 0.5rem;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-full-gallery:hover {
  background-color: var(--primary);
  color: var(--background);
}

.gallery-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  height: 2.75rem;
  width: 2.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-arrow:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.gallery-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery-arrow:disabled:hover {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}

.gallery-arrow svg {
  height: 1.25rem;
  width: 1.25rem;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.gallery-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 9999px;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-dot:hover {
  background: color-mix(in oklab, var(--primary) 40%, var(--border));
}

.gallery-dot.active {
  background: var(--primary);
  width: 1.5rem;
}

.gallery-full-link-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* --- Equipo --- */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.team-card {
  border-radius: 1.5rem;
  background: var(--card);
  border: 2px solid var(--border);
  overflow: hidden;
  width: 260px;
}

.team-photo {
  aspect-ratio: 4 / 5;
  border-bottom: 2px solid var(--border);
  overflow: hidden;
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-info {
  padding: 1.25rem;
}

.team-info h3 {
  font-weight: 700;
}

.team-info p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.team-card-trigger {
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.team-card-trigger:hover {
  transform: scale(1.03);
}

.team-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
}

.team-modal[hidden] {
  display: none;
}

.team-modal-card {
  position: relative;
  background: var(--card);
  border-radius: 1.5rem;
  max-width: 70rem;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: teamFadeIn 0.35s ease;
}

.team-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 9999px;
  border: none;
  background: var(--secondary);
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.2s;
}

.team-modal-close:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

.team-modal-close svg {
  height: 1.1rem;
  width: 1.1rem;
}

.team-modal-photo {
  width: 10rem;
  height: 12rem;
  border-radius: 10px;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 2px solid var(--border);
}

.team-modal-panel {
  text-align: center;
}

.team-modal-panel h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

.team-modal-role {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.team-modal-bio {
  margin-top: 1.5rem;
  text-align: left;
  color: var(--foreground);
  line-height: 1.6;
}

.team-modal-bio p {
  margin-bottom: 0.75rem;
}

/* La biografía corta solo se despliega en escritorio con ratón (efecto acordeón) */
.team-bio-short {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 800px) {

  .team-grid {
    flex-wrap: nowrap;
    width: fit-content;
    margin: 0 auto;
  }

  .team-card-trigger {
    flex: 0 0 260px;
    height: 422px;
    overflow: hidden;
    transition: flex-basis 0.4s ease, opacity 0.3s ease;
  }

  .team-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
    width: 100%;
  }

  /* Columna fija: foto + título, exactamente como en reposo */
  .team-card-main {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
  }

  .team-bio-short {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    color: var(--foreground);
    line-height: 1.6;
    font-size: 0.9rem;
    border-left: 2px solid var(--border);
    white-space: nowrap;
    transition: width 0.4s ease, opacity 0.3s ease, padding 0.4s ease;
  }

  /* Al entrar el ratón en el grupo, todas se encogen a una tira */
  .team-grid:hover .team-card-trigger {
    flex-basis: 70px;
    opacity: 0.4;
  }

  /* La que está en hover crece lo justo para caber: columna + acordeón */
  .team-grid .team-card-trigger:hover {
    flex-basis: min(90vw, 620px);
    opacity: 1;
  }

  .team-grid .team-card-trigger:hover .team-bio-short {
    width: min(50vw, 340px);
    opacity: 1;
    padding: 1.5rem;
    white-space: normal;
  }

  .team-bio-short p:first-child {
    margin-top: auto;
  }

  .btn-ver-mas {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-weight: 700;
    color: var(--primary);
  }

  .btn-ver-mas::after {
    transition: transform 0.2s ease;
  }

  .team-card-trigger:hover .btn-ver-mas::after {
    transform: translateX(3px);
  }

}

/* --- Por qué elegirnos --- */
.why-title {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
}

.why-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 3rem;
}

.why-item {
  text-align: center;
}

.why-icon {
  margin: 0 auto;
  display: grid;
  place-items: center;
  height: 3.5rem;
  width: 3.5rem;
  border-radius: 1rem;
  background: color-mix(in oklab, var(--primary-foreground) 15%, transparent);
  backdrop-filter: blur(4px);
}

.why-icon svg {
  height: 1.5rem;
  width: 1.5rem;
}

.why-item h3 {
  margin-top: 1rem;
  font-weight: 700;
}

.why-item p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* --- Testimonios ---
   Sección pendiente de reseñas reales: el HTML está comentado en la portada.
   Al descomentarlo, descomentar también este bloque.

.testimonials-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}
.testimonial {
  border-radius: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.testimonial .quote {
  margin-top: 1rem;
  color: var(--muted-foreground);
  font-style: italic;
}
.testimonial .author {
  margin-top: 1rem;
  font-weight: 700;
  font-size: 0.875rem;
}
--- */

/* --- Contacto --- */
.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
}

.contact-card {
  border-radius: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--input);
  background: var(--background);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  transition: all 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 20%, transparent);
}

.field textarea {
  resize: vertical;
}

.form-status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.form-status.success {
  color: var(--primary);
}

.form-status.error {
  color: oklch(0.6 0.22 25);
}

.btn-primary:disabled {
  background: color-mix(in oklab, var(--primary) 35%, var(--background));
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

.btn-primary:disabled:hover {
  transform: none;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  cursor: pointer;
  line-height: 1.4;
}

.consent input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.consent a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

.info-card {
  display: flex;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.info-icon {
  margin-right: 1rem;
  border: 2px solid var(--border);
  min-width: 2.5rem;
}

.info-card .info-icon {
  display: grid;
  place-items: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 0.75rem;
  background: var(--secondary);
  color: var(--primary);
}

.info-card .info-icon svg {
  height: 1.25rem;
  width: 1.25rem;
}

.info-card .info-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.info-card .info-value {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.map-link {
  position: relative;
  display: block;
  transition: all 0.3s ease;
}

.map-link:hover {
  transform: scale(1.01);
}

.map-link:hover .googleMapsScreenshot {
  border: 2px solid var(--primary);
}

.masInfo-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  align-items: center;
  background: #ffffff;
  color: #4a80f5;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  pointer-events: none;
  border: 1px solid #4a80f5;
}

.googleMapsScreenshot {
  border-radius: 1.5rem;
  overflow: hidden;
  border: 2px solid var(--border);
  width: 100%;
  height: auto;
  aspect-ratio: 1929 / 809;
  box-shadow: 1px 1px 1px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.map-embed {
  margin-top: 2rem;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 2px solid var(--border);
  height: 30rem;
  width: 100%;
  box-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}


.map-consent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  padding: 2rem;
  text-align: center;
  background: color-mix(in oklab, var(--secondary) 55%, var(--background));
  color: var(--foreground);
}

.map-consent-icon {
  height: 2.5rem;
  width: 2.5rem;
  color: var(--primary);
}

.map-consent-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.map-consent-text {
  max-width: 34rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.map-consent-text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.map-consent-note {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* ============================================================================
   TABLET — de 640px a 1149px
   ============================================================================ */
@media (max-width: 1149px) {

  .section-header h2 {
    font-size: 2.5rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 900px) {

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .card {
    justify-self: center;
    width: 70%;
  }

  .gallery-item {
    flex: 0 0 calc((100% - 1rem) / 2);
  }

}

/* ============================================================================
   SMARTPHONE — hasta 639px
   ============================================================================ */
@media (max-width: 639px) {

  .wave-top {
    top: -59px;
  }

  .wave-bottom {
    bottom: -59px;
  }

  .wave-top svg,
  .wave-bottom svg {
    height: 60px;
  }

  .hero {
    background-size: 200%;
    background-position: right 45% bottom 35%;
  }

  .hero-logo {
    max-width: 70%;
  }

  .lead {
    font-size: 0.8rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .card {
    width: 100%;
  }

  .campaign-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .gallery-item {
    flex: 0 0 100%;
  }

  .why-title {
    font-size: 2rem;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 1.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .masInfo-badge {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

}

/* ============================================================================
   AVISO DE INAUGURACIÓN — TEMPORAL
   Para retirarlo: borrar este bloque, el <div class="aviso"> de index.html y
   de en/index.html, y la llamada a setupAviso() en js/app.js.
   ============================================================================ */
.aviso {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 1rem;
}

.aviso[hidden] {
  display: none;
}

.aviso-card {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 26rem;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: teamFadeIn 0.35s ease;
}

.aviso-cartel {
  display: block;
  width: 100%;
  height: auto;
  background: var(--cream);
  border-radius: 1.5rem 1.5rem 0 0;
}

.aviso-cuerpo {
  padding: 1.5rem;
  text-align: center;
}

.aviso-fecha {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.aviso-cuerpo h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 0.35rem;
  margin-bottom: 1rem;
}

.aviso-cuerpo p + p {
  margin-top: 0.75rem;
}

.aviso-cuerpo .aviso-texto {
  font-size: 0.925rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.aviso-cta {
  margin-top: 1.25rem;
}

.aviso-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 2.25rem;
  width: 2.25rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.2s;
}

.aviso-close:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

.aviso-close svg {
  height: 1.1rem;
  width: 1.1rem;
}

@media (min-width: 760px) {
  .aviso-card {
    grid-template-columns: auto minmax(0, 30rem);
    align-items: center;
    width: fit-content;
    max-width: 95vw;
    max-height: 92vh;
  }

  .aviso-cartel {
    width: auto;
    height: min(86vh, 44rem);
    object-fit: contain;
    border-radius: 1.5rem 0 0 1.5rem;
  }

  .aviso-cuerpo {
    padding: 2rem;
  }
}
