/* Premium selects + custom dropdown (subtle gold, consistent with existing inputs)
   - Native <select> keeps base styling from mini.css; we only add a subtle caret + focus ring.
   - Enhanced selects (premium_select.js) render as .pm-select/.pm-select-btn and inherit `.input` when present.
*/

:root{
  /* Modal inputs already bring the main gold accents; these are intentionally subtle */
  --pm-gold: #f5c542;
  /* For selects we keep accents neutral to avoid a "gold overload" */
  --pm-soft: rgba(255,255,255,.06);
  --pm-border: rgba(255,255,255,.16);
  --pm-border-strong: rgba(255,255,255,.24);
  --pm-caret: rgba(226,232,240,.75);

  --pm-menu-bg: rgba(8,10,14,.98);
  --pm-menu-border: rgba(255,255,255,.14);
}

/* -------------------------------------------------------------------
   Native selects (only when NOT enhanced)
   Keep background/border from the existing theme (mini.css),
   add only caret + subtle focus/hover.
   ------------------------------------------------------------------- */
select:not(.pm-native-select),
.form-select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* keep theme padding but reserve space for caret */
  padding-right: 34px;

  /* caret */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path fill='%23cbd5e1' d='M5.5 7.5a1 1 0 0 1 1.4 0L10 10.6l3.1-3.1a1 1 0 1 1 1.4 1.4l-3.8 3.8a1 1 0 0 1-1.4 0L5.5 8.9a1 1 0 0 1 0-1.4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

select:not(.pm-native-select):hover,
.form-select:hover{
  border-color: var(--pm-border-strong);
}

select:not(.pm-native-select):focus,
.form-select:focus{
  outline: none;
  border-color: var(--pm-border-strong);
  box-shadow: 0 0 0 3px var(--pm-soft);
}

/* Options list: dark + clear selection (best effort; browsers differ) */
select:not(.pm-native-select) option,
.form-select option{
  background: #0b0f16;
  color: rgba(255,255,255,.92);
}

select:not(.pm-native-select) option:checked,
.form-select option:checked,
select:not(.pm-native-select) option[selected],
.form-select option[selected]{
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.96);
  font-weight: 700;
}

/* -------------------------------------------------------------------
   Enhanced selects (premium_select.js)
   ------------------------------------------------------------------- */
.pm-select{
  position: relative;
  width: 100%;
}

.pm-select-btn{
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;

}

/* If original select had `.input`, the button also has it.
   We only adjust right padding so the caret sits inside the border. */
.pm-select-btn.input{
  padding-right: 34px;
}

/* Fallback for pages where selects don't use `.input` */
.pm-select-btn:not(.input){
  padding: 10px 34px 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.pm-select.sm .pm-select-btn.input{
  padding-right: 32px;
}

.pm-select-value{
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.pm-select-caret{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
  color: var(--pm-caret);
  pointer-events: none;
}

/* Menu: premium dark glass */
.pm-select-menu{
  z-index: 2200;
  max-height: 300px;
  /* Nunca mostrar barra horizontal: si el texto es largo, usar ellipsis */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--pm-menu-border);
  background: var(--pm-menu-bg);
  box-shadow:
    0 26px 80px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.06) inset;
  backdrop-filter: blur(10px);
}

.pm-option{
  display: flex;
  /* Si hay textos largos, permitir 2 líneas sin desalinear feo */
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,.92);
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}

/* Etiqueta del item: una sola línea con "..." (evita scroll y cortes feos) */
.pm-option-label{
  min-width: 0;
  flex: 1;
  /* Que se lea completo (sin "...") y sin barra horizontal */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* No mostrar barras (pero sí permitir scroll con rueda) */
.pm-select-menu{ scrollbar-width:none; }
.pm-select-menu::-webkit-scrollbar{ width:0; height:0; }

.pm-option:hover{
  background: rgba(255,255,255,.07);
}

.pm-option[aria-selected="true"]{
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.96);
  font-weight: 600;
  box-shadow:
    inset 2px 0 0 rgba(255,255,255,.18),
    inset 0 0 0 1px rgba(255,255,255,.08);
}

.pm-option.disabled{
  opacity: .45;
  cursor: not-allowed;
}

.pm-check{
  /* No golden ring: just a clean check */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
  color: rgba(226,232,240,.82);
  font-weight: 900;
}

/* In product/config modals the theme adds a gold focus ring to .input.
   Keep selects calm and neutral. */
.products-modal .pm-select-btn.input:focus,
.products-modal .pm-select-btn.input:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
}


/* ------------------------------
   Multi-select dropdown (checkbox)
------------------------------- */
.msel{ position: relative; width: 100%; }
.msel-source{ display: none !important; }
.msel-btn{ display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; cursor:pointer; }
.msel-text{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msel-caret{ opacity:.75; }
.msel-menu{
  position:absolute;
  left:0;
  right:0;
  top: calc(100% + 8px);
  z-index: 1000;
  background: rgba(15, 23, 42, .98);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  max-height: 220px;
  overflow:auto;
}
.msel-opt{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius: 10px;
  cursor:pointer;
  user-select:none;
  color: rgba(255,255,255,.9);
}
.msel-opt:hover{ background: rgba(255,255,255,.06); }
.msel-opt input{ width:16px; height:16px; }
.seg-content.is-locked .msel-btn{ opacity:.55; cursor:not-allowed; }

/*
  FIX de capas en modal:
  - Las .card tienen backdrop-filter y crean un stacking context.
  - Si el dropdown está dentro de una card, puede quedar "debajo" de la siguiente.
  - Subimos el z-index de la card cuando el dropdown está abierto.
*/
.msel-open-card{ position: relative; z-index: 5000; }
.msel.is-open{ z-index: 5000; }
.msel.is-open .msel-menu{ z-index: 6000; }
