/* ============================================================
   MYM ODONTOLOGÍA — Estilos de la página de Servicios
   Requiere: variables.css, global.css, components.css
   Nota: .section-header se define aquí de forma autocontenida
   (en el Home vive en home.css). Candidata a promoverse a
   components.css como componente global en una limpieza futura.
   ============================================================ */

/* ----------------------------------------------------------
   HERO INTERNO + BREADCRUMB
   ---------------------------------------------------------- */
.servicios-hero {
  padding-top: calc(var(--nav-height) + var(--space-10));
}

.servicios-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, var(--text-5xl));
  line-height: 1.1;
  margin-block: var(--space-3) var(--space-4);
}

.servicios-lead {
  max-width: 540px;
  font-size: var(--text-lg);
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text-hero-subtitle);
}

/* ----------------------------------------------------------
   ENCABEZADO DE SECCIÓN (autocontenido en esta página)
   ---------------------------------------------------------- */
.section-header {
  max-width: 760px;
  margin: 0 auto var(--space-10);
  text-align: center;
}

.section-header .text-caps {
  display: inline-block;
  margin-bottom: var(--space-3);
  color: var(--color-accent);
  letter-spacing: var(--tracking-caps);
}

.section-header h2 {
  max-width: 720px;
  margin-top: 0;
  line-height: 1.1;
}

/* ----------------------------------------------------------
   FILTRO POR CATEGORÍA (pills)
   ---------------------------------------------------------- */
.service-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}

.service-filter .btn {
  padding: 10px 20px;
  font-size: var(--text-sm);
}

/* ----------------------------------------------------------
   GRID + TARJETAS DE SERVICIO (blancas, acento dorado — handoff)
   ---------------------------------------------------------- */
.service-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 1 calc((100% - 2 * var(--space-6)) / 3);
  min-width: 0;
  min-height: 360px; /* con aire, y suficiente para que el panel muestre todo su contenido */
  gap: var(--space-3);
  padding: var(--space-8) var(--space-7);
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-arch);
  box-shadow: var(--shadow-card);
  overflow: hidden; /* contiene el lavado dorado superior */
  transition: var(--transition-card);
  animation: service-card-in 0.35s var(--ease-out-strong) backwards;
}

/* Lavado dorado superior: profundidad que "respira" con el hover
   (eco del halo del hero — nada de tarjetas planas) */
.service-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 130px;
  background: radial-gradient(130% 100% at 50% 0%, rgba(201, 169, 110, 0.12), transparent 72%);
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.service-card:hover::before {
  opacity: 1;
}

/* Cabecera: ícono + chip de categoría */
.service-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.service-card__cat {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-gold-text-on-light);
  background-color: rgba(201, 169, 110, 0.10);
  border: 1px solid rgba(201, 169, 110, 0.30);
  border-radius: var(--radius-pill);
}

/* Círculo con ícono de línea dorado + anillo fino (joyería sutil) */
.service-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(160deg, rgba(201, 169, 110, 0.18), rgba(201, 169, 110, 0.07));
  border: 1px solid rgba(201, 169, 110, 0.30);
  color: var(--color-accent);
  transition: transform 0.35s var(--ease-out-strong), background-color 0.35s ease, border-color 0.35s ease;
}

.service-card__icon svg {
  width: 28px;
  height: 28px;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(201, 169, 110, 0.45);
}

.service-card:hover .service-card__icon {
  transform: scale(1.08) translateY(-2px);
  background-color: rgba(201, 169, 110, 0.24);
  border-color: rgba(201, 169, 110, 0.55);
}

/* El atributo [hidden] del filtro debe ganarle al display:flex de la tarjeta */
.service-card[hidden] {
  display: none;
}

.service-card h3 {
  position: relative;
  padding-bottom: var(--space-3);
  font-size: var(--text-xl);
  line-height: 1.3;
}

/* Hairline dorada bajo el título: crece al hover (detalle firma) */
.service-card h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-accent), rgba(201, 169, 110, 0.25));
  transition: width 300ms var(--ease-out-strong);
}

.service-card:hover h3::after {
  width: 64px;
}

