/**
 * TERAL Country Selector — scoped under .tcs-selector only (no PHP / no IDs).
 */

.tcs-selector {
  position: relative;
  display: inline-flex;
  z-index: 100000;
}

.tcs-selector .tcs-trigger {
  position: relative;
  z-index: 100001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  border-radius: 999px;
  transition: opacity 0.2s ease;
}

.tcs-selector .tcs-trigger:hover {
  opacity: 0.8;
}

.tcs-selector .tcs-current-flag {
  display: block;
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
}

.tcs-selector .tcs-trigger-flag-slot {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  box-sizing: border-box;
}

.tcs-selector .tcs-trigger-flag-slot--global {
  background: transparent;
  color: #fff;
}

.tcs-selector .tcs-trigger-flag-slot--global .tcs-globe-svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke: #fff;
  color: #fff;
}

.tcs-selector .tcs-trigger-flag-slot--empty {
  background: #e8eaed;
}

.tcs-selector .tcs-globe-svg {
  width: 12px;
  height: 12px;
  display: block;
}

.tcs-selector .tcs-current-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.tcs-selector .tcs-trigger-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 1px;
  line-height: 0;
}

.tcs-selector .tcs-trigger-caret .tcs-caret-svg {
  display: block;
  transition: transform 0.2s ease;
  transform-origin: 50% 55%;
}

.tcs-selector.menu-open .tcs-trigger-caret .tcs-caret-svg {
  transform: rotate(180deg);
}

.tcs-selector .tcs-menu {
  position: absolute;
  top: calc(100% + -5px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(15, 44, 73, 0.12);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  padding: 6px;
  display: none;
  z-index: 100002;
}

.tcs-selector .tcs-menu.is-open {
  display: block;
}

.tcs-selector .tcs-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #0f2c49;
  font-size: 12px;
  line-height: 1.3;
}

.tcs-selector .tcs-item-flag-slot {
  width: 20px;
  height: 15px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  border-radius: 2px;
  overflow: hidden;
}

.tcs-selector .tcs-item-flag-slot--global {
  background: #f1f5f9;
  color: #64748b;
  justify-content: center;
}

.tcs-selector .tcs-item-flag-slot--empty {
  background: #e8eaed;
}

.tcs-selector .tcs-item-flag-slot .tcs-globe-svg {
  width: 12px;
  height: 12px;
}

.tcs-selector .tcs-item-flag-slot img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.tcs-selector .tcs-item-text {
  flex: 1;
  min-width: 0;
}

.tcs-selector .tcs-item:hover {
  background: rgba(15, 44, 73, 0.08);
}

.tcs-selector .tcs-item.is-active {
  background: rgba(15, 44, 73, 0.12);
  font-weight: 600;
}
