/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════
   WRAPPER & SLIDER BASE
══════════════════════════ */
.ph-wrapper {
  position: relative;
  width: 100vw;
  overflow: hidden;
  /* El JS posiciona el wrapper correctamente
     compensando el offset del contenedor padre */
}

.ph-slider {
  position: relative;
  width: 100%;
  height: 580px;
  font-family: 'Segoe UI', sans-serif;
  background: transparent;
}

/* ══════════════════════════
   TRACK & SLIDES
══════════════════════════ */
.ph-track {
  display: flex;
  gap: 16px;
  height: 100%;
  will-change: transform;
  transition: opacity 0.15s ease;
}

.ph-slide {
  flex: 0 0 88%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  /* brightness sincronizado con el transform del track */
  transition: filter 0.5s cubic-bezier(.4,0,.2,1);
  filter: brightness(0.55);
  will-change: filter;
}
.ph-slide.active {
  filter: brightness(1);
  transition: filter 0.5s cubic-bezier(.4,0,.2,1);
}

.ph-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 32px;
  transition: transform 6s ease;
  z-index: 0;
}

/* ── Overlay ── */
.ph-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 32px;
  pointer-events: none;
}

/* ══════════════════════════
   HOVER EFFECTS
══════════════════════════ */
.ph-hover-zoom .ph-slide.active img           { transform: scale(1.02); }
.ph-hover-zoom .ph-slide:not(.active) img     { transform: scale(1); }

.ph-hover-brightness .ph-slide img            { filter: brightness(0.85); }
.ph-hover-brightness .ph-slide.active img     { filter: brightness(1.1); }

.ph-hover-scale-down .ph-slide.active img     { transform: scale(0.97); }
.ph-hover-scale-down .ph-slide:not(.active) img { transform: scale(1); }

.ph-hover-none .ph-slide img { transform: none !important; }

/* ══════════════════════════
   CONTENT & POSICIONES
══════════════════════════ */
.ph-content {
  position: absolute;
  z-index: 2;
  padding: 40px 50px;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(12px);
  max-width: 70%;
}
.ph-slide.active .ph-content {
  opacity: 1;
  transform: translateY(0);
}

/* Posición: top */
.ph-pos-tl { top: 0; left: 0; text-align: left; }
.ph-pos-tc { top: 0; left: 50%; transform: translateX(-50%) !important; text-align: center; }
.ph-pos-tr { top: 0; right: 0; text-align: right; }
/* Posición: center */
.ph-pos-cl { top: 50%; left: 0; transform: translateY(-50%) !important; text-align: left; }
.ph-pos-cc { top: 50%; left: 50%; transform: translate(-50%,-50%) !important; text-align: center; }
.ph-pos-cr { top: 50%; right: 0; transform: translateY(-50%) !important; text-align: right; }
/* Posición: bottom */
.ph-pos-bl { bottom: 80px; left: 0; text-align: left; }
.ph-pos-bc { bottom: 80px; left: 50%; transform: translateX(-50%) !important; text-align: center; }
.ph-pos-br { bottom: 80px; right: 0; text-align: right; }

/* Override opacity para posiciones centradas activas */
.ph-slide.active .ph-pos-tc,
.ph-slide.active .ph-pos-cc,
.ph-slide.active .ph-pos-bc { opacity: 1; }
.ph-slide.active .ph-pos-cl,
.ph-slide.active .ph-pos-cr { opacity: 1; }

.ph-title {
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.ph-desc {
  color: rgba(255,255,255,0.9);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  margin-bottom: 18px;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.ph-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.3s, border-color 0.3s;
  text-transform: uppercase;
  cursor: pointer;
}
.ph-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.8);
  color: #fff;
  text-decoration: none;
}

/* ══════════════════════════
   NAVEGACIÓN
══════════════════════════ */
.ph-nav {
  position: absolute;
  bottom: 0;
  left: 6%; right: 6%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 24px;
  pointer-events: auto;
}

.ph-arrow {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 6px;
  transition: color 0.3s;
  flex-shrink: 0;
  outline: none !important;
  pointer-events: auto;
}
.ph-arrow:hover { color: #fff; }
.ph-arrow svg { display: block; width: 28px; height: auto; }

.ph-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  pointer-events: auto;
  z-index: 20;
}

.ph-dot {
  width: 20px; height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.35);
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 0;
  transition: width 0.3s, background 0.3s;
  pointer-events: auto;
}
.ph-dot.active { width: 32px; background: #fff; }
.ph-dot:focus { outline: none; box-shadow: none !important; }

.ph-progress {
  position: absolute;
  bottom: 0; left: 6%;
  height: 2px;
  background: rgba(255,255,255,0.6);
  width: 0%;
  z-index: 11;
  border-radius: 0 0 0 32px;
  max-width: 88%;
}

/* ══════════════════════════
   EFECTOS DE TRANSICIÓN
══════════════════════════ */

/* FADE */
.ph-effect-fade .ph-track { position: relative; }
.ph-effect-fade .ph-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease !important;
  flex: none; width: 88%; left: 6%;
}
.ph-effect-fade .ph-slide.active { opacity: 1; z-index: 2; }

