/*
 * Simulador de Factoring Orsan — hero variant ([orsan_simulador variant="hero"]).
 * Every selector lives under .orsan-simh-root / .orsan-simh-* so it never
 * touches the full simulator's .orsan-sim-* styles (and vice versa).
 *
 * Layout/spacing from the "Hero con simulador (Home)" prototype; colors
 * follow the site's Elementor globals (UiCore palette), with the brand hex
 * as fallback when the kit variables aren't on the page.
 */

.orsan-simh-root {
  --orsan-simh-primary: var(--e-global-color-uicore_primary, #0055b8);
  --orsan-simh-primary-hover: var(--e-global-color-uicore_dark, #002756);
  --orsan-simh-heading: var(--e-global-color-uicore_headline, #16213e);
  --orsan-simh-label: #33405e;
  --orsan-simh-muted: #55617c;
  --orsan-simh-border: #d3dae6;
  --orsan-simh-white: #ffffff;
  --orsan-simh-result-bg: var(--e-global-color-uicore_headline, #16213e);
  --orsan-simh-result-muted: #c3cce0;
  --orsan-simh-disabled: #c9cdd8;
  --orsan-simh-error: #d14343;

  box-sizing: border-box;
  width: 100%;
  max-width: 580px;
  margin-left: auto;
  color: var(--orsan-simh-heading);
}

.orsan-simh-root *,
.orsan-simh-root *::before,
.orsan-simh-root *::after {
  box-sizing: inherit;
}

/* ---------- Card ---------- */

.orsan-simh-card {
  display: flex;
  flex-direction: column;
  gap: 21px;
  padding: 32px;
  background: var(--orsan-simh-white);
  border-radius: 24px;
  box-shadow:
    0 24px 64px rgba(15, 27, 61, 0.12),
    0 2px 6px rgba(15, 27, 61, 0.05);
}

.orsan-simh-root .orsan-simh-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--orsan-simh-heading);
}

/* ---------- Fields ---------- */

.orsan-simh-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.orsan-simh-root .orsan-simh-label {
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--orsan-simh-label);
}

.orsan-simh-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.orsan-simh-pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--orsan-simh-primary);
  font-variant-numeric: tabular-nums;
}

/* Amount */

.orsan-simh-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--orsan-simh-border);
  border-radius: 12px;
  background: var(--orsan-simh-white);
  transition: border-color 0.15s;
}

.orsan-simh-amount:focus-within {
  border-color: var(--orsan-simh-primary);
  box-shadow: 0 0 0 3px rgba(0, 85, 184, 0.15);
}

.orsan-simh-amount-prefix {
  font-size: 18px;
  font-weight: 600;
  color: var(--orsan-simh-muted);
}

.orsan-simh-root .orsan-simh-amount-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--orsan-simh-heading);
  font-variant-numeric: tabular-nums;
}

.orsan-simh-error {
  margin: 0;
  font-size: 13px;
  color: var(--orsan-simh-error);
}

.orsan-simh-error:empty {
  display: none;
}

.orsan-simh-field.orsan-sim-field-invalid .orsan-simh-amount {
  border-color: var(--orsan-simh-error);
}

/* Slider */

.orsan-simh-root .orsan-simh-slider {
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--orsan-simh-primary);
  cursor: pointer;
}

/* Term chips (radios) */

.orsan-simh-root .orsan-simh-terms {
  margin: 0;
  padding: 0;
  border: 0;
}

.orsan-simh-terms > .orsan-simh-label {
  margin-bottom: 8px;
}

.orsan-simh-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.orsan-simh-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  border: 1.5px solid var(--orsan-simh-border);
  border-radius: 10px;
  background: var(--orsan-simh-white);
  font-size: 14px;
  font-weight: 600;
  color: var(--orsan-simh-heading);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.orsan-simh-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.orsan-simh-chip:hover {
  border-color: var(--orsan-simh-primary);
}

.orsan-simh-chip.is-selected,
.orsan-simh-chip:has(input:checked) {
  background: var(--orsan-simh-primary);
  border-color: var(--orsan-simh-primary);
  color: var(--orsan-simh-white);
}

.orsan-simh-chip:has(input:focus-visible),
.orsan-simh-root .orsan-simh-slider:focus-visible,
.orsan-simh-cta:focus-visible {
  outline: 3px solid var(--e-global-color-uicore_secondary, #ffa400);
  outline-offset: 2px;
}

/* ---------- Result ---------- */

.orsan-simh-result {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 24px 26px;
  border-radius: 14px;
  background: var(--orsan-simh-result-bg);
  color: var(--orsan-simh-white);
}

.orsan-simh-result-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orsan-simh-result-label,
.orsan-simh-result-term {
  font-size: 13px;
  color: var(--orsan-simh-result-muted);
}

.orsan-simh-result-total {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--orsan-simh-white);
}

.orsan-simh-result-term strong {
  color: var(--orsan-simh-white);
  font-weight: 700;
}

/* ---------- CTA ---------- */

.orsan-simh-root .orsan-simh-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--orsan-simh-primary);
  color: var(--orsan-simh-white);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease;
}

.orsan-simh-root .orsan-simh-cta:hover:not(:disabled) {
  background: var(--orsan-simh-primary-hover);
}

.orsan-simh-root .orsan-simh-cta:disabled {
  background: var(--orsan-simh-disabled);
  cursor: not-allowed;
}

/* ---------- Notice ---------- */

.orsan-simh-notice {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--orsan-simh-muted);
}

.orsan-simh-notice-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .orsan-simh-root {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 767px) {
  .orsan-simh-card {
    gap: 16px;
    padding: 22px 18px;
    border-radius: 20px;
  }

  .orsan-simh-root .orsan-simh-title {
    font-size: 22px;
  }

  .orsan-simh-result {
    padding: 18px 18px;
  }

  .orsan-simh-result-total {
    font-size: 36px;
  }

  .orsan-simh-root .orsan-simh-cta {
    min-height: 50px;
    font-size: 16px;
  }
}

@media (max-width: 359px) {
  .orsan-simh-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
