/* Link Mahal — global custom select */
.lm-select-field {
  margin-bottom: 1rem;
  width: 100%;
  min-width: 0;
}
.lm-select-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text, #1f2937);
}
.lm-select-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted, #6b7280);
  font-size: 0.8rem;
}

.lm-select-field--flush {
  margin-bottom: 0;
}

.lm-select-field--inline-action {
  margin-bottom: 0;
}

.lm-select {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.lm-select-trigger {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  height: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--card, #fff);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text, #111827);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lm-select-trigger:hover {
  border-color: #9ca3af;
}
.lm-select.is-open .lm-select-trigger,
.lm-select-trigger:focus {
  outline: none;
  border-color: var(--primary, #111827);
  box-shadow: 0 0 0 1px var(--primary, #111827);
}
.lm-select.is-invalid .lm-select-trigger {
  border-color: var(--danger, #ef4444);
  box-shadow: 0 0 0 1px var(--danger, #ef4444);
}

.lm-select-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}
.lm-select-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}
.lm-select-icon[hidden] {
  display: none !important;
}
.lm-select-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lm-select-text.is-placeholder {
  color: #6b7280;
}

.lm-select-chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}
.lm-select.is-open .lm-select-chevron {
  transform: rotate(180deg);
}

.lm-select-clear {
  display: block;
  margin-top: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.875rem;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
}
.lm-select-clear:hover {
  color: #374151;
}
.lm-select-clear[hidden] {
  display: none !important;
}

#lm-select-portal-root {
  position: relative;
  z-index: 10050;
}

/* Portal dropdown (appended to body) */
.lm-select-dropdown {
  position: fixed;
  z-index: 10050;
  min-width: var(--lm-select-width, 12rem);
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 15rem;
}
.lm-select-dropdown[hidden] {
  display: none !important;
}

.lm-select-search-wrap {
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 0.35rem;
}
.lm-select-search {
  width: 100%;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}
.lm-select-search:focus {
  border-color: var(--primary, #111827);
}

.lm-select-group-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lm-select-group-header {
  list-style: none;
  pointer-events: none;
  user-select: none;
  padding-top: 0.65rem;
}

.lm-select-group-header:first-child {
  padding-top: 0.35rem;
}

.lm-select-field--inline {
  margin-bottom: 0;
}

.lm-select-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  overflow-y: auto;
  flex: 1;
}

.lm-select-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text, #111827);
  cursor: pointer;
  user-select: none;
}
.lm-select-item:hover,
.lm-select-item.is-highlighted {
  background: #f3f4f6;
}
.lm-select-item.is-selected {
  background: #f9fafb;
}
.lm-select-item-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}
.lm-select-item-label {
  flex: 1;
  min-width: 0;
}
.lm-select-item-meta {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.8rem;
}
.lm-select-item-check {
  position: absolute;
  right: 0.75rem;
  color: var(--accent, #2563eb);
  font-size: 0.875rem;
  font-weight: 700;
  opacity: 0;
}
.lm-select-item.is-selected .lm-select-item-check {
  opacity: 1;
}

.lm-select-empty {
  padding: 0.75rem;
  color: #6b7280;
  font-size: 0.875rem;
  text-align: center;
}

@media (max-width: 768px) {
  .lm-select-trigger {
    min-height: 2.75rem;
    font-size: 16px;
  }

  .lm-select-item {
    min-height: 2.75rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .lm-phone-dial-btn {
    min-height: 2.75rem;
  }
}

.dashboard-body--merchant .lm-select-label,
.ob-card .lm-select-label {
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.dashboard-body--merchant .lm-select-trigger,
.ob-card .lm-select-trigger {
  min-height: 2.75rem;
  border-radius: 12px;
  font-size: 16px;
}

.se-stack .lm-select-field,
.se-row-2 .lm-select-field,
.se-field-row .lm-select-field {
  margin-bottom: 0;
}

.se-row-2 .lm-select-field,
.se-field-row .lm-select-field {
  min-width: 0;
}

.grid-2 .lm-select-field {
  margin-bottom: 0;
}

/* Phone input: country trigger uses lm-select trigger styles */
.lm-phone-input .lm-select-trigger--phone {
  height: auto;
  min-height: 2.5rem;
  border: none;
  border-right: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
  box-shadow: none;
  background: #f8fafc;
  min-width: 108px;
  flex-shrink: 0;
}
.lm-phone-input .lm-select-trigger--phone:hover {
  background: #f1f5f9;
}
.lm-phone-input.is-open .lm-select-trigger--phone,
.lm-phone-input .lm-select-trigger--phone:focus {
  box-shadow: none;
  border-color: var(--border, #e5e7eb);
}