/* ZOOM-IN */
.ph-effect-zoom-in .ph-slide img { transform: scale(1.15); transition: transform 0.6s ease; }
.ph-effect-zoom-in .ph-slide.active img { transform: scale(1); }

/* ZOOM-OUT */
.ph-effect-zoom-out .ph-slide img { transform: scale(0.9); transition: transform 0.6s ease; }
.ph-effect-zoom-out .ph-slide.active img { transform: scale(1); }

/* VERTICAL */
.ph-effect-vertical .ph-track { flex-direction: column; }

/* FLIP */
.ph-effect-flip .ph-wrapper { perspective: 1200px; }
.ph-effect-flip .ph-slide { transition: transform 0.8s ease, filter 0.5s ease !important; transform-style: preserve-3d; }
.ph-effect-flip .ph-slide:not(.active) { transform: rotateY(-25deg) scale(0.92); }
.ph-effect-flip .ph-slide.active { transform: rotateY(0deg) scale(1); }

/* KEN BURNS */
.ph-effect-kenburns .ph-slide.active img {
  animation: ph-kenburns 8s ease-in-out infinite alternate;
}
@keyframes ph-kenburns {
  0%   { transform: scale(1)    translate(0, 0); }
  100% { transform: scale(1.12) translate(-3%, -2%); }
}

/* BLUR */
.ph-effect-blur .ph-slide img { filter: blur(4px); transition: filter 0.6s ease; }
.ph-effect-blur .ph-slide.active img { filter: blur(0); }

/* CUBE */
.ph-effect-cube .ph-wrapper { perspective: 1400px; }
.ph-effect-cube .ph-slide {
  transition: transform 0.9s cubic-bezier(.4,0,.2,1), filter 0.5s ease !important;
  transform-style: preserve-3d;
  transform-origin: left center;
}
.ph-effect-cube .ph-slide:not(.active) { transform: rotateY(-90deg) scale(0.85); }
.ph-effect-cube .ph-slide.active { transform: rotateY(0deg) scale(1); }

/* ══════════════════════════
   RESPONSIVE
══════════════════════════ */
@media (max-width: 1024px) {
  .ph-slide { border-radius: 24px; }
  .ph-slide img, .ph-overlay { border-radius: 24px; }
  .ph-content { padding: 30px 36px; }
}

/* ── Móvil: alto proporcional 16:9 ──
   El height fijo del admin se ignora en móvil
   y el slider se adapta al ancho de pantalla  */
@media (max-width: 767px) {
  .ph-slider {
    height: auto !important;
    aspect-ratio: 16 / 9;
  }
  .ph-slide {
    height: 100%;
    flex: 0 0 86%;
    border-radius: 20px;
  }
  .ph-slide img, .ph-overlay { border-radius: 20px; }
  .ph-track { gap: 12px; height: 100%; }
  .ph-content { padding: 16px 24px; max-width: 85%; }
  .ph-nav { left: 7%; right: 7%; padding: 0 18px 18px; }
  .ph-arrow svg { width: 22px; }
  .ph-progress { left: 7%; max-width: 86%; }
}
@media (max-width: 480px) {
  .ph-slide { flex: 0 0 90%; border-radius: 14px; }
  .ph-slide img, .ph-overlay { border-radius: 14px; }
  .ph-track { gap: 8px; }
  .ph-content { padding: 12px 16px; max-width: 92%; }
  .ph-nav { left: 5%; right: 5%; padding: 0 12px 14px; }
  .ph-progress { left: 5%; max-width: 90%; }
  .ph-title { font-size: 1rem !important; }
  .ph-desc  { font-size: 0.78rem !important; }
  .ph-btn   { font-size: 11px !important; padding: 8px 16px !important; }
}


/* ══════════════════════════════════════════
   FIX ELEMENTOR — overflow visible en padres
══════════════════════════════════════════ */
.elementor-widget-shortcode,
.elementor-widget-shortcode .elementor-widget-container,
.elementor-column-wrap,
.elementor-widget-wrap,
.elementor-column,
.e-con,
.e-con-inner {
  overflow: visible !important;
}

/* Editor preview: se ve contenido pero funcional */
.elementor-editor-active .ph-wrapper {
  width: 100% !important;
  left: auto !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  overflow: hidden !important;
}
.elementor-editor-active .ph-slider {
  width: 100% !important;
}
