/* ——— Country picker (Canada / South Africa) ——— */

/* Until a South African visitor's prices are rewritten, hide the CAD fallback. */
html[data-region="ZA"] [data-cad]:not([data-price-region="ZA"]),
html[data-region="ZA"] [data-currency-code]:not([data-price-region="ZA"]) {
  visibility: hidden;
}

html:not([data-region]) body,
html[data-region-open] body {
  overflow: hidden;
}

.drs-region-gate {
  --rg-navy: #1d3347;
  --rg-btn: #1e4878;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #0f2232 center / cover no-repeat;
  font-family: var(--font-ng-body, Manrope, system-ui, sans-serif);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}

/* Poster only while the gate can be seen, so returning visitors never download it. */
html:not([data-region]) .drs-region-gate,
.drs-region-gate[data-open="true"] {
  background-image: url("/media/gate-mobile-v2.webp");
}

html[data-region] .drs-region-gate[data-open="false"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.drs-region-gate__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.drs-region-gate__video--desktop {
  display: none;
}

@media (min-width: 760px) {
  html:not([data-region]) .drs-region-gate,
  .drs-region-gate[data-open="true"] {
    background-image: url("/media/gate-desktop-v2.webp");
  }

  .drs-region-gate__video--mobile {
    display: none;
  }

  .drs-region-gate__video--desktop {
    display: block;
  }
}

.drs-region-gate__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 22, 34, 0.1) 0%, rgba(9, 22, 34, 0.18) 34%, rgba(9, 22, 34, 0.78) 68%, rgba(9, 22, 34, 0.94) 100%);
  pointer-events: none;
}

.drs-region-gate__close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(9, 22, 34, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.drs-region-gate__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
}

@media (max-width: 759px) {
  .drs-region-gate__shade {
    background:
      linear-gradient(180deg, rgba(9, 22, 34, 0.9) 0%, rgba(9, 22, 34, 0.62) 28%, rgba(9, 22, 34, 0.08) 48%, rgba(9, 22, 34, 0.12) 62%, rgba(9, 22, 34, 0.86) 100%);
  }

  .drs-region-gate__panel {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 100%;
    padding-top: calc(28px + env(safe-area-inset-top));
  }

  .drs-region-gate__logo {
    align-self: flex-start;
  }

  .drs-region-gate__options {
    margin-top: auto;
  }

  .drs-region-gate__lede {
    margin-bottom: 0;
  }
}

.drs-region-gate__logo {
  display: block;
  height: 20px;
  width: auto;
  margin-bottom: 22px;
}

.drs-region-gate__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.drs-region-gate__title {
  margin: 0;
  font-family: var(--font-ng-display, Manrope, system-ui, sans-serif);
  font-size: clamp(30px, 8.4vw, 54px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}

.drs-region-gate__lede {
  margin: 12px 0 22px;
  max-width: 46ch;
  font-size: 15.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.drs-region-gate__options {
  display: grid;
  gap: 10px;
}

.drs-region-gate__option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 18px 14px 14px;
  border: 0;
  border-radius: 18px;
  color: var(--rg-navy);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(4, 12, 20, 0.28);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.drs-region-gate__option:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(4, 12, 20, 0.34);
}

.drs-region-gate__option:active {
  transform: translateY(0) scale(0.99);
}

.drs-region-gate__option:focus-visible {
  outline: 3px solid #8fd3e8;
  outline-offset: 3px;
}

.drs-region-gate__option[data-current="true"] {
  box-shadow: 0 0 0 2px #8fd3e8, 0 10px 30px rgba(4, 12, 20, 0.28);
}

.drs-region-gate__flag {
  width: 44px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(13, 27, 40, 0.1);
}

.drs-region-gate__label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.drs-region-gate__label strong {
  font-family: var(--font-ng-display, Manrope, system-ui, sans-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.drs-region-gate__label small {
  font-size: 13px;
  color: #5b6b7a;
}

.drs-region-gate__arrow {
  color: var(--rg-btn);
  transition: transform 0.2s ease;
}

.drs-region-gate__option:hover .drs-region-gate__arrow {
  transform: translateX(3px);
}

.drs-region-gate__fine {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.66);
}

@keyframes drs-region-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

html:not([data-region]) .drs-region-gate__panel > *,
.drs-region-gate[data-open="true"] .drs-region-gate__panel > * {
  animation: drs-region-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.drs-region-gate__panel > :nth-child(2) { animation-delay: 0.05s; }
.drs-region-gate__panel > :nth-child(3) { animation-delay: 0.1s; }
.drs-region-gate__panel > :nth-child(4) { animation-delay: 0.15s; }
.drs-region-gate__panel > :nth-child(5) { animation-delay: 0.22s; }
.drs-region-gate__panel > :nth-child(6) { animation-delay: 0.3s; }

@media (min-width: 760px) {
  .drs-region-gate {
    align-items: flex-end;
  }

  .drs-region-gate__shade {
    background:
      linear-gradient(90deg, rgba(9, 22, 34, 0.9) 0%, rgba(9, 22, 34, 0.62) 38%, rgba(9, 22, 34, 0.08) 72%),
      linear-gradient(180deg, rgba(9, 22, 34, 0) 50%, rgba(9, 22, 34, 0.5) 100%);
  }

  .drs-region-gate__panel {
    max-width: 660px;
    padding: 0 56px 64px;
  }

  .drs-region-gate__logo {
    height: 24px;
    margin-bottom: 32px;
  }

  .drs-region-gate__lede {
    font-size: 17px;
    margin-bottom: 28px;
  }

  .drs-region-gate__options {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .drs-region-gate__close {
    top: 24px;
    right: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drs-region-gate,
  .drs-region-gate__option,
  .drs-region-gate__arrow {
    transition: none;
  }

  .drs-region-gate__panel > * {
    animation: none !important;
  }
}

/* ——— Mobile menu link ——— */
.drs-region-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 600 14px/1.2 var(--font-ng-body, Manrope, system-ui, sans-serif);
  cursor: pointer;
}

.drs-region-menu__change {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ——— Header country pill ——— */
.drs-region-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-width: 38px;
  padding: 0 10px;
  border: 1px solid rgba(15, 42, 71, 0.1);
  border-radius: 12px;
  color: var(--drs-pen-deep, #0f2a47);
  background: rgba(15, 42, 71, 0.04);
  font: 700 12px/1 var(--font-ng-body, Manrope, system-ui, sans-serif);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.drs-region-pill:hover {
  background: rgba(15, 42, 71, 0.08);
  border-color: rgba(15, 42, 71, 0.18);
}

.drs-region-pill:focus-visible {
  outline: 2px solid var(--drs-pen-light, #78aee4);
  outline-offset: 2px;
}

@media (max-width: 699px) {
  .drs-region-pill {
    min-width: 34px;
    padding: 0 6px;
  }

  .drs-region-pill [data-currency-code] {
    display: none;
  }
}

.drs-region-pill__flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
}

.drs-region-pill__flag--za,
html[data-region="ZA"] .drs-region-pill__flag--ca {
  display: none;
}

html[data-region="ZA"] .drs-region-pill__flag--za {
  display: inline-block;
}
