/* Componente: Carrusel Home (full width)
   Se apoya en tipografías ya usadas en style-ch.css:
   - Título: "Domaine Disp"
   - Texto: "DM Sans", sans-serif
*/

.ch-home-carrusel {
  width: 100%;
  position: relative;
  --ch-edge-hint: rgba(0, 0, 0, 0);
}

/* Full width incluso si hay containers */
.ch-home-carrusel,
.ch-home-carrusel * {
  box-sizing: border-box;
}

.ch-home-carrusel__viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.ch-home-carrusel__track {
  display: flex;
  width: 100%;
  will-change: transform;
}

.ch-home-carrusel__slide {
  flex: 0 0 100%;
  width: 100%;
  min-height: 475px; /* aprox según captura */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  /* Por defecto: abajo izquierda */
  align-items: flex-end;
  justify-content: flex-start;
}

/* --- Posición vertical del texto --- */
.ch-home-carrusel__slide.text-v-top {
  align-items: flex-start;
}

.ch-home-carrusel__slide.text-v-center {
  align-items: center;
}

.ch-home-carrusel__slide.text-v-bottom {
  align-items: flex-end;
}

/* --- Posición horizontal del texto --- */
.ch-home-carrusel__slide.text-h-left {
  justify-content: flex-start;
}

.ch-home-carrusel__slide.text-h-center {
  justify-content: center;
}

.ch-home-carrusel__slide.text-h-center .ch-home-carrusel__content {
  text-align: center;
  align-items: center;
}

.ch-home-carrusel__slide.text-h-right {
  justify-content: flex-end;
}

.ch-home-carrusel__slide.text-h-right .ch-home-carrusel__content {
  text-align: right;
  align-items: flex-end;
}

/* --- Visibilidad del texto (título y subtítulo) --- */
/* Siempre visible (default) */
.text-show-always {
  display: block;
}

/* Solo Desktop: ocultar en móvil */
.text-show-desktop {
  display: block;
}

@media (max-width: 768px) {
  .text-show-desktop {
    display: none !important;
  }
}

/* Solo Móvil: ocultar en desktop */
.text-show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .text-show-mobile {
    display: block !important;
  }
}

/* Nunca visible (manejado en PHP, pero por seguridad) */
.text-show-never {
  display: none !important;
}

/* Video de fondo */
.ch-home-carrusel__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

@media (max-width: 1024px) {
  .ch-home-carrusel__slide { min-height: 420px; }
}

@media (max-width: 768px) {
  .ch-home-carrusel__slide { min-height: 360px; }
}

@media (max-width: 600px) {
  .ch-home-carrusel__slide { min-height: 340px; }
}

.ch-home-carrusel__overlay {
  position: absolute;
  inset: 0;
  background: var(--ch-overlay, rgba(0, 0, 0, 0.35));
  pointer-events: none;
  z-index: 1;
  /* Forzar que el overlay cubra todo el slide */
  width: 100%;
  height: 100%;
  display: none;
}

/* Overlay solo cuando el texto es visible en ese breakpoint */
.ch-home-carrusel__slide.overlay-desktop .ch-home-carrusel__overlay {
  display: block;
}

@media (max-width: 768px) {
  .ch-home-carrusel__slide.overlay-desktop .ch-home-carrusel__overlay {
    display: none;
  }

  .ch-home-carrusel__slide.overlay-mobile .ch-home-carrusel__overlay {
    display: block;
  }
}

.ch-home-carrusel__content {
  position: relative;
  z-index: 2;
  width: min(720px, 92%);
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 768px) {
  .ch-home-carrusel__content { padding: 34px 22px; }
}

@media (max-width: 600px) {
  .ch-home-carrusel__content {
    width: min(560px, 94%);
    padding: 34px 18px;
    gap: 12px;
  }
}

.ch-home-carrusel__subtitle {
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  opacity: 0.95;
  margin: 0;
  padding-bottom: 18px;
  text-shadow: 1px 1px 2px rgba(29, 29, 27, 0.35);
}

@media (max-width: 600px) {
  .ch-home-carrusel__subtitle {
    font-size: 12px;
    letter-spacing: 0.32em;
    padding-bottom: 14px;
  }
}

/* Separador entre subtítulo y título */
.ch-home-carrusel__subtitle + .ch-home-carrusel__title::before {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  margin-bottom: 16px;
  opacity: 0.6;
}

