/* ==========================================================================
   jQuery Nice Select — CSS base
   Fonte: adaptado do original (MIT)
   ========================================================================== */

/* Reset básico */
.nice-select,
.nice-select * {
  box-sizing: border-box;
}

/* Wrapper principal */
.nice-select {
  -webkit-tap-highlight-color: transparent;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  height: 40px;
  line-height: 38px;
  outline: none;
  padding: 0 36px 0 12px; /* espaço para a seta à direita */
  position: relative;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
  user-select: none;
  white-space: nowrap;
  width: auto;
}

/* Estado focus/hover */
.nice-select:hover {
  border-color: #bfbfbf;
}
.nice-select:focus,
.nice-select:active,
.nice-select.open {
  border-color: #8c8c8c;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, .15);
}

/* Texto seleccionado (renderiza dentro do .current) */
.nice-select .current {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Seta */
.nice-select:after {
  content: "";
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -2px;
  width: 6px;
  height: 6px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform: rotate(45deg);
  transition: transform .2s ease, border-color .15s ease;
}

.nice-select.open:after {
  transform: rotate(-135deg);
  margin-top: -4px;
}

/* Lista dropdown */
.nice-select .list {
  background-color: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  box-sizing: border-box;
  margin-top: 6px;
  opacity: 0;
  overflow: auto;
  padding: 4px 0;
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  transform-origin: 50% 0;
  transform: scale(.98) translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 9999;
  max-height: 260px; /* ajusta se precisares */
}

/* Aberta */
.nice-select.open .list {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

/* Opções */
.nice-select .option {
  cursor: pointer;
  display: block;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  padding: 10px 12px;
  position: relative;
  transition: background-color .12s ease, color .12s ease;
}

.nice-select .option:hover,
.nice-select .option.focus {
  background-color: #f5f5f5;
}

.nice-select .option.selected {
  font-weight: 600;
  color: #111;
  background-color: #f0f7ff;
}

.nice-select .option.disabled {
  color: #bfbfbf;
  cursor: not-allowed;
}

/* Estados disabled no select */
.nice-select.disabled,
.nice-select:disabled {
  border-color: #e5e5e5;
  color: #bfbfbf;
  pointer-events: none;
  background-color: #fafafa;
}
.nice-select.disabled:after,
.nice-select:disabled:after {
  border-color: #dcdcdc;
}

/* Tamanhos utilitários */
.nice-select.sm { height: 34px; line-height: 32px; font-size: 13px; }
.nice-select.sm:after { right: 10px; }
.nice-select.lg { height: 46px; line-height: 44px; font-size: 15px; }

/* Largura total em formulários (WooCommerce) */
.variations_form .variations .nice-select,
.woocommerce .variations_form .variations .nice-select {
  width: 100%;
  display: block;
}

/* Quando usado dentro de elementos com overflow oculto (corrige recorte do dropdown) */
.nice-select.open {
  z-index: 100;
}

/* Compatibilidade com inputs em linha */
.nice-select.full,
.nice-select.w-100 { width: 100%; }

/* RTL básico (se precisares) */
[dir="rtl"] .nice-select { text-align: right; padding: 0 12px 0 36px; }
[dir="rtl"] .nice-select:after { right: auto; left: 12px; transform: rotate(-45deg); }
[dir="rtl"] .nice-select.open:after { transform: rotate(135deg); }
[dir="rtl"] .nice-select .list { left: auto; right: 0; }

/* Estado dentro de campos em erro (WooCommerce/temas) */
.nice-select.is-invalid,
.woocommerce .form-row .nice-select.is-invalid {
  border-color: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255,77,79,.15);
}

/* Placeholder cinza quando o <option> selecionado está vazio */
.nice-select.placeholder .current {
  color: #9a9a9a;
}

/* Ajustes de scroll suave em listas longas (opcional) */
.nice-select .list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.nice-select .list::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 8px;
}
.nice-select .list::-webkit-scrollbar-track {
  background: transparent;
}

/* Integração com labels acima do campo */
label + .nice-select { margin-top: 4px; }

/* Em modais (Quick View) garantir sobreposição acima do conteúdo */
.bravis-quick-view .nice-select.open .list,
.festiva-quick-view .nice-select.open .list {
  z-index: 100000;
}
