/* ---------- Galería: carrusel 3D ---------- */
.gx-section { position: relative; overflow: hidden; isolation: isolate; }
.gx-ambient { position: absolute; inset: -10%; z-index: -1; background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.4); opacity: .28; transition: background-image .8s ease, opacity .8s ease; pointer-events: none; }
[data-theme="dark"] .gx-ambient { opacity: .22; }

.gx { position: relative; height: clamp(300px, 46vw, 460px); perspective: 1400px; margin-top: 8px; outline: none; touch-action: pan-y; user-select: none; }
.gx-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.gx-card { position: absolute; top: 50%; left: 50%; width: min(78vw, 440px); aspect-ratio: 4 / 3; margin: 0;
  transform: translate(-50%, -50%); border-radius: 18px; background: #fff; padding: 10px; cursor: pointer;
  box-shadow: 0 20px 50px rgba(15, 44, 76, .25); border: 1px solid rgba(255,255,255,.6);
  transition: transform .75s cubic-bezier(.2,.8,.2,1), opacity .6s ease, filter .6s ease, box-shadow .6s ease;
  -webkit-box-reflect: below 10px linear-gradient(transparent 70%, rgba(255,255,255,.18)); will-change: transform; }
.gx-card img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; pointer-events: none; }
.gx-card.is-active { box-shadow: 0 0 0 2px var(--gold), 0 24px 60px rgba(64,224,208,.35); cursor: zoom-in; }
.gx-card.is-active::after { content: ""; position: absolute; inset: -2px; border-radius: 20px; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; animation: gx-shine 3.2s ease-in-out infinite; mix-blend-mode: overlay; }
@keyframes gx-shine { 0% { background-position: 150% 0 } 60%, 100% { background-position: -100% 0 } }

.gx-btn { position: absolute; top: 50%; z-index: 20; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--text); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card-bg) 70%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow);
  transition: transform .25s, background .25s, color .25s; }
.gx-btn:hover { background: var(--gold); color: #06302C; transform: translateY(-50%) scale(1.08); }
.gx-prev { left: 0; } .gx-next { right: 0; }

.gx-info { text-align: center; margin-top: 18px; min-height: 3.2em; }
.gx-count { font: 700 .8rem var(--font-head); letter-spacing: .12em; color: var(--gold); }
.gx-caption { margin: 4px 0 0; font-weight: 600; color: var(--text); transition: opacity .3s; }
.gx-bar { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.gx-seg { width: 34px; height: 4px; border-radius: 4px; border: 0; padding: 0; cursor: pointer; background: var(--border); overflow: hidden; position: relative; }
.gx-seg i { position: absolute; inset: 0; width: 0; background: var(--gold); }
.gx-seg.done i { width: 100%; }
.gx-seg.run i { animation: gx-fill var(--gx-time, 4.5s) linear forwards; }
.gx.paused ~ .gx-bar .gx-seg.run i, .gx-bar.paused .gx-seg.run i { animation-play-state: paused; }
@keyframes gx-fill { to { width: 100% } }

/* Vista ampliada */
.gx-lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 90vh; overflow: visible; }
.gx-lightbox::backdrop { background: rgba(6, 16, 30, .82); backdrop-filter: blur(6px); }
.gx-lightbox img { display: block; max-width: 92vw; max-height: 80vh; border-radius: 14px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: gx-zoom .35s cubic-bezier(.2,.8,.2,1); }
.gx-lightbox p { color: #fff; text-align: center; margin: 12px 0 0; font-weight: 600; }
.gx-close { position: absolute; top: -16px; right: -16px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gold); color: #06302C; font-size: 1.4rem; line-height: 1; }
@keyframes gx-zoom { from { transform: scale(.9); opacity: 0 } to { transform: none; opacity: 1 } }

@media (max-width: 600px) {
  .gx-btn { width: 40px; height: 40px; }
  .gx-card { -webkit-box-reflect: unset; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-card, .gx-ambient { transition: none; }
  .gx-card.is-active::after { animation: none; }
}
