/*
 * SXGC v1.64.0 — Country / Region selector refinement only.
 * Supports both WooCommerce Classic address forms and the current Checkout Block.
 * WooCommerce remains the source of truth for countries and shipping recalculation.
 */

/* ---------- Shared SelectWoo dropdown ---------- */
.select2-container--open .sxgc-country-dropdown .select2-search--hide,
.select2-container--open .select2-search--hide{
  display:block!important;
}
.select2-container--open .sxgc-country-dropdown .select2-search__field,
.select2-container--open .select2-search__field[data-sxgc-country-for]{
  width:100%!important;
  min-height:42px!important;
  margin:0!important;
  padding:9px 12px!important;
  box-sizing:border-box!important;
  border:1px solid var(--sxgc-border)!important;
  border-radius:8px!important;
  background:var(--sxgc-surface)!important;
  color:var(--sxgc-text)!important;
  font:inherit!important;
  font-size:13px!important;
  line-height:1.4!important;
  outline:none!important;
}
.select2-container--open .sxgc-country-dropdown .select2-search{
  display:block!important;
  padding:8px!important;
  background:var(--sxgc-surface)!important;
}
.select2-container--open .sxgc-country-dropdown{
  border:1px solid var(--sxgc-border)!important;
  border-radius:10px!important;
  overflow:hidden;
  background:var(--sxgc-surface)!important;
  box-shadow:0 12px 32px rgba(0,0,0,.09);
  z-index:100000!important;
}
.select2-container--open .sxgc-country-dropdown .select2-results__option{
  min-height:38px;
  padding:9px 12px!important;
  color:var(--sxgc-text);
  font-size:13px;
  line-height:1.45;
}

/* ---------- Classic WooCommerce country fields ---------- */
.woocommerce-checkout .sxgc-country-field .select2-container,
.woocommerce-account .sxgc-country-field .select2-container{
  width:100%!important;
  max-width:100%;
  vertical-align:top;
}

