/* ==================================================
   Tangens Country Selector
   Desktop dropdown + mobile native selector
================================================== */

.tg-country-selector,
.tg-country-selector *,
.tg-country-selector *::before,
.tg-country-selector *::after,
.tg-country-selector__panel,
.tg-country-selector__panel *,
.tg-country-selector__panel *::before,
.tg-country-selector__panel *::after,
.tg-country-mobile,
.tg-country-mobile *,
.tg-country-mobile *::before,
.tg-country-mobile *::after {
  box-sizing: border-box;
}

/* ==================================================
   Desktop selector
================================================== */

.tg-country-selector {
  position: relative;
  display: inline-block;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  color: #111;
  z-index: 999999;
}

.tg-country-selector__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  cursor: pointer;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
  outline: none;
}

.tg-country-selector__trigger:hover {
  color: #000;
}

.tg-country-selector__trigger:focus-visible {
  outline: 1px solid #999;
  outline-offset: 3px;
}

.tg-country-selector__trigger-label {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-country-selector__trigger-icon {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  opacity: 0.7;
  transform: translateY(-1px);
}

/* ==================================================
   Desktop portal panel
================================================== */

.tg-country-selector__panel {
  position: fixed;
  width: 370px;
  max-width: min(370px, 92vw);
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  z-index: 2147483647;
  overflow: hidden;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
}

.tg-country-selector__panel[hidden] {
  display: none !important;
}

.tg-country-selector__panel-inner {
  width: 100%;
  background: #fff;
}

/* Desktop panel top */

.tg-country-selector__title {
  padding: 18px 18px 4px;
  margin: 0;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.tg-country-selector__note {
  padding: 0 18px 14px;
  margin: 0;
  max-width: 310px;
  color: #777;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

/* Desktop country list */

.tg-country-selector__list {
  max-height: 390px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  background: #fff;
}

.tg-country-selector__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 42px;
  padding: 10px 18px;
  margin: 0;
  cursor: pointer;
  background: #fff;
  border-bottom: 1px solid #f2f2f2;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  user-select: none;
  outline: none;
}

.tg-country-selector__option:last-child {
  border-bottom: 0;
}

.tg-country-selector__option:hover {
  background: #f7f7f7;
}

.tg-country-selector__option.is-active {
  background: #f2f2f2;
}

.tg-country-selector__option:focus-visible {
  outline: 1px solid #999;
  outline-offset: -3px;
}

.tg-country-selector__option.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.tg-country-selector__option-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 auto;
}

.tg-country-selector__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  font-size: 15px;
  line-height: 1;
}

.tg-country-selector__country {
  display: block;
  min-width: 0;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-country-selector__meta {
  display: block;
  flex: 0 0 auto;
  color: #777;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  text-align: right;
}

/* Desktop scrollbar */

.tg-country-selector__list::-webkit-scrollbar {
  width: 8px;
}

.tg-country-selector__list::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.tg-country-selector__list::-webkit-scrollbar-thumb {
  background: #cfcfcf;
}

.tg-country-selector__list::-webkit-scrollbar-thumb:hover {
  background: #b5b5b5;
}

/* ==================================================
   Mobile native selector
================================================== */

.tg-country-mobile {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-family: inherit;
  color: #111;
}

.tg-country-mobile__label {
  display: block;
  margin: 0 0 10px;
  color: #777;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tg-country-mobile__select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 36px 12px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background-color: #fff;
  color: #111;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.2;
  box-shadow: none;
  outline: none;
  appearance: auto;
  -webkit-appearance: menulist;
}

.tg-country-mobile__select:focus {
  border-color: #999;
  outline: none;
}

.tg-country-mobile.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ==================================================
   Elementor mobile menu wrapper control
================================================== */

@media (max-width: 767px) {
  .elementor-widget-shortcode:has(.tg-country-mobile),
  .elementor-widget-shortcode:has(.tg-country-mobile) .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ==================================================
   Responsive adjustments
================================================== */

@media (max-width: 767px) {
  .tg-country-selector {
    font-size: 12px;
  }

  .tg-country-selector__trigger {
    font-size: 12px;
  }

  .tg-country-selector__trigger-label {
    max-width: 145px;
  }

  .tg-country-selector__panel {
    width: min(340px, 92vw);
  }

  .tg-country-selector__title {
    padding: 16px 16px 4px;
  }

  .tg-country-selector__note {
    padding: 0 16px 12px;
  }

  .tg-country-selector__option {
    padding: 10px 16px;
  }

  .tg-country-selector__meta {
    font-size: 10px;
  }
}