/* =====================================================
   Componente Segmented — selector de opciones
   ===================================================== */

.segmented {
  border: none;
  padding: 0;
  margin: 0 0 var(--espacio-xl);
}

.segmented-legend {
  float: left;
  width: 100%;
  font-weight: 500;
  font-size: var(--texto-base);
  color: var(--texto-principal);
  margin-bottom: var(--espacio-sm);
  line-height: 1.4;
}

.segmented-track {
  display: flex;
  gap: var(--espacio-xs);
  clear: both;
}

.segmented-option {
  flex: 1;
  display: block;
  cursor: pointer;
  border-radius: var(--borde-radio-md);
  border: 1px solid var(--borde);
  background: var(--fondo-card);
  color: var(--texto-principal);
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.segmented-option:hover {
  border-color: var(--color-marca);
  background: var(--marca-suave);
}

/* Input oculto accesiblemente (sr-only, no display:none) */
.segmented-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Opción seleccionada — :has soportado en Safari iOS 15.4+, Chrome 105+, Firefox 121+ */
.segmented .segmented-option:has(input:checked) {
  background: var(--color-marca);
  border-color: var(--color-marca);
  color: #fff;
}

/* Focus visible en la pastilla al navegar con teclado */
.segmented .segmented-option:has(input:focus-visible) {
  outline: 2px solid var(--color-marca);
  outline-offset: 2px;
}

.segmented-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espacio-sm);
  padding: var(--espacio-sm) var(--espacio-md);
  user-select: none;
  min-height: 44px;
}

.segmented-icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.segmented-label {
  font-size: var(--texto-sm);
  font-weight: 500;
  line-height: 1;
}

.segmented-hint {
  font-size: var(--texto-xs);
  color: var(--texto-secundario);
  margin-top: var(--espacio-xs);
  line-height: 1.4;
  clear: both;
}