@media (min-width:1101px), (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  .woocommerce-checkout .sxgc-country-field .select2-selection--single,
  .woocommerce-account .sxgc-country-field .select2-selection--single{
    position:relative!important;
    display:block!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    border:1px solid var(--sxgc-border)!important;
    border-radius:9px!important;
    background:var(--sxgc-surface)!important;
    color:var(--sxgc-text)!important;
    box-shadow:none!important;
    outline:none!important;
  }

  .woocommerce-checkout .sxgc-country-field .select2-selection__rendered,
  .woocommerce-account .sxgc-country-field .select2-selection__rendered{
    display:block!important;
    width:100%!important;
    height:50px!important;
    min-height:50px!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:0 48px 0 18px!important;
    color:var(--sxgc-text)!important;
    font-size:13px!important;
    font-weight:400!important;
    line-height:50px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .woocommerce-checkout .sxgc-country-field .select2-selection__arrow,
  .woocommerce-account .sxgc-country-field .select2-selection__arrow{
    position:absolute!important;
    top:0!important;
    right:0!important;
    width:44px!important;
    height:50px!important;
    margin:0!important;
  }
  .woocommerce-checkout .sxgc-country-field .select2-selection__arrow b,
  .woocommerce-account .sxgc-country-field .select2-selection__arrow b{
    top:50%!important;
    left:50%!important;
    margin:0!important;
    transform:translate(-50%,-50%)!important;
  }

  .woocommerce-checkout .sxgc-country-field select.country_select:not(.select2-hidden-accessible),
  .woocommerce-account .sxgc-country-field select.country_select:not(.select2-hidden-accessible){
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    padding:0 48px 0 18px!important;
    border:1px solid var(--sxgc-border)!important;
    border-radius:9px!important;
    background:var(--sxgc-surface)!important;
    color:var(--sxgc-text)!important;
    font-size:13px!important;
    line-height:52px!important;
  }

  .woocommerce-checkout .sxgc-country-standard>label,
  .woocommerce-account .sxgc-country-standard>label{
    position:static!important;
    display:block!important;
    transform:none!important;
  }

  .woocommerce-checkout .sxgc-country-floating,
  .woocommerce-account .sxgc-country-floating{
    position:relative!important;
  }
  .woocommerce-checkout .sxgc-country-floating>label,
  .woocommerce-account .sxgc-country-floating>label{
    z-index:3!important;
    top:7px!important;
    left:18px!important;
    right:48px!important;
    width:auto!important;
    max-width:calc(100% - 66px)!important;
    margin:0!important;
    padding:0!important;
    color:var(--sxgc-text-muted)!important;
    font-size:10px!important;
    font-weight:500!important;
    line-height:1.1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    pointer-events:none!important;
  }
  .woocommerce-checkout .sxgc-country-floating .select2-selection__rendered,
  .woocommerce-account .sxgc-country-floating .select2-selection__rendered{
    padding-top:14px!important;
    line-height:36px!important;
  }
}

/* ---------- WooCommerce Checkout Block ----------
   v1.62 only targeted classic .country_select fields. The current live checkout
   in the reported screenshot is the React/Blocks checkout, so the component
   classes below are the actual field that must be normalized. */
@media (min-width:1101px), (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  .wc-block-checkout .wc-block-components-address-form__country{
    position:relative!important;
    min-width:0!important;
  }

  .wc-block-checkout .wc-block-components-address-form__country .wc-blocks-components-select,
  .wc-block-checkout .wc-block-components-address-form__country .wc-block-components-select{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    margin-top:0!important;
  }

  /* Native Blocks fallback: correct the same component even if JS/SelectWoo is
     unavailable. Keep the genuine WooCommerce label and country <select>. */
  .wc-block-checkout .wc-block-components-address-form__country .wc-blocks-components-select__select,
  .wc-block-checkout .wc-block-components-address-form__country .wc-block-components-select__select{
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:19px 48px 6px 18px!important;
    border:1px solid var(--sxgc-border)!important;
    border-radius:9px!important;
    background:var(--sxgc-surface)!important;
    color:var(--sxgc-text)!important;
    font-family:inherit!important;
    font-size:13px!important;
    font-weight:400!important;
    line-height:1.2!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .wc-block-checkout .wc-block-components-address-form__country .wc-blocks-components-select__label,
  .wc-block-checkout .wc-block-components-address-form__country .wc-block-components-select__label{
    position:absolute!important;
    z-index:3!important;
    top:7px!important;
    left:18px!important;
    right:48px!important;
    width:auto!important;
    max-width:calc(100% - 66px)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    color:var(--sxgc-text-muted)!important;
    font-family:inherit!important;
    font-size:10px!important;
    font-weight:500!important;
    line-height:1.1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    pointer-events:none!important;
  }

  .wc-block-checkout .wc-block-components-address-form__country .wc-blocks-components-select__expand,
  .wc-block-checkout .wc-block-components-address-form__country .wc-block-components-select__expand{
    position:absolute!important;
    top:50%!important;
    right:16px!important;
    left:auto!important;
    margin:0!important;
    transform:translateY(-50%)!important;
    pointer-events:none!important;
  }

  /* SelectWoo replaces only the visual control. The underlying React-controlled
     WooCommerce <select> remains the value/shipping source of truth. */
  .wc-block-checkout .sxgc-block-country-enhanced .wc-blocks-components-select__expand,
  .wc-block-checkout .sxgc-block-country-enhanced .wc-block-components-select__expand{
    display:none!important;
  }

  .wc-block-checkout .sxgc-block-country-enhanced .select2-container{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
  }

  .wc-block-checkout .sxgc-block-country-enhanced .select2-selection--single{
    position:relative!important;
    display:block!important;
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    margin:0!important;
    border:1px solid var(--sxgc-border)!important;
    border-radius:9px!important;
    background:var(--sxgc-surface)!important;
    color:var(--sxgc-text)!important;
    box-shadow:none!important;
    outline:none!important;
  }

  .wc-block-checkout .sxgc-block-country-enhanced .select2-selection__rendered{
    display:block!important;
    width:100%!important;
    height:50px!important;
    min-height:50px!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:22px 48px 6px 18px!important;
    color:var(--sxgc-text)!important;
    font-family:inherit!important;
    font-size:13px!important;
    font-weight:400!important;
    line-height:20px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .wc-block-checkout .sxgc-block-country-enhanced .select2-selection__arrow{
    position:absolute!important;
    top:0!important;
    right:0!important;
    width:44px!important;
    height:50px!important;
    margin:0!important;
  }
  .wc-block-checkout .sxgc-block-country-enhanced .select2-selection__arrow b{
    top:50%!important;
    left:50%!important;
    margin:0!important;
    transform:translate(-50%,-50%)!important;
  }

  .wc-block-checkout .sxgc-block-country-enhanced .select2-container--focus .select2-selection--single,
  .wc-block-checkout .sxgc-block-country-enhanced .select2-container--open .select2-selection--single{
    border-color:#aaa9a3!important;
  }
}

/* Mobile website is not redesigned. Only width guards are retained. */
@media (max-width:1100px) and (max-width:760px), (max-width:1100px) and (orientation:landscape){
  .woocommerce-checkout .sxgc-country-field .select2-container,
  .woocommerce-account .sxgc-country-field .select2-container,
  .wc-block-checkout .wc-block-components-address-form__country{
    width:100%!important;
    max-width:100%!important;
  }
  .woocommerce-checkout .sxgc-country-field .select2-selection__rendered,
  .woocommerce-account .sxgc-country-field .select2-selection__rendered{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}


/* ---------- v1.64 desktop dynamic State / Province / County selector ----------
   WooCommerce can inject this field after a country change (for example Germany).
   It is a separate address component from Country / Region, so it needs the same
   label/value/arrow geometry rather than a country-specific patch. */
@media (min-width:1101px), (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  .wc-block-checkout .wc-block-components-address-form__state,
  .wc-block-checkout .wc-block-components-address-form__state_or_county{
    position:relative!important;
    min-width:0!important;
  }

  .wc-block-checkout .wc-block-components-address-form__state .wc-blocks-components-select,
  .wc-block-checkout .wc-block-components-address-form__state .wc-block-components-select,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-blocks-components-select,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-block-components-select{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    margin-top:0!important;
  }

  .wc-block-checkout .wc-block-components-address-form__state .wc-blocks-components-select__select,
  .wc-block-checkout .wc-block-components-address-form__state .wc-block-components-select__select,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-blocks-components-select__select,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-block-components-select__select{
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:22px 48px 5px 18px!important;
    border:1px solid var(--sxgc-border)!important;
    border-radius:9px!important;
    background:var(--sxgc-surface)!important;
    color:var(--sxgc-text)!important;
    font-family:inherit!important;
    font-size:13px!important;
    font-weight:400!important;
    line-height:20px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .wc-block-checkout .wc-block-components-address-form__state .wc-blocks-components-select__label,
  .wc-block-checkout .wc-block-components-address-form__state .wc-block-components-select__label,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-blocks-components-select__label,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-block-components-select__label{
    position:absolute!important;
    z-index:3!important;
    top:7px!important;
    left:18px!important;
    right:48px!important;
    width:auto!important;
    max-width:calc(100% - 66px)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    color:var(--sxgc-text-muted)!important;
    font-family:inherit!important;
    font-size:10px!important;
    font-weight:500!important;
    line-height:1.1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    pointer-events:none!important;
  }

  .wc-block-checkout .wc-block-components-address-form__state .wc-blocks-components-select__expand,
  .wc-block-checkout .wc-block-components-address-form__state .wc-block-components-select__expand,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-blocks-components-select__expand,
  .wc-block-checkout .wc-block-components-address-form__state_or_county .wc-block-components-select__expand{
    position:absolute!important;
    top:50%!important;
    right:16px!important;
    left:auto!important;
    margin:0!important;
    transform:translateY(-50%)!important;
    pointer-events:none!important;
  }

  /* Classic Checkout / My Account address forms: the state selector uses the
     same native WooCommerce state_select control. No state list is hard-coded. */
  .woocommerce-checkout .sxgc-region-field .select2-container,
  .woocommerce-account .sxgc-region-field .select2-container{
    width:100%!important;
    max-width:100%;
    vertical-align:top;
  }

  .woocommerce-checkout .sxgc-region-field .select2-selection--single,
  .woocommerce-account .sxgc-region-field .select2-selection--single{
    position:relative!important;
    display:block!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    border:1px solid var(--sxgc-border)!important;
    border-radius:9px!important;
    background:var(--sxgc-surface)!important;
    color:var(--sxgc-text)!important;
    box-shadow:none!important;
  }

  .woocommerce-checkout .sxgc-region-field .select2-selection__rendered,
  .woocommerce-account .sxgc-region-field .select2-selection__rendered{
    display:block!important;
    width:100%!important;
    height:50px!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:22px 48px 6px 18px!important;
    color:var(--sxgc-text)!important;
    font-size:13px!important;
    line-height:20px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .woocommerce-checkout .sxgc-region-field .select2-selection__arrow,
  .woocommerce-account .sxgc-region-field .select2-selection__arrow{
    position:absolute!important;
    top:0!important;
    right:0!important;
    width:44px!important;
    height:50px!important;
  }

  .woocommerce-checkout .sxgc-region-field>label,
  .woocommerce-account .sxgc-region-field>label{
    z-index:3!important;
  }
}


/* SXGC 1.97.0 — global palette mapping only */
.select2-container--open .sxgc-country-dropdown,
.select2-container--open .sxgc-country-dropdown .select2-search,
.select2-container--open .sxgc-country-dropdown .select2-search__field,
.select2-container--open .sxgc-country-dropdown .select2-results__option,
.woocommerce-checkout .sxgc-country-field .select2-selection--single,
.woocommerce-account .sxgc-country-field .select2-selection--single,
.wc-block-checkout .wc-block-components-address-form__country .wc-blocks-components-select__select,
.wc-block-checkout .wc-block-components-address-form__country .wc-block-components-select__select{
  background:var(--sxgc-surface)!important;
  color:var(--sxgc-text)!important;
  border-color:var(--sxgc-border)!important;
}
.select2-container--open .sxgc-country-dropdown .select2-results__option--highlighted[aria-selected],
.select2-container--open .sxgc-country-dropdown .select2-results__option--highlighted[data-selected]{
  background:var(--sxgc-bg-alt)!important;
  color:var(--sxgc-text)!important;
}
.select2-container--open .sxgc-country-dropdown .select2-search__field:focus{border-color:var(--sxgc-accent)!important}


/* SXGC 1.98.0 — pure monochrome frontend palette only */
.select2-container--open .sxgc-country-dropdown,
.select2-container--open .sxgc-country-dropdown .select2-search,
.select2-container--open .sxgc-country-dropdown .select2-search__field,
.select2-container--open .sxgc-country-dropdown .select2-results__option,
.woocommerce-checkout .sxgc-country-field .select2-selection--single,
.woocommerce-account .sxgc-country-field .select2-selection--single,
.wc-block-checkout .wc-block-components-address-form__country .wc-blocks-components-select__select,
.wc-block-checkout .wc-block-components-address-form__country .wc-block-components-select__select{
  background:#FFFFFF!important;color:#111111!important;border-color:#DCDCDC!important;
}
.select2-container--open .sxgc-country-dropdown .select2-results__option--highlighted[aria-selected],
.select2-container--open .sxgc-country-dropdown .select2-results__option--highlighted[data-selected]{background:#F7F7F7!important;color:#111111!important}
.select2-container--open .sxgc-country-dropdown .select2-search__field:focus{border-color:#111111!important;outline-color:#111111!important}
