/* =========================================================
   Guía dental — secciones con foto, uniones difuminadas e interacción
   ========================================================= */
.g-main { background: #0E2148; --fade: 200px; --overlap: 55px; }

/* ---------- Secciones con foto ---------- */
.g-photo { position: relative; min-height: 100svh; isolation: isolate; color: #fff; }
.g-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.g-bg img { width: 100%; height: 100%; object-fit: cover; }
/* Uniones difuminadas (≈200px): cada foto se disuelve en el azul de fondo y la
   siguiente aparece desde él, con un solape corto para que el paso sea suave. */
.g-photo + .g-photo { margin-top: calc(var(--overlap) * -1); }
.g-s1 .g-bg {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--fade)), rgba(0,0,0,.6) calc(100% - var(--fade) * .55), rgba(0,0,0,.2) calc(100% - var(--fade) * .2), transparent 100%);
          mask-image: linear-gradient(180deg, #000 calc(100% - var(--fade)), rgba(0,0,0,.6) calc(100% - var(--fade) * .55), rgba(0,0,0,.2) calc(100% - var(--fade) * .2), transparent 100%);
}
.g-s2 .g-bg, .g-s3 .g-bg {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.2) calc(var(--fade) * .2), rgba(0,0,0,.6) calc(var(--fade) * .55), #000 var(--fade), #000 calc(100% - var(--fade)), rgba(0,0,0,.6) calc(100% - var(--fade) * .55), rgba(0,0,0,.2) calc(100% - var(--fade) * .2), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.2) calc(var(--fade) * .2), rgba(0,0,0,.6) calc(var(--fade) * .55), #000 var(--fade), #000 calc(100% - var(--fade)), rgba(0,0,0,.6) calc(100% - var(--fade) * .55), rgba(0,0,0,.2) calc(100% - var(--fade) * .2), transparent 100%);
}
/* La última foto se disuelve hacia el fondo claro de la sección 4 */
.g-s3 { background: linear-gradient(180deg, transparent calc(100% - var(--fade) - 20px), #F4F8FB 100%); }

.glass {
  background: rgba(11, 42, 91, .58);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 22px;
  box-shadow: 0 20px 50px rgba(4, 14, 36, .28);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(11, 42, 91, .92); }
}

.g-title { color: #fff; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.02em; margin: 0 0 10px; }
.g-title--sm { font-size: clamp(24px, 2vw, 30px); margin-bottom: 18px; }

/* ---------- Sección 1: mitos ---------- */
.g-s1 .g-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,42,91,.55) 0%, rgba(11,42,91,.25) 40%, rgba(11,42,91,.35) 100%);
}
.g-s1__inner { padding-top: calc(var(--header-h) + clamp(32px, 6vh, 64px)); padding-bottom: 200px; text-align: center; }
.g-intro { max-width: 46rem; margin: 0 auto clamp(28px, 5vh, 52px); }
.g-intro h1 { color: #fff; font-size: clamp(36px, 4.2vw, 60px); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 10px; text-shadow: 0 2px 24px rgba(4,14,36,.35); }
.g-intro p:last-child { font-size: 18px; color: rgba(255,255,255,.9); margin: 0; }
.g-hint { color: rgba(255,255,255,.85); margin: 0 0 28px; }

.flip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); max-width: 72rem; margin: 0 auto; text-align: left; }
.flip { perspective: 1400px; }
.flip__inner {
  position: relative; display: grid; height: 100%; min-height: 300px;
  transform-style: preserve-3d; transition: transform .8s var(--ease);
}
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
@media (hover: hover) and (min-width: 900px) {
  .flip:hover .flip__inner { transform: rotateY(180deg); }
}
.flip__face {
  grid-area: 1 / 1; display: flex; flex-direction: column; gap: 14px; padding: 28px;
  border-radius: 22px; -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.flip__front {
  background: rgba(255, 255, 255, .94); color: var(--ink);
  box-shadow: 0 18px 44px rgba(4, 14, 36, .25);
}
.flip__back {
  transform: rotateY(180deg); color: #fff;
  background: linear-gradient(160deg, #1B34B8, #0B2A5B);
  box-shadow: 0 18px 44px rgba(4, 14, 36, .35);
}
.flip__back p { margin: 0; font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,.95); }
.flip__tag {
  align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; background: #FDE7EE; color: #A10F3F;
}
.flip__tag--real { background: rgba(255,255,255,.16); color: #fff; }
.flip__quote { font-size: clamp(20px, 1.6vw, 23px); line-height: 1.35; font-weight: 700; margin: 0; flex: 1; letter-spacing: -.01em; }
.flip__btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: auto;
  padding: 10px 18px; border-radius: 999px; border: 0; background: var(--blue); color: #fff; font-weight: 600; font-size: 14.5px;
  transition: background-color .25s;
}
.flip__btn svg { width: 16px; height: 16px; }
.flip__btn:hover { background: var(--blue-700); }
.flip__btn--back { background: #fff; color: var(--blue); }
.flip__btn--back:hover { background: #EEF2FD; }

/* ---------- Secciones 2 y 3: caja ancha centrada sobre la foto ---------- */
.g-s2, .g-s3 {
  display: flex; align-items: center; justify-content: center; min-height: 0;
  padding: calc(var(--fade) + 40px) 0;
}
.g-s2__box, .g-s3__box {
  position: relative; width: min(900px, 94%); margin: 0 auto;
  padding: clamp(24px, 2.6vw, 40px);
}
.g-s2__box { display: grid; grid-template-columns: minmax(250px, 310px) 1fr; column-gap: clamp(24px, 3vw, 40px); align-items: center; }
.g-s2__box > .g-title { grid-column: 1 / -1; }
.g-s2__box > .tabs { grid-column: 1; grid-row: 2; margin-bottom: 0; }
.g-s2__box > .tab-panel { grid-column: 2; grid-row: 2; min-height: 0; }
.g-s2__box > .tab-progress { grid-column: 1 / -1; grid-row: 3; margin-top: 22px; }
.g-s2__box .tab-panel p { font-size: 17.5px; line-height: 1.7; }
.tabs { display: grid; gap: 8px; margin-bottom: 18px; }
.tab {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06); color: #fff; font-weight: 600; font-size: 15px;
  transition: background-color .25s, border-color .25s, color .25s;
}
.tab svg { width: 22px; height: 22px; flex: none; color: #FF9BBD; }
.tab:hover { background: rgba(255,255,255,.14); }
.tab.is-active { background: #fff; color: var(--ink); border-color: #fff; }
.tab.is-active svg { color: var(--pink); }
.tab-panel { min-height: 140px; }
.tab-panel p { margin: 0; font-size: 16px; line-height: 1.65; color: rgba(255,255,255,.95); }
.tab-panel:not([hidden]) { animation: gFade .5s var(--ease); }
.tab-progress { display: flex; gap: 6px; margin-top: 16px; }
.tab-progress span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; position: relative; }
.tab-progress span.is-done { background: rgba(255,255,255,.75); }
.tab-progress span.is-run::after {
  content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left;
  animation: gBar var(--dur, 7s) linear forwards;
}
@keyframes gBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Sección 3: acordeón ---------- */
.g-s3__box .acc__btn { font-size: 17px; padding: 16px 2px; }
.g-s3__box .acc__panel p { font-size: 16px; max-width: 70ch; }
.acc__item { border-top: 1px solid rgba(255,255,255,.2); }
.acc__item:first-child { border-top: 0; }
.acc h3 { margin: 0; }
.acc__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 2px; background: none; border: 0; color: #fff; text-align: left;
  font-size: 16px; font-weight: 600; line-height: 1.35;
}
.acc__btn svg {
  width: 30px; height: 30px; padding: 6px; flex: none; border-radius: 50%;
  background: rgba(255,255,255,.14); transition: transform .35s var(--ease), background-color .25s;
}
.acc__btn:hover svg { background: rgba(255,255,255,.26); }
.acc__btn[aria-expanded="true"] svg { transform: rotate(45deg); background: var(--pink); }
.acc__panel p { margin: 0 0 16px; font-size: 15px; line-height: 1.65; color: rgba(255,255,255,.93); }
.acc__panel:not([hidden]) { animation: gFade .4s var(--ease); }

/* ---------- Sección 4: prevención (sin foto) ---------- */
.g-s4 { background: #F4F8FB; padding: clamp(56px, 8vw, 110px) 0 clamp(72px, 9vw, 120px); color: var(--text); }
.g-s4__head { max-width: 46rem; margin-bottom: 36px; }
.g-s4__head h2 { font-size: clamp(30px, 2.6vw, 38px); margin-bottom: 12px; }
.prev-table { background: #fff; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.prev-row {
  display: grid; grid-template-columns: 1.1fr 1.2fr 1.5fr 1fr; gap: 20px; align-items: center;
  padding: 20px 28px; border-top: 1px solid var(--line); transition: background-color .25s;
}
.prev-row:not(.prev-row--head):hover { background: #F6F8FE; }
.prev-row--head { border-top: 0; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding-top: 16px; padding-bottom: 16px; }
.prev-sit { font-weight: 700; color: var(--ink); }
.ok { font-weight: 600; color: #0F5E35; }
.prev-diff { display: flex; flex-direction: column; gap: 8px; }
.prev-diff em { font-style: normal; font-weight: 800; color: var(--pink-700); font-size: 18px; }
.bar { display: block; height: 8px; border-radius: 8px; background: #F1E3E9; overflow: hidden; }
.bar > i { display: block; height: 100%; width: calc(var(--lvl) * 100%); border-radius: 8px; background: linear-gradient(90deg, #F27AA2, var(--pink)); transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .2s; }
.prev-table.is-visible .bar > i { transform: scaleX(1); }
.prev-note { margin: 16px 4px 0; font-size: 14px; color: var(--muted); }

.g-cta {
  margin-top: clamp(40px, 5vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(26px, 3vw, 40px); border-radius: 24px; color: #fff;
  background: radial-gradient(120% 160% at 0% 0%, #2A46D6 0%, var(--blue) 45%, var(--navy) 100%);
}
.g-cta h3 { color: #fff; font-size: clamp(22px, 2vw, 28px); margin-bottom: 6px; }
.g-cta p { margin: 0; color: rgba(255,255,255,.88); }
.g-cta__wa { background: var(--wa); color: #fff; flex: none; }
.g-cta__wa:hover { background: var(--wa-hover); color: #fff; }

/* ---------- Índice lateral ---------- */
.g-dots { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 14px; }
.g-dots a { position: relative; display: block; width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.55); border: 2px solid var(--blue); transition: transform .25s, background-color .25s; }
.g-dots a.is-active { background: var(--pink); border-color: var(--pink); transform: scale(1.3); }
.g-dots span {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.g-dots a:hover span, .g-dots a:focus-visible span { opacity: 1; }

/* ---------- Revelado al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.flip-grid .flip:nth-child(2) { transition-delay: .12s; }
.flip-grid .flip:nth-child(3) { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .flip-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .g-dots { display: none; }
  .g-main { --fade: 150px; --overlap: 35px; }
  .g-s1__inner { padding-bottom: calc(var(--fade) + 24px); }
  .g-s2 .g-bg img { object-position: 60% 30%; }
  .g-s3 .g-bg img { object-position: 55% 30%; }
  .g-s2__box, .g-s3__box { background: rgba(11, 42, 91, .74); }
  .prev-row--head { display: none; }
  .prev-table { background: transparent; border: 0; box-shadow: none; display: grid; gap: 14px; }
  .prev-row { grid-template-columns: 1fr; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
  .prev-row > span[data-label]:not(.prev-sit)::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .prev-sit { font-size: 18px; }
  .g-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767px) {
  .g-s2__box { display: block; }
  .g-s2__box > .tabs { margin-bottom: 18px; }
  .g-s2__box .tab-panel p { font-size: 16px; }
  .g-s2__box > .tab-progress { margin-top: 16px; }
  .g-s3__box .acc__btn { font-size: 16px; }
  .g-s3__box .acc__panel p { font-size: 15px; }
}
@media (max-width: 640px) {
  .flip-grid { grid-template-columns: 1fr; }
  .flip__inner { min-height: 0; }
  .flip__face { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .flip__inner { transition: none; }
}
@media (hover: hover) and (min-width: 900px) {
  .flip.no-hover:hover .flip__inner { transform: none; }
  .flip.no-hover.is-flipped .flip__inner { transform: rotateY(180deg); }
}
