/* Peaches Global Language System V12 — separate desktop and mobile header layouts */
#peaches-language-control {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  max-width: min(310px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(23,19,39,.96);
  color: #fff;
  font: 600 13px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  direction: ltr;
  box-sizing: border-box;
}
#peaches-language-control label { white-space: nowrap; }
#peaches-language-control select {
  width: auto;
  min-width: 112px;
  max-width: 160px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 6px 28px 6px 10px;
  background: #fff;
  color: #171327;
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
#peaches-language-status {
  position: fixed;
  right: 14px;
  bottom: 68px;
  z-index: 2147482999;
  max-width: min(330px, calc(100vw - 28px));
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(23,19,39,.96);
  color: #fff;
  font: 600 12px/1.35 system-ui,-apple-system,"Segoe UI",sans-serif;
  box-shadow: 0 8px 25px rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
  direction: ltr;
}
#peaches-language-status.show { opacity: 1; transform: translateY(0); }

#google_translate_element,
.goog-te-banner-frame,
.skiptranslate iframe,
body > .skiptranslate { display:none!important; }
body { top:0!important; }

/* Translation never owns header geometry. The website's existing responsive
   CSS remains the sole authority over the logo, top navigation and hamburger. */
.peaches-mobile-header-protected,
.peaches-mobile-header-protected * {
  direction: ltr !important;
}
.peaches-brand-protected,
.peaches-brand-protected * { overflow: visible !important; }

/* General translated content safety, without changing container geometry. */
html.peaches-translated body { overflow-x: clip; }
html.peaches-translated main,
html.peaches-translated section,
html.peaches-translated article,
html.peaches-translated .card,
html.peaches-translated [class*="card"] { min-width: 0 !important; }
html.peaches-translated .peaches-translation-heading {
  max-width: 100% !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}
html.peaches-translated .peaches-translation-control {
  box-sizing: border-box !important;
  line-height: 1.15 !important;
}

/* Arabic text reads RTL, while the physical website layout stays unchanged. */
html.peaches-arabic-language,
html.peaches-arabic-language body { direction: ltr !important; }
html.peaches-arabic-language main :where(h1,h2,h3,h4,h5,h6,p,li,label,span:not(.drawer-arrow),button,a,input,textarea,select,option),
html.peaches-arabic-language .drawer-panel :where(.drawer-title,.drawer-item > span:first-child) {
  direction: rtl;
  unicode-bidi: plaintext;
}
html.peaches-arabic-language header,
html.peaches-arabic-language header * { direction: ltr !important; }

/* More Options: long translations wrap inside their own row. */
html.peaches-translated .drawer-panel,
html.peaches-translated .drawer-list { overflow-x: hidden !important; }
html.peaches-translated .drawer-item,
html.peaches-translated .peaches-drawer-translation-safe {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 49px !important;
  padding: 12px 14px !important;
  white-space: normal !important;
  line-height: 1.25 !important;
  overflow: hidden !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  box-sizing: border-box !important;
}
html.peaches-translated .drawer-item > span:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
}
html.peaches-translated .drawer-item .drawer-arrow {
  flex: 0 0 auto !important;
  direction: ltr !important;
}

/* Never cover the More Options drawer. */
body.peaches-more-options-open #peaches-language-control,
body.peaches-more-options-open #peaches-language-status {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 600px) {
  #peaches-language-control {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 5px;
    max-width: 176px;
    padding: 7px 8px;
    border-radius: 18px;
  }
  #peaches-language-control label { display: none; }
  #peaches-language-control select {
    width: 128px;
    min-width: 0;
    max-width: 128px;
    height: 36px;
    font-size: 13px;
  }
  #peaches-language-status {
    right: 8px;
    bottom: 60px;
    max-width: calc(100vw - 16px);
  }
}

/* V12: controlled one-line header translations are desktop-only. */
@media (min-width: 601px) {
  header nav.top-nav-clean > a[data-peaches-controlled-label="true"] {
      white-space: nowrap !important;
      overflow: visible !important;
      text-overflow: clip !important;
      word-break: keep-all !important;
  }
  html.peaches-arabic-language header nav.top-nav-clean > a[data-peaches-controlled-label="true"] {
      direction: rtl !important;
      unicode-bidi: isolate !important;
  }
}

/* V10: desktop selector must remain visible. It is hidden only while the
   More Options drawer is confirmed visible by JavaScript. */
@media (min-width: 601px) {
  body:not(.peaches-more-options-open) #peaches-language-control {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}


/* V12: desktop header stays one line; mobile returns to the site's original responsive layout. */
@media (min-width: 601px) {
  header nav.top-nav-clean.peaches-mobile-header-protected,
  header .top-nav-clean.peaches-mobile-header-protected {
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    flex-wrap: nowrap !important;
    direction: ltr !important;
  }
  header nav.top-nav-clean.peaches-mobile-header-protected > a,
  header .top-nav-clean.peaches-mobile-header-protected > a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 600px) {
  header nav.top-nav-clean.peaches-mobile-header-protected,
  header .top-nav-clean.peaches-mobile-header-protected {
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    direction: ltr !important;
    overflow: visible !important;
  }
  header nav.top-nav-clean.peaches-mobile-header-protected > a,
  header .top-nav-clean.peaches-mobile-header-protected > a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}


/* V13 hard safety: modern browsers hide the selector directly whenever the
   More Options drawer or its overlay is open, even before JavaScript syncs. */
body:has(#drawerPanel.open) #peaches-language-control,
body:has(#drawerPanel.open) #peaches-language-status,
body:has(.drawer-panel.open) #peaches-language-control,
body:has(.drawer-panel.open) #peaches-language-status,
body:has(.drawer-overlay.open) #peaches-language-control,
body:has(.drawer-overlay.open) #peaches-language-status {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* V14 translation coverage + geometry safety. Dynamic controls are measured by
   JS when they appear. These rules prevent long translated words from escaping
   cards/buttons without redesigning the page. */
html.peaches-translated :where(main,section,article,.card,[class*="card"],.drawer-panel,.drawer-item) {
  min-width: 0 !important;
  max-width: 100%;
}
html.peaches-translated :where(p,li,label,.muted,.lead,.subtitle,.description) {
  overflow-wrap: break-word;
  word-break: normal;
}
html.peaches-translated .peaches-translation-control[data-peaches-overflow="true"] {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
@media (max-width: 600px) {
  html.peaches-translated :where(h1,h2,h3,h4) {
    max-width: 100% !important;
  }
}

/* Translation status always floats ABOVE the language selector, never over it. */
#peaches-language-status {
  bottom:86px!important;
  right:14px!important;
  left:auto!important;
  width:max-content;
  max-width:min(310px, calc(100vw - 28px))!important;
  box-sizing:border-box;
  overflow-wrap:anywhere;
  text-align:left;
}
@media(max-width:600px) {
 #peaches-language-status {
   bottom:78px!important;
   right:8px!important;
   max-width:calc(100vw - 16px)!important;
   font-size:12px;
 }
}