@media (max-width: 600px) {
  .ch-home-carrusel__subtitle + .ch-home-carrusel__title::before {
    margin-bottom: 12px;
  }
}

.ch-home-carrusel__title {
  font-family: "Domaine Disp", serif;
  font-size: 36px;
  line-height: 1.1;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(29, 29, 27, 0.45);
}

@media (max-width: 600px) {
  .ch-home-carrusel__title {
    font-size: 28px;
    line-height: 1.12;
  }
}

/* Subtítulo grande (el "bajada" en foto original) */
.ch-home-carrusel__bajada {
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(29, 29, 27, 0.35);
}

@media (max-width: 600px) {
  .ch-home-carrusel__bajada {
    font-size: 14px;
  }
}

.ch-home-carrusel__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  padding: 10px 18px;
  width: fit-content;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.ch-home-carrusel__cta:hover,
.ch-home-carrusel__cta:focus {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* No forzar estilos distintos por modo: CTA siempre blanco/negro */
.ch-home-carrusel__cta.is-light,
.ch-home-carrusel__cta.is-dark {
  color: #111;
}

.ch-home-carrusel__cta.is-light:hover,
.ch-home-carrusel__cta.is-light:focus,
.ch-home-carrusel__cta.is-dark:hover,
.ch-home-carrusel__cta.is-dark:focus {
  color: #fff;
}

/* Modo claro/oscuro por elemento */
.ch-home-carrusel__subtitle.is-light,
.ch-home-carrusel__title.is-light {
  color: #fff;
}

.ch-home-carrusel__subtitle.is-dark,
.ch-home-carrusel__title.is-dark {
  color: #111;
  text-shadow: none;
}

/* Dots */
.ch-home-carrusel__dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}

.ch-home-carrusel__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  opacity: 1;
  border: 1px solid;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.ch-home-carrusel__dot.is-active {
  background: currentColor;
}

/* Estado "pausado": ring animado en el dot activo */
.ch-home-carrusel.is-paused .ch-home-carrusel__dot.is-active {
  background: transparent !important;
  position: relative;
}

.ch-home-carrusel.is-paused .ch-home-carrusel__dot.is-active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.65;
  animation: chDotPulse 1.1s ease-in-out infinite;
}

@keyframes chDotPulse {
  0% { transform: scale(1); opacity: 0.65; }
  60% { transform: scale(1.35); opacity: 0.25; }
  100% { transform: scale(1); opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-home-carrusel.is-paused .ch-home-carrusel__dot.is-active::after {
    animation: none;
  }
}

/* Near-edge nudge: cursor sugerente */
.ch-home-carrusel.is-edge-left,
.ch-home-carrusel.is-edge-right {
  cursor: pointer;
}

.ch-home-carrusel.is-edge-left::before,
.ch-home-carrusel.is-edge-right::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.35;
  transition: opacity 180ms ease;
}

.ch-home-carrusel.is-edge-left::before {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.ch-home-carrusel.is-edge-right::after {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

@media (prefers-reduced-motion: reduce) {
  .ch-home-carrusel.is-edge-left::before,
  .ch-home-carrusel.is-edge-right::after {
    transition: none;
  }
}

/* En dispositivos touch: no mostrar hints de borde ni cursors especiales */
@media (hover: none), (pointer: coarse) {
  .ch-home-carrusel.is-edge-left,
  .ch-home-carrusel.is-edge-right {
    cursor: default;
  }

  .ch-home-carrusel.is-edge-left::before,
  .ch-home-carrusel.is-edge-right::after {
    display: none;
  }
}

/* Color exacto por modo - fuerza blanco cuando se configura white */
.ch-home-carrusel__dots[data-color="white"] .ch-home-carrusel__dot {
  border-color: #ffffff !important;
  color: #ffffff;
}

.ch-home-carrusel__dots[data-color="white"] .ch-home-carrusel__dot.is-active {
  background-color: #ffffff !important;
}

.ch-home-carrusel__dots[data-color="black"] .ch-home-carrusel__dot {
  border-color: #111111 !important;
  color: #111111;
}

.ch-home-carrusel__dots[data-color="black"] .ch-home-carrusel__dot.is-active {
  background-color: #111111 !important;
}
