/* ============================================================
   Image Comparison Slider — Styles  (CSS3 Compatible)
   ============================================================
   Valores de diseño (referencia para mantenimiento):
     Handle size:       40px  (mobile: 34px)
     Handle color:      #fff
     Handle shadow:     0 0 6px rgba(0, 0, 0, 0.45)
     Line width:        2px
     Border radius:     0
     Select bg:         rgba(0, 0, 0, 0.55)
     Select color:      #fff
     Select radius:     4px
     Select font-size:  13px  (mobile: 11px)
   ============================================================ */

.ics {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;          /* evita scroll mientras se arrastra */
  line-height: 0;              /* elimina gap bajo las imágenes     */
}

/* ---- Imágenes ---- */

.ics__img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-transform-origin: 0 0;
  -ms-transform-origin: 0 0;
  transform-origin: 0 0;
}

.ics__before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  overflow: hidden;
}

.ics__before .ics__img {
  /* Ancho establecido vía JS para coincidir exactamente con imgRight */
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
}

/* ---- Línea divisora ---- */

.ics__line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
  -webkit-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

/* ---- Handle (botón arrastrable) ---- */

.ics__handle {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: auto;
  cursor: col-resize;

  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;

  background: #fff;
  border-radius: 50%;
  -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}

/* Flechas del handle ◄ ► */
.ics__handle::before,
.ics__handle::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
}

.ics__handle::before {
  border-width: 6px 7px 6px 0;
  border-color: transparent #555 transparent transparent;
  margin-right: 4px;
}

.ics__handle::after {
  border-width: 6px 0 6px 7px;
  border-color: transparent transparent transparent #555;
  margin-left: 4px;
}

/* ---- ComboBoxes (selects) ---- */

.ics__select {
  position: absolute;
  top: 12px;
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
  line-height: 1.4;

  padding: 4px 26px 4px 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  outline: none;

  /* Reset apariencia nativa */
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Flecha personalizada con SVG inline (CSS3 puro) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 6px;

  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ics__select:hover {
  background-color: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.45);
}

.ics__select:focus {
  border-color: rgba(255, 255, 255, 0.6);
  -webkit-box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

/* Estilo de las opciones del dropdown */
.ics__select option {
  background: #222;
  color: #fff;
  padding: 4px 8px;
}

.ics__select--left {
  left: 12px;
}

.ics__select--right {
  right: 12px;
}

/* ---- Etiquetas estáticas (legado, por compatibilidad) ---- */

.ics__label {
  position: absolute;
  top: 12px;
  padding: 4px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  pointer-events: none;
  z-index: 4;
  letter-spacing: 0.02em;
}

.ics__label--before {
  left: 12px;
}

.ics__label--after {
  right: 12px;
}

/* ---- Cursores de zoom/pan ---- */

.ics--zoomed {
  cursor: -webkit-grab;
  cursor: grab;
}

.ics--panning {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

/* ---- Responsivo ---- */

@media (max-width: 600px) {
  .ics__handle {
    width: 34px;
    height: 34px;
  }

  .ics__select {
    font-size: 11px;
    padding: 3px 20px 3px 6px;
    top: 8px;
    background-position: right 6px center;
    background-size: 8px 5px;
  }

  .ics__select--left {
    left: 8px;
  }

  .ics__select--right {
    right: 8px;
  }

  .ics__label {
    font-size: 11px;
    padding: 3px 8px;
    top: 8px;
  }

  .ics__label--before {
    left: 8px;
  }

  .ics__label--after {
    right: 8px;
  }
}
