/**
 * ShopFluxx currency switcher — header dropdown.
 * Palette follows the brand: navy #0A3D91, accent #00AEEF.
 */

.sf-cur {
  position: relative;
  display: inline-block;
  font-size: 13px;
  line-height: 1;
}

/* The doubled class outranks Woodmart's flat grey header-button styling. */
.sf-cur .sf-cur__toggle,
.sf-cur .sf-cur__toggle:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid #d5dfee;
  border-radius: 6px;
  background: #fff;
  color: #0a3d91;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10, 61, 145, 0.06);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.sf-cur .sf-cur__toggle:hover,
.sf-cur.is-open .sf-cur__toggle {
  border-color: #0a3d91;
  background: #f4f8fd;
  box-shadow: 0 2px 6px rgba(10, 61, 145, 0.12);
}

.sf-cur__toggle:focus-visible {
  outline: 2px solid #00aeef;
  outline-offset: 2px;
}

/*
 * Locked (cart, checkout, account). The chip is still a live button — it opens
 * the reason it cannot be changed rather than swallowing the tap — so it keeps
 * the normal chip treatment instead of being greyed out like a dead control.
 */
.sf-cur__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  opacity: 0.7;
}

.sf-cur.is-locked .sf-cur__toggle:hover .sf-cur__info,
.sf-cur.is-locked.is-open .sf-cur__info {
  opacity: 1;
}

.sf-cur__why {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 999;
  width: 232px;
  max-width: min(232px, calc(100vw - 24px));
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dbe4f1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(10, 61, 145, 0.16), 0 2px 6px rgba(10, 61, 145, 0.08);
  color: #22303f;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
}

.sf-cur__why[hidden] {
  display: none;
}

.sf-cur__code {
  font-weight: 600;
  white-space: nowrap;
}

.sf-cur__caret {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.15s ease;
}

.sf-cur.is-open .sf-cur__caret {
  transform: rotate(180deg);
}

.sf-cur.is-locked .sf-cur__caret {
  display: none;
}

/* ------------------------------------------------------------------ menu */

.sf-cur__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 999;
  min-width: 132px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: #fff;
  border: 1px solid #dbe4f1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(10, 61, 145, 0.16), 0 2px 6px rgba(10, 61, 145, 0.08);
}

.sf-cur__menu[hidden] {
  display: none;
}

.sf-cur__menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sf-cur__menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  min-height: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #22303f;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sf-cur__menu button:hover {
  background: #eef5fd;
  color: #0a3d91;
}

.sf-cur__menu button:focus-visible {
  outline: 2px solid #00aeef;
  outline-offset: -2px;
}

.sf-cur__menu button[aria-selected='true'] {
  background: rgba(0, 174, 239, 0.12);
  color: #0a3d91;
  font-weight: 600;
}

.sf-cur__opt-code {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- notices */

.sf-cur-banner {
  padding: 9px 16px;
  background: #e8f4fd;
  border-bottom: 1px solid #cfe6fa;
  color: #0a3d91;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.sf-cur-note {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #e8f4fd;
  border-left: 3px solid #00aeef;
  border-radius: 4px;
  color: #0a3d91;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 767px) {
  /* The header instance is right-aligned below; this is for the nav one. */
  .sf-cur:not(.sf-cur--mobile) .sf-cur__menu {
    right: auto;
    left: 0;
    min-width: 110px;
  }

  .sf-cur-banner {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ---------------------------------------------------- mobile / tablet header
 *
 * Below 1025px Woodmart hides the whole desktop column the switcher's nav item
 * lives in, so the control was off screen on every phone and tablet. The JS
 * wraps the mobile search field and the second instance in .sf-cur-mrow; this
 * lays that row out — search takes the remaining width on the left, the
 * currency chip is a fixed slice on the right.
 *
 * The !important declarations are answering the ones in header-1688-cta.css,
 * which pins the search field to width:100% / flex:0 0 auto so its own button
 * can sit on a line of its own underneath. Both controls still get what they
 * want: search + currency on row one, the 1688 button on row two.
 */
@media (max-width: 1024px) {
  .sf-cur-mrow {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    flex: 0 0 auto !important;
  }

  .whb-column.sf-cur-has-mrow {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Four classes deliberately: header-1688-cta.css pins this element with
   * `.whb-column.sf1688-has-mobile-cta .wd-header-search-form-mobile`, also
   * !important, so anything shorter loses on specificity and the search box
   * stays 100% wide with the currency chip pushed off screen. */
  .whb-column.sf-cur-has-mrow .sf-cur-mrow > .wd-search-form {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .sf-cur-mrow > .sf-cur--mobile {
    display: block !important;
    flex: 0 0 24%;
    min-width: 78px;
    max-width: 104px;
  }

  /* Match the search field: same height, same pill. */
  .sf-cur--mobile .sf-cur__toggle {
    width: 100%;
    height: 42px;
    padding: 0 8px;
    border-radius: 999px;
  }

  /* Anchored to the right edge — a left-anchored panel runs off screen. */
  .sf-cur--mobile .sf-cur__menu,
  .sf-cur--mobile .sf-cur__why {
    right: 0;
    left: auto;
  }

  .sf-cur--mobile .sf-cur__menu {
    min-width: 118px;
  }
}

/* Desktop keeps the nav-menu instance; the header clone is Woodmart's own
 * mobile column and is already display:none up here, but say so anyway. */
@media (min-width: 1025px) {
  .sf-cur--mobile,
  .sf-cur-mrow > .sf-cur--mobile {
    display: none !important;
  }
}
