/* Custom country selector dropdown */

#rp-modal-form .country-selector-wrapper {
  flex: 0 0 90px;
  min-width: 80px;
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
  display: block;
  margin: 0;
}

/* Trigger button */
.cs-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0 0 8px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid black;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: black;
  font-family: inherit;
}

.cs-flag img {
  height: 16px;
  width: 22px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.cs-code {
  font-size: 13px;
  font-weight: 600;
  color: black;
  letter-spacing: 0.2px;
}

.cs-chevron {
  width: 10px;
  height: 6px;
  margin-left: auto;
  flex-shrink: 0;
  color: black;
  transition: transform 0.2s ease;
}

.cs-trigger.cs-active .cs-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel — opens upward */
.cs-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 260px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.07);
  z-index: 10002;
  overflow: hidden;
}

.cs-dropdown.cs-open {
  display: flex;
}

/* Search */
.cs-search-wrap {
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa;
}

.cs-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #222;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.cs-search:focus {
  border-color: var(--primary-col, #bf4b26);
}

/* Country list */
.cs-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 210px;
  overflow-y: auto;
}

.cs-list::-webkit-scrollbar {
  width: 4px;
}

.cs-list::-webkit-scrollbar-track {
  background: transparent;
}

.cs-list::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

/* Country card item */
.cs-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.cs-item:hover {
  background: #f2f2f2;
}

.cs-item-flag {
  width: 26px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cs-item-name {
  flex: 1;
  font-size: 13px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

.cs-item-code {
  font-size: 12px;
  color: #777;
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.cs-no-results {
  padding: 14px 12px;
  font-size: 13px;
  color: #999;
  text-align: center;
}

@media (max-width: 520px) {
  #rp-modal-form .country-selector-wrapper {
    flex: 0 0 80px;
    min-width: 75px;
  }

  .cs-dropdown {
    width: 240px;
  }
}
