/* =========================
   STRIVIOS – Country Filter
   File: assets/filter.css
   ========================= */

/* ---- Tokens (fallbacks if hero tokens not present) ---- */
:root {
  --strv-text: #e7e9ee;
  --strv-muted: #bfc6d1;
  --strv-cyan: #22d3ee;
  --strv-purple: #818cf8;
  --strv-panel: rgba(10, 12, 22, .36);
  --strv-stroke: rgba(255,255,255,.10);
  --strv-shadow: 0 12px 48px rgba(0,0,0,.45);
  --strv-radius: 16px;
  --strv-pad-y: 10px;
  --strv-pad-x: 12px;
  --strv-gap: 12px;
}

/* A11y helper (same as WP) */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Bar container ---- */
.strivios-country-filter {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--strv-gap);
  padding: 12px;
  border-radius: var(--strv-radius);
  color: var(--strv-text);
  background:
    linear-gradient(180deg, rgba(129,140,248,.08), rgba(34,211,238,.06)) 0 0/100% 100%,
    var(--strv-panel);
  border: 1px solid var(--strv-stroke);
  box-shadow: var(--strv-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Optional sticky variant (add .is-sticky from Elementor or template if you want) */
.strivios-country-filter.is-sticky {
  position: sticky;
  top: clamp(8px, 1.5vw, 16px);
  z-index: 20;
}

/* Tablet & desktop: one line, 50/50 */
@media (min-width: 768px) {
  .strivios-country-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--strv-gap);
    align-items: center;
  }
  .strivios-country-filter > * {
    min-width: 0;   /* prevent overflow */
    width: 100%;
  }
}

/* Mobile: stack */
@media (max-width: 767px) {
  .strivios-country-filter {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--strv-gap);
  }
  .strivios-country-filter > * {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .strivios-country-filter .strivios-reset {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* ---- Selects (native, but styled) ---- */
.strivios-country-filter select {
  -webkit-appearance: none;
  appearance: none;
  font: 600 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  color: var(--strv-text);
  background:
    /* chevron */ url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 24 24'>\
<path d='M6 9l6 6 6-6' stroke='%23e7e9ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>") right 12px center / 18px 18px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--strv-stroke);
  border-radius: 9999px;
  padding: var(--strv-pad-y) 40px var(--strv-pad-y) var(--strv-pad-x);
  min-height: 40px;
  min-width: 220px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

/* Hover & focus states */
.strivios-country-filter select:hover {
  border-color: rgba(255,255,255,.18);
}
.strivios-country-filter select:active {
  transform: translateY(1px);
}
.strivios-country-filter select:focus,
.strivios-country-filter select:focus-visible {
  outline: none;
  border-color: rgba(255,255,255,.24);
  box-shadow:
    0 0 0 3px rgba(34,211,238,.18),
    0 0 0 1px rgba(129,140,248,.25) inset;
}

/* Placeholder/“All countries” subtle tone when empty */
.strivios-country-filter select option[value=""] {
  color: var(--strv-muted);
}

/* ---- Sort select (works automatically if you add it) ---- */
#strivios-sort-select {
  min-width: 220px; /* same look as country */
}

/* ---- Reset button (optional) ---- */
.strivios-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid var(--strv-stroke);
  background:
    linear-gradient(180deg, rgba(34,211,238,.14), rgba(129,140,248,.10));
  color: var(--strv-text);
  font: 600 13px/1 system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease, opacity .15s ease;
}
.strivios-reset:hover {
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 2px rgba(34,211,238,.15);
}
.strivios-reset:active { transform: translateY(1px); }
.strivios-reset:disabled { opacity: .5; cursor: not-allowed; }

/* Inline “x” icon (only if you add <span class="x">) */
.strivios-reset .x {
  display: inline-block;
  width: 14px; height: 14px;
  mask: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
<path d='M18 6L6 18M6 6l12 12' stroke='black' stroke-width='2' stroke-linecap='round'/>\
</svg>") center/contain no-repeat;
  background: currentColor;
}

/* ---- Tiny count bubbles next to labels (if you ever add them) ---- */
.strivios-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  font: 700 12px/1 system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  color: #0b1220;
  background: linear-gradient(180deg, #22d3ee, #60a5fa);
  box-shadow: 0 6px 16px rgba(34,211,238,.35);
}

/* ---- Loading state hook (if JS adds .is-loading) ---- */
.strivios-country-filter.is-loading::after {
  content: "";
  width: 18px; height: 18px;
  margin-left: 2px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: var(--strv-cyan);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Light mode adjustments (if site uses light theme) ---- */
@media (prefers-color-scheme: light) {
  .strivios-country-filter {
    color: #0b1220;
    background:
      linear-gradient(180deg, rgba(129,140,248,.10), rgba(34,211,238,.08)),
      rgba(255,255,255,.7);
    border-color: rgba(0,0,0,.06);
  }
  .strivios-country-filter select {
    color: #0b1220;
    border-color: rgba(0,0,0,.08);
    background-image:
      url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 24 24'>\
<path d='M6 9l6 6 6-6' stroke='%230b1220' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>"),
      linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.01));
  }
  .strivios-reset { color: #0b1220; }
}


