/* =====================================================
   EA TECH — GLOBAL MARKET SELECTOR
   English / LTR Version
===================================================== */

:root {
  --ea-market-blue: #2367ff;
  --ea-market-sky: #2e9bff;
  --ea-market-cyan: #15ced4;
  --ea-market-dark: #0b2142;
  --ea-market-text: #60738e;
  --ea-market-border: #d8e6f5;
  --ea-market-light: #f6fbff;
  --ea-market-white: #ffffff;
}

/* =========================
   Header Trigger
========================= */

.ea-market-trigger {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid rgba(70, 128, 202, 0.2);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.9);
  color: #17345f;

  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;

  box-shadow: 0 10px 30px rgba(28, 79, 145, 0.09);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.ea-market-trigger:hover {
  transform: translateY(-2px);
  border-color: rgba(35, 103, 255, 0.38);
  box-shadow: 0 15px 36px rgba(28, 79, 145, 0.14);
}

.ea-market-trigger:focus-visible {
  outline: 3px solid rgba(35, 103, 255, 0.16);
  outline-offset: 3px;
}

.ea-market-flag {
  font-size: 16px;
  line-height: 1;
}

.ea-market-text {
  display: inline-flex;
  align-items: center;
}

/* Dark transparent header before scroll */
.site-header:not(.is-scrolled) .ea-market-trigger {
  background: rgba(6, 21, 49, 0.5);
  border-color: rgba(163, 198, 245, 0.22);
  color: #f3f8ff;
}

/* =========================
   Modal Overlay
========================= */

.ea-market-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;

  padding: 18px;
  display: grid;
  place-items: center;

  background: rgba(5, 20, 48, 0.38);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);

  overflow-y: auto;
  overscroll-behavior: contain;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.ea-market-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* =========================
   Modal Card
========================= */

.ea-market-card {
  position: relative;
  width: min(660px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);

  overflow-x: hidden;
  overflow-y: auto;

  border: 1px solid rgba(94, 147, 218, 0.22);
  border-radius: 28px;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.99),
      rgba(246, 251, 255, 0.98)
    );

  color: var(--ea-market-dark);
  text-align: left;

  box-shadow:
    0 35px 110px rgba(18, 58, 112, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);

  scrollbar-width: thin;
  scrollbar-color: #b7d5f3 transparent;

  transform: translateY(16px) scale(0.98);
  transition: transform 0.34s cubic-bezier(0.2, 0.75, 0.22, 1);
}

.ea-market-modal.is-open .ea-market-card {
  transform: translateY(0) scale(1);
}

.ea-market-card::-webkit-scrollbar {
  width: 6px;
}

.ea-market-card::-webkit-scrollbar-track {
  background: transparent;
}

.ea-market-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b7d5f3;
}

/* Decorative gradients */
.ea-market-card::before,
.ea-market-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.ea-market-card::before {
  width: 330px;
  height: 330px;
  top: -190px;
  left: -120px;

  background:
    radial-gradient(
      circle,
      rgba(35, 103, 255, 0.18),
      transparent 70%
    );
}

.ea-market-card::after {
  width: 310px;
  height: 310px;
  right: -140px;
  bottom: -190px;

  background:
    radial-gradient(
      circle,
      rgba(21, 206, 212, 0.18),
      transparent 70%
    );
}

/* =========================
   Modal Header
========================= */

