/* =========================================================
   HG Select – dropdown-uri custom (Horeca Group)
   ========================================================= */
.hg-select {
  position: relative;
  width: 100%;
  font-family: var(--hg-sans);
}
.hg-select.is-inline { display: inline-block; width: auto; min-width: 220px; vertical-align: top; }

/* select-ul nativ rămâne în DOM (pt. submit / validare), dar ascuns */
.hg-select > select {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- Trigger ---------- */
.hg-select__trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: 400 15px/1.2 var(--hg-sans);
  color: var(--hg-ink, #0e0d0c);
  background: var(--hg-white, #fff);
  border: 1px solid var(--hg-line, #e5ded3);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.hg-select__trigger:hover { border-color: var(--hg-steel, #8c867e); }
.hg-select__trigger:focus-visible,
.hg-select.is-open .hg-select__trigger {
  border-color: var(--hg-ink, #0e0d0c);
  box-shadow: var(--hg-focus, 0 0 0 3px rgba(215, 38, 30, .18));
}
.hg-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hg-select.is-placeholder .hg-select__value { color: var(--hg-steel, #8c867e); }
.hg-select__chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--hg-muted, #6b645b);
  transition: transform .25s var(--hg-ease, ease);
}
.hg-select.is-open .hg-select__chevron { transform: rotate(180deg); color: var(--hg-ink, #0e0d0c); }

/* stare invalidă din formularul HGP */
.hgp__field.is-invalid .hg-select__trigger { border-color: var(--hg-red, #d7261e); }

/* variantă „Sortare” WooCommerce */
.woocommerce-ordering .hg-select__trigger {
  height: 44px;
  padding: 0 14px 0 16px;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Panou ---------- */
.hg-select__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--hg-white, #fff);
  border: 1px solid var(--hg-line, #e5ded3);
  border-radius: 14px;
  box-shadow: 0 24px 48px -20px rgba(14, 13, 12, .28), 0 4px 12px -4px rgba(14, 13, 12, .08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top center;
  transition: opacity .16s ease, transform .2s var(--hg-ease, ease), visibility 0s linear .2s;
}
.hg-select.is-inline .hg-select__panel { min-width: 100%; right: auto; width: max-content; max-width: 320px; }
.hg-select.is-up .hg-select__panel {
  top: auto;
  bottom: calc(100% + 8px);
  transform-origin: bottom center;
  transform: translateY(6px) scale(.98);
}
.hg-select.is-open .hg-select__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .16s ease, transform .2s var(--hg-ease, ease), visibility 0s;
}
.hg-select__panel::-webkit-scrollbar { width: 8px; }
.hg-select__panel::-webkit-scrollbar-thumb { background: var(--hg-line, #e5ded3); border-radius: 8px; border: 2px solid #fff; }

/* ---------- Opțiuni ---------- */
.hg-select__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 9px;
  font: 400 15px/1.3 var(--hg-sans);
  color: var(--hg-ink-3, #2a2724);
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, color .12s;
}
.hg-select__option + .hg-select__option { margin-top: 2px; }
.hg-select__option.is-active { background: var(--hg-bone, #f3eee6); color: var(--hg-ink, #0e0d0c); }
.hg-select__option[aria-selected="true"] {
  background: var(--hg-red-tint, #fce5e0);
  color: var(--hg-red-deep, #9e1a14);
  font-weight: 600;
}
.hg-select__option[aria-selected="true"].is-active { background: #f9d6cf; }
.hg-select__option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.hg-select__label { flex: 1; }
.hg-select__check {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--hg-red, #d7261e);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .2s var(--hg-ease, ease);
}
.hg-select__option[aria-selected="true"] .hg-select__check { opacity: 1; transform: none; }

.woocommerce-ordering .hg-select__option { font-size: 14px; padding: 10px 12px; }

@media (prefers-reduced-motion: reduce) {
  .hg-select__panel, .hg-select__chevron, .hg-select__check { transition: none !important; }
}
