/* === Lemon Reveal Container Widget === */

/* Reset básico */
.lemon-curtain-container * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Contenedor principal del efecto cortina */
.lemon-curtain-container {
  position: relative;
  width: 100%;
  /* La altura se calculará dinámicamente con JavaScript */
}

/* MODO RESPONSIVE - FALLBACK SIMPLE Y LIMPIO */
.lemon-curtain-container.lemon-effect-disabled {
  height: auto !important;
  overflow: visible !important;
  position: relative !important;
  background: none !important;
}

.lemon-curtain-container.lemon-effect-disabled .lemon-curtain-viewport {
  display: none !important;
}

.lemon-curtain-container.lemon-effect-disabled .lemon-fallback-content {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

/* Contenido fallback - SIMPLE Y DIRECTO */
.lemon-fallback-content {
  display: none;
  width: 100%;
  background: #f8f9fa; /* Fondo por defecto */
}

.lemon-fallback-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: inherit;
}

.lemon-fallback-reveal {
  padding: 4rem 2rem;
  width: 100%;
  background: #ffffff; /* Fondo blanco para el contenido revelado */
}

/* Contenedor sticky que mantiene la vista durante el scroll - SOLO CUANDO ESTÁ ACTIVO */
.lemon-curtain-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Fondo principal */
.lemon-main-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  z-index: 1;
}

/* Overlay principal */
.lemon-main-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Contenido principal centrado - EXACTAMENTE IGUAL QUE EL EJEMPLO HTML */
.lemon-main-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.1s ease-out;
  text-align: center;
  z-index: 3;
}

/* Overlay para mejorar legibilidad del contenido principal - PERSONALIZABLE */
.lemon-content-overlay {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 2rem;
  border-radius: 12px;
  backdrop-filter: blur(5px);
}

/* Sin overlay para contenido principal */
.lemon-content-no-overlay {
  background: none !important;
  padding: 2rem;
  border-radius: 0;
  backdrop-filter: none !important;
}

/* Cortina deslizante - MEJORADA PARA ANCHO FIJO DEL CONTENIDO */
.lemon-curtain {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 0; /* Inicialmente cerrada */
  transition: width 0.1s ease-out;
  overflow: hidden; /* IMPORTANTE: Oculta el contenido que sobresale */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 4;
}

/* Overlay de la cortina */
.lemon-curtain-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

/* Contenedor del contenido de la cortina - MODIFICADO PARA ANCHO FIJO */
.lemon-curtain-content-wrapper {
  /* El ancho se establece dinámicamente con JavaScript */
  /* position: absolute; right: 0; top: 0; - se establece con JS */
  height: 100vh;
  overflow: hidden;
  z-index: 6;
}

/* Contenido interno de la cortina - ANCHO COMPLETO DENTRO DEL WRAPPER */
.lemon-curtain-content {
  position: absolute;
  top: 100vh; /* Inicialmente fuera de la vista, abajo */
  left: 0;
  width: 100%; /* 100% del wrapper, que ya tiene el ancho final */
  padding: 2rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  transition: top 0.1s ease-out;
  z-index: 7;
  /* El max-width se aplica desde los selectores de Elementor */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Sin overlay para contenido de cortina */
.lemon-curtain-content-no-overlay {
  background: none !important;
  backdrop-filter: none !important;
}

/* ESTILOS PARA FALLBACK - SIMPLES Y LIMPIOS */
/* Asegurar que los estilos de tipografía se mantengan en el modo fallback */
.lemon-fallback-content .lemon-main-title {
  text-shadow: none !important;
}

/* IMPORTANTE: Asegurar que los overlays se mantengan en el fallback */
.lemon-fallback-content .lemon-content-overlay {
  position: relative !important;
  /* NO sobrescribir background-color, padding, border-radius, backdrop-filter */
  /* Estos se aplicarán desde los selectores de Elementor */
}

.lemon-fallback-content .lemon-content-no-overlay {
  position: relative !important;
  background: none !important;
  backdrop-filter: none !important;
}

.lemon-fallback-content .lemon-curtain-content {
  position: relative !important;
  top: auto !important;
  /* NO sobrescribir background, padding, margin, backdrop-filter */
  /* Estos se aplicarán desde los selectores de Elementor */
}

/* Eliminar todos los estilos que sobrescriben la tipografía */
.lemon-fallback-content .lemon-main-title,
.lemon-fallback-content .lemon-main-content-text,
.lemon-fallback-content .lemon-curtain-content h1,
.lemon-fallback-content .lemon-curtain-content h2,
.lemon-fallback-content .lemon-curtain-content h3,
.lemon-fallback-content .lemon-curtain-content h4,
.lemon-fallback-content .lemon-curtain-content h5,
.lemon-fallback-content .lemon-curtain-content h6,
.lemon-fallback-content .lemon-curtain-content p {
  /* SOLO herencia - sin colores forzados */
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* Colores por defecto SOLO cuando no hay estilos de Elementor */
.lemon-curtain-content {
  color: #ffffff; /* Color por defecto solo si no se especifica otro */
}

.lemon-fallback-content .lemon-curtain-content {
  color: #333333; /* Color por defecto para fallback solo si no se especifica otro */
}

/* Estilos para el contenido - COLORES HEREDADOS DE ELEMENTOR */
.lemon-main-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  /* Color removido - se hereda de Elementor */
}

.lemon-main-content-text {
  font-size: 1.2rem;
  line-height: 1.6;
  /* Color removido - se hereda de Elementor */
}

/* Estilos para contenido de cortina - COLORES HEREDADOS DE ELEMENTOR */
.lemon-curtain-content h1,
.lemon-curtain-content h2,
.lemon-curtain-content h3,
.lemon-curtain-content h4,
.lemon-curtain-content h5,
.lemon-curtain-content h6 {
  margin-bottom: 1rem;
  /* Color removido - se hereda de Elementor */
}

.lemon-curtain-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.lemon-curtain-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.lemon-curtain-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  /* Color removido - se hereda de Elementor */
}