.ea-market-head {
  position: sticky;
  top: 0;
  z-index: 10;

  min-height: 72px;
  padding: 15px 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  border-bottom: 1px solid #e6eff9;

  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ea-market-head img {
  display: block;
  width: auto;
  max-width: 140px;
  height: auto;
  max-height: 44px;

  object-fit: contain;
  object-position: left center;
}

.ea-market-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;

  display: grid;
  place-items: center;

  border: 1px solid #d7e5f5;
  border-radius: 50%;

  background: #ffffff;
  color: #17345f;

  font-size: 18px;
  line-height: 1;

  cursor: pointer;
  transition:
    transform 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.ea-market-close:hover {
  transform: rotate(90deg);
  color: #ffffff;
  border-color: var(--ea-market-blue);
  background: var(--ea-market-blue);
}

/* =========================
   Modal Content
========================= */

.ea-market-body {
  position: relative;
  z-index: 2;
  padding: 24px 26px 28px;
}

.ea-market-kicker {
  display: block;
  margin-bottom: 7px;

  color: var(--ea-market-blue);

  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ea-market-title {
  margin: 0 0 10px;

  color: #0b2142;

  font-size: clamp(27px, 3.4vw, 38px);
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.ea-market-copy {
  max-width: 590px;
  margin: 0 0 17px;

  color: var(--ea-market-text);

  font-size: 13px;
  line-height: 1.75;
}

/* Detected Country */
.ea-detected {
  min-height: 43px;
  margin-bottom: 17px;
  padding: 9px 12px;

  display: flex;
  align-items: center;
  gap: 9px;

  border: 1px solid #dbe9f8;
  border-radius: 13px;

  background:
    linear-gradient(
      120deg,
      #f5faff,
      #effcff
    );

  color: #2a4e78;

  font-size: 11px;
  font-weight: 700;
}

/* =========================
   Fields
========================= */

.ea-market-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.ea-market-field {
  min-width: 0;
}

.ea-market-field label {
  display: block;
  margin: 0 0 7px;

  color: #294c75;

  font-size: 11px;
  font-weight: 850;
}

.ea-market-select,
.ea-language-options {
  width: 100%;
  min-height: 48px;

  border: 1px solid var(--ea-market-border);
  border-radius: 13px;

  background: #ffffff;
  color: #0b2142;

  font-family: inherit;
  font-size: 12px;
}

.ea-market-select {
  padding: 0 13px;
  outline: none;
  cursor: pointer;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ea-market-select:hover,
.ea-market-select:focus {
  border-color: #78b9fb;
  box-shadow: 0 0 0 4px rgba(35, 103, 255, 0.08);
}

.ea-market-select optgroup {
  color: #1e4c7c;
  font-weight: 900;
}

.ea-language-options {
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.ea-language-options button {
  min-height: 38px;

  border: 0;
  border-radius: 9px;

  background: transparent;
  color: #60738e;

  font-family: inherit;
  font-size: 11px;
  font-weight: 850;

  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.ea-language-options button:hover {
  color: var(--ea-market-blue);
  background: #eff6ff;
}

.ea-language-options button.active {
  color: #ffffff;

  background:
    linear-gradient(
      110deg,
      var(--ea-market-blue),
      var(--ea-market-sky) 60%,
      var(--ea-market-cyan)
    );

  box-shadow: 0 8px 22px rgba(35, 103, 255, 0.2);
}

/* =========================
   Actions
========================= */

.ea-market-actions {
  margin-top: 17px;

  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.ea-market-continue,
.ea-market-global {
  min-height: 46px;
  padding: 0 20px;

  border-radius: 999px;

  font-family: inherit;
  font-size: 11px;
  font-weight: 850;

  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.ea-market-continue {
  border: 0;

  color: #ffffff;

  background:
    linear-gradient(
      110deg,
      var(--ea-market-blue),
      var(--ea-market-sky) 58%,
      var(--ea-market-cyan)
    );

  box-shadow: 0 13px 32px rgba(35, 103, 255, 0.23);
}

.ea-market-global {
  border: 1px solid #d5e4f4;

  background: #ffffff;
  color: #1c416f;
}

.ea-market-continue:hover,
.ea-market-global:hover {
  transform: translateY(-2px);
}

.ea-market-continue:hover {
  box-shadow: 0 17px 40px rgba(35, 103, 255, 0.31);
}

.ea-market-global:hover {
  border-color: #8bc4fa;
  box-shadow: 0 12px 28px rgba(32, 79, 138, 0.1);
}

.ea-market-note {
  margin: 12px 0 0;

  color: #8493a7;

  font-size: 9px;
  line-height: 1.65;
}

/* =========================
   Tablet
========================= */

@media (max-width: 991px) {
  .ea-market-trigger {
    min-height: 39px;
    padding: 0 11px;
  }

  .ea-market-trigger .ea-market-text {
    display: none;
  }

  .header-actions > .btn {
    display: none;
  }
}

/* =========================
   Mobile
========================= */

@media (max-width: 620px) {
  .ea-market-modal {
    padding: 8px;
    align-items: center;
  }

  .ea-market-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 21px;
  }

  .ea-market-head {
    min-height: 58px;
    padding: 10px 14px;
  }

  .ea-market-head img {
    max-width: 108px;
    max-height: 34px;
  }

  .ea-market-close {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 16px;
  }

  .ea-market-body {
    padding: 14px 15px 17px;
  }

  .ea-market-kicker {
    margin-bottom: 4px;
    font-size: 8px;
  }

  .ea-market-title {
    margin-bottom: 7px;
    font-size: 24px;
    line-height: 1.22;
  }

  .ea-market-copy {
    margin-bottom: 11px;
    font-size: 11px;
    line-height: 1.65;
  }

  .ea-detected {
    min-height: 38px;
    margin-bottom: 11px;
    padding: 7px 9px;
    font-size: 10px;
  }

  .ea-market-fields {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .ea-market-field label {
    margin-bottom: 5px;
    font-size: 10px;
  }

  .ea-market-select,
  .ea-language-options {
    min-height: 42px;
  }

  .ea-language-options button {
    min-height: 32px;
  }

  .ea-market-actions {
    margin-top: 11px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .ea-market-continue,
  .ea-market-global {
    width: 100%;
    min-height: 41px;
    padding: 0 10px;
    font-size: 10px;
  }

  .ea-market-note {
    display: none;
  }

  .ea-market-trigger {
    order: -1;
  }
}

/* Very Small Phones */
@media (max-width: 420px) {
  .ea-market-actions {
    grid-template-columns: 1fr;
  }

  .ea-market-title {
    font-size: 22px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .ea-market-trigger,
  .ea-market-card,
  .ea-market-close,
  .ea-market-continue,
  .ea-market-global {
    transition: none;
  }
}