/* Specificity correction for the experimental layout-only v1. The live v8
   stylesheet has stricter !important rules for the shared language switcher.
   This file must be loaded AFTER the v1 candidate during QA. */

body:has(#vobomConsentV201:not(.is-open)):has(#siteNav)
  .vobom-language-switcher.vobom-language-switcher,
body:has(#vobomConsentV201.is-open):has(#siteNav)
  .vobom-language-switcher.vobom-language-switcher,
body.vobom-furniture-sprint:has(#vobomConsentV201:not(.is-open)):has(#vobom-furniture-buyer-nav)
  .vobom-language-switcher.vobom-language-switcher,
body:has(#vobomConsentV201:not(.is-open)):has(#vobom-moto-buyer-nav)
  .vobom-language-switcher.vobom-language-switcher,
body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page):has(.trust)
  .vobom-language-switcher.vobom-language-switcher {
  position: absolute !important;
}

/* Reserve an empty row on the narrow VOBOM homepage so the language selector
   does not cover the first headline. This changes only layout spacing. */
@media (max-width: 430px) {
  body:has(#siteNav):has(#vobomConsentV201:not(.is-open)) .site-shell > main,
  body:has(#siteNav):has(#vobomConsentV201.is-open) .site-shell > main {
    padding-top: 44px !important;
  }

  body:has(#vobomConsentV201:not(.is-open)):has(#siteNav)
    .vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(#siteNav)
    .vobom-language-switcher.vobom-language-switcher {
    top: 82px !important;
    right: 10px !important;
  }
}

/* Pin shared language controls to the clear upper-right header band. These
   more-specific selectors override the legacy fixed offsets without changing
   type, image dimensions, or content widths. */
@media (max-width: 1300px) {
  body:has(#vobomConsentV201:not(.is-open)):has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201:not(.is-open)):has(#vobom-furniture-buyer-nav) .vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(#vobom-furniture-buyer-nav) .vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page):has(.trust) .vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(.product-detail-page):has(.trust) .vobom-language-switcher.vobom-language-switcher {
    top: 4px !important;
    right: 8px !important;
  }
}

/* On the 901-1100px motorcycle header, keep the control in the first reserved
   area below the top navigation; the CTA/navigation row occupies the right. */
@media (min-width: 901px) and (max-width: 1100px) {
  body:has(#vobomConsentV201:not(.is-open)):has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 145px !important;
    left: 8px !important;
    right: auto !important;
  }
}

/* These fallbacks also cover routes where the consent manager removes its DOM
   after the visitor has saved a choice. */
@media (max-width: 900px) {
  body:has(#vobomConsentV201:not(.is-open)):has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobom-moto-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201:not(.is-open)):has(#vobom-furniture-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(#vobom-furniture-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobom-furniture-buyer-nav) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 4px !important;
    left: auto !important;
    right: 8px !important;
  }

}

/* Packaging product pages have a full-width announcement at the very top.
   Reserve a language row after the search/header instead of covering that
   announcement, the RFQ chip, or the search button. */
@media (max-width: 360px) {
  body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 222px !important;
    left: auto !important;
    right: 8px !important;
  }

  body:has(.product-detail-page) main.product-detail-page {
    padding-top: 56px !important;
  }
}

@media (min-width: 361px) and (max-width: 430px) {
  body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 208px !important;
    left: auto !important;
    right: 8px !important;
  }

  body:has(.product-detail-page) main.product-detail-page {
    padding-top: 56px !important;
  }
}

@media (min-width: 431px) and (max-width: 900px) {
  body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 190px !important;
    left: auto !important;
    right: 8px !important;
  }

  body:has(.product-detail-page) main.product-detail-page {
    padding-top: 56px !important;
  }
}

@media (min-width: 901px) and (max-width: 1300px) {
  body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page):has(.trust) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(.product-detail-page):has(.trust) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(.product-detail-page):has(.trust) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 202px !important;
    left: auto !important;
    right: 8px !important;
  }
}

@media (min-width: 1301px) {
  body:has(#vobomConsentV201:not(.is-open)):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(#vobomConsentV201.is-open):has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher,
  body:has(.product-detail-page) .vobom-language-switcher.vobom-language-switcher.vobom-language-switcher {
    top: 196px !important;
    left: auto !important;
    right: 18px !important;
  }

  body:has(.product-detail-page) main.product-detail-page {
    padding-top: 56px !important;
  }
}