/* FALLBACK - Solo mantener estructura, NO colores */
.lemon-fallback-content .lemon-main-title {
  text-shadow: none;
  /* Todos los !important de color removidos */
}

/* Vista en el editor de Elementor */
.lemon-reveal-editor-mode {
  height: auto !important;
  min-height: 60vh;
}

.lemon-reveal-editor-mode .lemon-curtain-viewport {
  position: relative !important;
  display: flex !important;
  overflow: visible !important;
}

.lemon-reveal-editor-mode .lemon-main-content {
  position: relative !important;
  width: 50% !important;
  height: auto !important;
  min-height: 400px;
  flex: 0 0 50%;
}

.lemon-reveal-editor-mode .lemon-curtain {
  position: relative !important;
  width: 50% !important;
  height: auto !important;
  min-height: 400px;
  flex: 0 0 50%;
  overflow: visible !important;
  transition: none !important;
}

.lemon-reveal-editor-mode .lemon-curtain-content-wrapper {
  height: auto !important;
  overflow: visible !important;
  position: relative !important;
  width: 100% !important;
}

.lemon-reveal-editor-mode .lemon-curtain-content {
  position: relative !important;
  top: auto !important;
  height: auto !important;
  overflow: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
  .lemon-main-title {
    font-size: 2rem;
  }

  .lemon-main-content-text {
    font-size: 1rem;
  }

  .lemon-content-overlay,
  .lemon-content-no-overlay,
  .lemon-curtain-content {
    padding: 1rem;
  }

  .lemon-curtain-content h2 {
    font-size: 2rem;
  }

  .lemon-curtain-content h3 {
    font-size: 1.3rem;
  }

  .lemon-curtain-content p {
    font-size: 1rem;
  }

  .lemon-fallback-main,
  .lemon-fallback-reveal {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .lemon-main-title {
    font-size: 1.5rem;
  }

  .lemon-content-overlay,
  .lemon-content-no-overlay,
  .lemon-curtain-content {
    padding: 0.5rem;
  }

  .lemon-curtain-content h2 {
    font-size: 1.5rem;
  }

  .lemon-curtain-content h3 {
    font-size: 1.2rem;
  }

  .lemon-curtain-content p {
    font-size: 1rem;
  }

  .lemon-fallback-main,
  .lemon-fallback-reveal {
    padding: 1rem 0.5rem;
  }
}

/* IMPORTANTE: Asegurar que los estilos de Elementor tengan prioridad */
.elementor-widget-lemon-reveal-container .lemon-curtain-content,
.elementor-widget-lemon-reveal-container .lemon-fallback-content .lemon-curtain-content {
  /* Los colores se aplicarán desde los selectores de Elementor */
}

.elementor-widget-lemon-reveal-container .lemon-curtain-content *,
.elementor-widget-lemon-reveal-container .lemon-fallback-content .lemon-curtain-content * {
  /* Permitir herencia de colores desde el contenedor padre */
  color: inherit;
}
