/* Country flag dropdown (shortcode + Elementor) — slim, theme-resistant */

.cc-flagdd {
  position: relative;
  display: inline-block;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
  box-sizing: border-box;
}
.cc-flagdd *,
.cc-flagdd *::before,
.cc-flagdd *::after {
  box-sizing: border-box;
}

/* Uploaded flags: never let theme img rules blow them up */
.cc-flagdd__img {
  display: block;
  width: 22px;
  height: 16px;
  max-width: 22px;
  max-height: 16px;
  object-fit: cover;
  object-position: center;
  border-radius: 3px;
  flex-shrink: 0;
}

.cc-flagdd__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  /* Slightly off-white fill; border stays the same as before */
  background: #f9f8fa;
  border: 1px solid var(--cc-primary, rgb(100, 9, 58));
  border-radius: 9px;
  cursor: pointer;
  color: inherit;
  padding: 7px 11px;
  min-height: 38px;
  min-width: 0;
  line-height: 1;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cc-flagdd__btn:hover {
  border-color: var(--cc-primary, rgb(100, 9, 58)) !important;
}
.cc-flagdd__btn:focus {
  outline: none;
  border-color: var(--cc-primary, rgb(100, 9, 58));
}

/* Emoji flag */
.cc-flagdd__flag {
  font-size: 19px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.cc-flagdd__chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}
.cc-flagdd__chev svg {
  width: 11px;
  height: 11px;
  display: block;
}
.cc-flagdd.is-open .cc-flagdd__chev {
  transform: rotate(180deg);
}
/* Keep opener clean when panel is open (no theme “pressed” fill) */
.cc-flagdd.is-open .cc-flagdd__btn {

}

