/* Select personalizado (js/select.js): o <select> nativo continua no formulário, só fica escondido. */

.cselect {
  --cs-height: 54px;
  --cs-radius: 18px;
  position: relative;
}

.cselect-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.cselect-trigger {
  width: 100%;
  height: var(--cs-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 0 18px;
  border: 2px solid var(--line);
  border-radius: var(--cs-radius);
  background-color: var(--cream);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.cselect-trigger:hover {
  border-color: var(--blue-400);
}

.cselect-trigger:focus-visible,
.cselect.is-open .cselect-trigger {
  outline: none;
  border-color: var(--blue-500);
  background-color: var(--white);
  box-shadow: 0 0 0 5px rgba(47, 123, 242, 0.15);
}

.cselect-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cselect.is-placeholder .cselect-value {
  color: #9a8f82;
}

.cselect-arrow {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-600);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.cselect-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cselect.is-open .cselect-arrow {
  transform: rotate(180deg);
  background: var(--yellow);
  color: var(--navy);
}

.cselect-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}

.cselect.is-open .cselect-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
}

.cselect.opens-up .cselect-panel {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(6px);
}

.cselect.opens-up.is-open .cselect-panel {
  transform: none;
}

.cselect-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

.cselect-option.is-active {
  background: var(--blue-100);
}

.cselect-option[aria-selected="true"] {
  color: var(--blue-600);
}

.cselect-option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.cselect-option[aria-selected="true"] svg {
  opacity: 1;
}

.filter-group .cselect {
  --cs-height: 50px;
  --cs-radius: 16px;
}

.filter-group .cselect-trigger {
  font-size: 15px;
  font-weight: 600;
}