.service-card p {
  color: var(--color-text-body-light);
  line-height: 1.65;
}

/* Entrada escalonada: cascada breve, nunca bloqueante (30-80ms por ítem) */
.service-grid .service-card:nth-child(1) { animation-delay: 0ms; }
.service-grid .service-card:nth-child(2) { animation-delay: 45ms; }
.service-grid .service-card:nth-child(3) { animation-delay: 90ms; }
.service-grid .service-card:nth-child(4) { animation-delay: 135ms; }
.service-grid .service-card:nth-child(5) { animation-delay: 180ms; }
.service-grid .service-card:nth-child(6) { animation-delay: 225ms; }
.service-grid .service-card:nth-child(7) { animation-delay: 270ms; }
.service-grid .service-card:nth-child(8) { animation-delay: 315ms; }
.service-grid .service-card:nth-child(9) { animation-delay: 360ms; }

.service-card__benefits {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
  list-style: none;
}

.service-card__benefits li {
  position: relative;
  padding-left: var(--space-6);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-body-light);
}

.service-card__benefits li::before {
  content: '\2713'; /* check */
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* Invitación sutil anclada al fondo de la tarjeta compacta */
.service-card__hint {
  margin-top: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-gold-text-on-light);
  opacity: 0.85;
}

/* ----------------------------------------------------------
   REVELADO — panel navy que sube al hover / focus (teclado).
   Solo transform/opacity: GPU, cero salto de layout en vecinas.
   El contenido queda siempre en el DOM (SEO intacto).
   ---------------------------------------------------------- */
.service-card__reveal {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: linear-gradient(165deg, #12233b 0%, var(--color-bg-dark) 100%);
  overflow-y: auto; /* red de seguridad: si el texto no cabe, se desplaza — nunca se corta */
  transform: translateY(103%);
  transition: transform 380ms var(--ease-out-strong);
}

.service-card:hover .service-card__reveal,
.service-card:focus-within .service-card__reveal {
  transform: translateY(0);
}

/* Contenido interno: cascada breve al abrirse el panel */
.service-card__reveal > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 250ms ease, transform 300ms var(--ease-out-strong);
}

.service-card:hover .service-card__reveal > *,
.service-card:focus-within .service-card__reveal > * {
  opacity: 1;
  transform: none;
}

.service-card:hover .service-card__reveal > :nth-child(1),
.service-card:focus-within .service-card__reveal > :nth-child(1) { transition-delay: 90ms; }
.service-card:hover .service-card__reveal > :nth-child(2),
.service-card:focus-within .service-card__reveal > :nth-child(2) { transition-delay: 150ms; }
.service-card:hover .service-card__reveal > :nth-child(3),
.service-card:focus-within .service-card__reveal > :nth-child(3) { transition-delay: 210ms; }
.service-card:hover .service-card__reveal > :nth-child(4),
.service-card:focus-within .service-card__reveal > :nth-child(4) { transition-delay: 270ms; }

.service-card__reveal .service-card__reveal-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-display);
  color: var(--color-accent);
}

.service-card__reveal .service-card__desc {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text-muted-dark);
}

.service-card__reveal .service-card__benefits {
  gap: var(--space-1);
}

.service-card__reveal .service-card__benefits li {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-muted-dark);
}

.service-card__cta {
  align-self: stretch;
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  justify-content: flex-start;
  font-size: var(--text-sm);
  color: var(--color-accent); /* dorado sobre navy: 6.25:1 ✓ */
  font-weight: 600;
}

.service-card__cta:hover,
.service-card__cta:focus-visible {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   TÁCTIL — sin cursor no hay hover: la tarjeta muestra todo su
   contenido en flujo normal (vuelve al esquema claro).
   ---------------------------------------------------------- */
@media (hover: none) {
  .service-card {
    min-height: 0;
  }

  .service-card__hint {
    display: none;
  }

  .service-card__reveal {
    position: static;
    padding: 0;
    background: none;
    transform: none;
  }

  .service-card__reveal > * {
    opacity: 1;
    transform: none;
  }

  .service-card__reveal-title {
    display: none; /* el h3 ya está visible arriba */
  }

  .service-card__reveal .service-card__desc,
  .service-card__reveal .service-card__benefits li {
    color: var(--color-text-body-light);
  }

  .service-card__cta {
    border-top-color: rgba(13, 24, 40, 0.07);
    color: var(--color-gold-text-on-light);
  }
}

@keyframes service-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Estado vacío / error del grid (versión base; se unifica en Paso 12) */
.service-empty {
  grid-column: 1 / -1;
  padding: var(--space-8) 0;
  text-align: center;
  color: var(--color-text-meta-light);
}

/* ----------------------------------------------------------
   PROCESO DE TRABAJO (timeline)
   ---------------------------------------------------------- */
.proceso-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
  list-style: none;
}

