﻿/* Checkout modal — searchable location selects (lista vertical, como /Clientes/Cadastro) */

.ck-input:has(.crm-fancy-select) {
  padding-right: 8px;
}

.ck-overlay select.crm-select-native-hidden,
.ck-overlay .crm-fancy-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ck-overlay .crm-fancy-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  flex: 1;
  z-index: 1;
  overflow: visible;
}

.ck-overlay .ck-input,
.ck-overlay .ck-field,
.ck-overlay .ck-form-grid,
.ck-overlay .ck-form,
.ck-overlay .ck-panel {
  overflow: visible;
}

.ck-overlay .crm-fancy-select-trigger {
  width: 100%;
  min-height: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #475569;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ck-overlay .crm-fancy-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.ck-overlay .crm-fancy-select-label.is-placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.ck-overlay .crm-fancy-select-chevron {
  flex: 0 0 auto;
  color: #94a3b8;
  display: grid;
  place-items: center;
}

.ck-overlay .crm-fancy-select-chevron svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* Menu: absoluto no host; em modal checkout usa portal fixed (JS) */
.crm-fancy-select-menu {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 13050;
  min-width: 100%;
  max-width: min(360px, 92vw);
  padding: 6px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d7e3f5;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(24, 48, 92, 0.16), 0 2px 6px rgba(24, 48, 92, 0.06);
}

.crm-fancy-select.is-open > .crm-fancy-select-menu {
  display: flex;
}

.crm-fancy-select-menu.crm-fancy-select-menu--portal,
.crm-fancy-select-menu--portal {
  display: flex !important;
  position: fixed !important;
  left: auto;
  right: auto !important;
  top: auto;
  bottom: auto;
  margin: 0;
  z-index: 13050 !important;
}

.crm-fancy-select-search-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 10px;
  margin: 0 0 4px;
  background: #fff;
  border-bottom: 1px solid #e8edf5;
}

.crm-fancy-select-search-wrap .crm-fancy-select-search-ico {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  flex: 0 0 auto;
  color: #7d93b8;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.crm-fancy-select-search {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #c9daf5;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
}

.crm-fancy-select-search:focus {
  border-color: #2f6df6;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.12);
}

.crm-fancy-select-options {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 2px 0 2px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(280px, 42vh);
}

/* Reset forte do <button> nativo → linha de lista */
button.crm-fancy-select-option,
.crm-fancy-select-option {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-radius: 8px !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #334155 !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

button.crm-fancy-select-option:hover,
.crm-fancy-select-option:hover {
  background: #f1f6ff !important;
  color: #1e4fa3 !important;
}

button.crm-fancy-select-option.is-selected,
.crm-fancy-select-option.is-selected {
  background: linear-gradient(135deg, #1f5fff, #3b82f6) !important;
  color: #fff !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.22) !important;
}

button.crm-fancy-select-option.is-selected:hover,
.crm-fancy-select-option.is-selected:hover {
  background: linear-gradient(135deg, #1f5fff, #3b82f6) !important;
  color: #fff !important;
}

button.crm-fancy-select-option.is-disabled,
.crm-fancy-select-option.is-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.crm-fancy-select-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}