.cc-flagdd__panel {
  position: fixed;
  width: auto;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(100, 9, 58, 0.35);
  border-radius: 10px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.12);
  padding: 4px;
  display: none;
  z-index: 99999;
  transform-origin: top left;
}
.cc-flagdd.is-open .cc-flagdd__panel {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  /* Never rely on opacity in animation — themes often break animations and leave panel invisible */
  opacity: 1 !important;
  visibility: visible !important;
  animation: ccFlagDdIn 0.14s ease-out;
}
@keyframes ccFlagDdIn {
  from {
    transform: translateY(-4px) scale(0.99);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

/* Panel content must stay visible (themes: button img, opacity, filters) */
.cc-flagdd__panel .cc-flagdd__item {
  color: inherit !important;
  filter: none !important;
  -webkit-filter: none !important;
}
.cc-flagdd__panel .cc-flagdd__img {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  flex-shrink: 0 !important;
}
.cc-flagdd__panel .cc-flagdd__flag {
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-flex !important;
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

.cc-flagdd__item {
  border: 0;
  background: transparent !important;
  border-radius: 8px;
  padding: 8px 6px;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  gap: 0;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.cc-flagdd__item .cc-flagdd__img {
  width: 22px;
  height: 16px;
  max-width: 22px;
  max-height: 16px;
}
.cc-flagdd__item .cc-flagdd__flag {
  font-size: 19px;
  width: 22px;
  height: 22px;
}
.cc-flagdd__item + .cc-flagdd__item {
  border-top: 1px solid rgba(100, 9, 58, 0.1);
}
/* Row hover / focus: no purple fill — border / accent only (matches selected-flag chip look) */
.cc-flagdd__item:hover:not(:disabled):not(.is-disabled) {
  background: transparent !important;
}
.cc-flagdd__item:focus {
  outline: none;
}
.cc-flagdd__item:focus-visible:not(:disabled):not(.is-disabled) {
  background: transparent !important;
  box-shadow: inset 0 0 0 2px rgba(100, 9, 58, 0.4);
}
/* Selected row: no full-row tint — highlight only the flag (image or emoji) */
.cc-flagdd__item.is-selected:not(.is-disabled) {
  background: transparent !important;
  box-shadow: none;
}
.cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__img {
  background: transparent !important;
  border: 1px solid rgba(100, 9, 58, 0.32) !important;
  border-radius: 6px;
  padding: 4px;
  box-sizing: content-box;
}
.cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__flag {
  background: transparent !important;
  border: 1px solid rgba(100, 9, 58, 0.32) !important;
  border-radius: 6px;
  padding: 4px;
  box-sizing: content-box;
  width: auto !important;
  height: auto !important;
  min-width: 1.2em;
  min-height: 1.2em;
}
.cc-flagdd__item.is-selected:hover:not(:disabled):not(.is-disabled) .cc-flagdd__img,
.cc-flagdd__item.is-selected:hover:not(:disabled):not(.is-disabled) .cc-flagdd__flag {
  background: transparent !important;
  border-color: rgba(100, 9, 58, 0.55) !important;
}
/* Don’t paint full-row hover stripe on the current selection — only the flag chip above */
.cc-flagdd__item.is-selected:hover:not(:disabled):not(.is-disabled) {
  background: transparent !important;
  box-shadow: none !important;
}
.cc-flagdd__item.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cc-flagdd__item.is-disabled:hover {
  background: transparent !important;
  box-shadow: none !important;
}

/* Size variants */
.cc-flagdd--sm .cc-flagdd__btn {
  padding: 6px 10px;
  min-height: 36px;
  gap: 6px;
  border-radius: 8px;
}
.cc-flagdd--sm .cc-flagdd__img,
.cc-flagdd--sm .cc-flagdd__item .cc-flagdd__img {
  width: 20px;
  height: 14px;
  max-width: 20px;
  max-height: 14px;
}
.cc-flagdd--sm .cc-flagdd__flag,
.cc-flagdd--sm .cc-flagdd__item .cc-flagdd__flag {
  font-size: 17px;
  width: 20px;
  height: 20px;
}
.cc-flagdd--sm .cc-flagdd__chev svg {
  width: 10px;
  height: 10px;
}
.cc-flagdd--sm .cc-flagdd__panel {
  padding: 5px;
  border-radius: 9px;
}
.cc-flagdd--sm .cc-flagdd__item {
  padding: 7px 5px;
}
.cc-flagdd--sm .cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__img,
.cc-flagdd--sm .cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__flag {
  padding: 3px;
  border-radius: 5px;
}

.cc-flagdd--md .cc-flagdd__btn {
  padding: 8px 12px;
  min-height: 42px;
  gap: 7px;
}
.cc-flagdd--md .cc-flagdd__img,
.cc-flagdd--md .cc-flagdd__item .cc-flagdd__img {
  width: 24px;
  height: 17px;
  max-width: 24px;
  max-height: 17px;
}
.cc-flagdd--md .cc-flagdd__flag,
.cc-flagdd--md .cc-flagdd__item .cc-flagdd__flag {
  font-size: 21px;
  width: 24px;
  height: 24px;
}
.cc-flagdd--md .cc-flagdd__chev svg {
  width: 11px;
  height: 11px;
}
.cc-flagdd--md .cc-flagdd__item {
  padding: 9px 6px;
}
.cc-flagdd--md .cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__img,
.cc-flagdd--md .cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__flag {
  padding: 5px;
  border-radius: 7px;
}

.cc-flagdd--lg .cc-flagdd__btn {
  padding: 10px 14px;
  min-height: 48px;
  gap: 9px;
  border-radius: 11px;
}
.cc-flagdd--lg .cc-flagdd__img,
.cc-flagdd--lg .cc-flagdd__item .cc-flagdd__img {
  width: 28px;
  height: 20px;
  max-width: 28px;
  max-height: 20px;
}
.cc-flagdd--lg .cc-flagdd__flag,
.cc-flagdd--lg .cc-flagdd__item .cc-flagdd__flag {
  font-size: 24px;
  width: 28px;
  height: 28px;
}
.cc-flagdd--lg .cc-flagdd__chev svg {
  width: 13px;
  height: 13px;
}
.cc-flagdd--lg .cc-flagdd__item {
  padding: 10px 8px;
}
.cc-flagdd--lg .cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__img,
.cc-flagdd--lg .cc-flagdd__item.is-selected:not(.is-disabled) .cc-flagdd__flag {
  padding: 5px;
  border-radius: 8px;
}