.proceso-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.proceso-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  color: var(--color-bg-dark);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  box-shadow: var(--shadow-gold);
}

/* Línea conectora entre pasos (solo desktop) */
.proceso-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 26px;
  left: calc(50% + 34px);
  width: calc(100% - 68px);
  height: 2px;
  background-color: var(--color-border-dark);
}

.proceso-step h3 {
  font-size: var(--text-lg);
}

.proceso-step p {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-body-light);
}

/* ----------------------------------------------------------
   FAQ — acordeón nativo (<details> / <summary>)
   ---------------------------------------------------------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq__item {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--color-text-dark);
}

/* Oculta el marcador por defecto del <summary> */
.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: '+';
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: var(--text-2xl);
  line-height: 1;
}

.faq__item[open] .faq__question::after {
  content: '\2212'; /* signo menos */
}

.faq__answer {
  padding: 0 var(--space-6) var(--space-5);
}

/* Al abrir un <details>, el contenido salta seco: se suaviza con un
   fade + deslizamiento corto del contenido (animar height requeriría JS). */
.faq__item[open] .faq__answer {
  animation: faq-answer-in 200ms var(--ease-out-strong);
}

@keyframes faq-answer-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.faq__answer p {
  color: var(--color-text-body-light);
  line-height: 1.7;
}

/* ----------------------------------------------------------
   CTA FINAL
   ---------------------------------------------------------- */
.servicios-cta {
  text-align: center;
}

.servicios-cta h2 {
  margin-bottom: var(--space-4);
}

.servicios-cta .servicios-lead {
  max-width: 560px;
  margin-inline: auto;
}

.servicios-cta__actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ----------------------------------------------------------
   FINANCIACIÓN (convenio Welli)
   ---------------------------------------------------------- */
.servicios-hero__financiacion {
  display: inline-block;
  margin-top: var(--space-4);
}

.financiacion {
  scroll-margin-top: calc(var(--nav-height) + var(--space-6));
}

.financiacion__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-10);
  align-items: center;
}

.financiacion__intro h2 {
  color: var(--color-text-light);
}

.financiacion__lead {
  margin-bottom: var(--space-6);
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--color-text-muted-dark);
}

.financiacion__facts {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-7);
  padding: 0;
  list-style: none;
}

.financiacion__facts li {
  position: relative;
  padding-left: var(--space-6);
  color: var(--color-text-light);
}

.financiacion__facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
}

.financiacion__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}

.financiacion__panel {
  padding: var(--space-8);
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-arch);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.financiacion__logo {
  display: block;
  max-width: 130px;
  height: auto;
  margin: 0 auto var(--space-5);
}

.financiacion__panel h3 {
  margin-bottom: var(--space-5);
}

.financiacion__steps {
  display: grid;
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  text-align: left;
}

.financiacion__steps li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.financiacion__steps li span {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: rgba(201, 169, 110, 0.14);
  color: var(--color-gold-text-on-light);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.financiacion__steps li p {
  margin: 0;
  line-height: 1.5;
  color: var(--color-text-body-light);
}

.financiacion__nota {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-meta-light);
  text-align: left;
}

@media (max-width: 860px) {
  .financiacion__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 900px) {
  .service-card {
    flex-basis: calc((100% - var(--space-6)) / 2);
  }

  .proceso-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8);
  }

  .proceso-step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .service-card {
    flex-basis: 100%;
  }

  .proceso-steps {
    grid-template-columns: 1fr;
  }
}
