/* English candidate: menus open only through hover or an explicit toggle.
   Esc keeps focus on the control while this class hides its panel. */
@media (min-width: 981px) {
  html[lang="ru"] .gp-primary-nav .gp-nav-item:focus-within:not(.is-open):not(:hover) > .gp-nav-menu,
  html[lang="ru"] .gp-primary-nav .gp-nav-item.gp-nav-force-closed > .gp-nav-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(7px);
  }
}


/* gp-en-context-subnav-20260918: align English section navigation with the approved Chinese pattern. */
html[lang="ru"] .gp-context-subnav-shell {
  position: sticky;
  top: 0;
  z-index: 19;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(184, 138, 67, .3);
  background: rgba(14, 16, 15, .97);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

@media (min-width: 981px) {
  html[lang="ru"] .gp-context-subnav-shell { top: 0; }
}

html[lang="ru"] .gp-context-subnav {
  display: flex;
  justify-content: center;
  max-width: 1380px;
  margin: 0 auto;
}

html[lang="ru"] .gp-context-subnav a {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 18px;
  border-right: 1px solid rgba(255, 255, 255, .08);
  color: #d8b272;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

html[lang="ru"] .gp-context-subnav a:last-child { border-right: 0; }
html[lang="ru"] .gp-context-subnav a:hover,
html[lang="ru"] .gp-context-subnav a:focus-visible,
html[lang="ru"] .gp-context-subnav a.is-current,
html[lang="ru"] .gp-context-subnav a[aria-current="page"] {
  color: #d8b272;
  background: transparent;
}

html[lang="ru"] .gp-context-subnav a.is-current::after,
html[lang="ru"] .gp-context-subnav a[aria-current="page"]::after,
html[lang="ru"] .gp-context-subnav a:hover::after,
html[lang="ru"] .gp-context-subnav a:focus-visible::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  background: #d8b272;
}

@media (max-width: 760px) {
  html[lang="ru"] .gp-context-subnav-shell { padding: 0; overflow: hidden; }
  html[lang="ru"] .gp-context-subnav {
    justify-content: flex-start;
    max-width: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  html[lang="ru"] .gp-context-subnav a {
    flex: 0 0 auto;
    min-width: 150px;
    min-height: 48px;
    padding: 9px 14px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
}

/* gp-en-factory-company-profile-20260919: keep the awards display prominent and let the longer English introduction scroll within its own column. */
@media (min-width: 741px) {
  html[lang="ru"] body.support-factory .company-profile-intro {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: clamp(24px, 3vw, 48px);
  }

  html[lang="ru"] body.support-factory .company-profile-copy {
    height: clamp(250px, 30vw, 360px);
    overflow-y: scroll;
    scrollbar-gutter: stable;
    padding-right: 12px;
  }

  html[lang="ru"] body.support-factory .company-profile-awards {
    width: 100%;
    margin: 0;
  }

  html[lang="ru"] body.support-factory .company-profile-awards img {
    display: block;
    width: 100%;
    height: auto;
  }
}

@media (max-width: 980px) {
  html[lang="ru"] body.support-factory .company-profile-awards {
    width: 100%;
    margin-top: 24px;
  }

  html[lang="ru"] body.support-factory .company-profile-awards img {
    display: block;
    width: 100%;
    height: auto;
  }
}

@media (max-width: 740px) {
  html[lang="ru"] body.support-factory .company-profile-copy {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
}

/* gp-en-context-menu-clearance-20260919: keep every English contextual secondary navigation visible while a desktop primary-nav panel is open. */
@media (min-width: 981px) {
  html[lang="ru"] body:has(.gp-context-subnav-shell) .gp-primary-nav .gp-nav-item:is(.is-open, :hover, :focus-within) > .gp-nav-menu {
    top: calc(100% + 121px);
  }

  /* This invisible child spans the contextual row, so pointer travel from the primary control to its panel never closes the menu. */
  html[lang="ru"] body:has(.gp-context-subnav-shell) .gp-primary-nav .gp-nav-item:is(.is-open, :hover, :focus-within) > .gp-nav-menu::before {
    content: "";
    position: absolute;
    top: -121px;
    right: 0;
    left: 0;
    height: 121px;
  }
}

/* gp-en-company-intro-complete-20260919: do not clip the full company introduction on desktop. */
@media (min-width: 741px) {
  html[lang="ru"] body.support-factory .company-profile-copy {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
html[lang="ru"] body.support-factory #company-profile {
  scroll-margin-top: 154px;
}
/* gp-ru-navigation-stability-20260920-start */
/* The publisher-home theme otherwise replaces the dark-header menu label with dark ink. */
html[lang="ru"] .site-header .nav-toggle {
  color: #d8b272;
  border-color: rgba(216, 178, 114, .7);
}

/* Decorative image bleed must not create a horizontal page scroll on small screens. */
html[lang="ru"] body.publisher-home > main { overflow-x: clip; }

/* Keep the primary menu above contextual rows; do not detach its panel below them. */
@media (min-width: 981px) {
  html[lang="ru"] .site-header { z-index: 100; }
  html[lang="ru"] .gp-primary-nav .gp-nav-menu { z-index: 101; }
  html[lang="ru"] body:has(.gp-context-subnav-shell) .gp-primary-nav .gp-nav-item:is(.is-open, :hover, :focus-within) > .gp-nav-menu {
    top: calc(100% + 10px);
  }
  html[lang="ru"] body:has(.gp-context-subnav-shell) .gp-primary-nav .gp-nav-item:is(.is-open, :hover, :focus-within) > .gp-nav-menu::before {
    display: none;
  }
}

/* Russian desktop labels need more room than the inherited 980px breakpoint allows. */
@media (min-width: 981px) and (max-width: 1060px) {
  html[lang="ru"] .site-header { padding: 10px 16px; }
  html[lang="ru"] .site-header .brand img { width: 132px; }
  html[lang="ru"] .site-header .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 38px;
    color: #d8b272;
    border-color: rgba(216, 178, 114, .7);
  }
  html[lang="ru"] .gp-primary-nav { display: none; }
  html[lang="ru"] .gp-primary-nav.is-open {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 101;
    display: block;
    padding: 10px 16px;
    background: #171713;
  }
  html[lang="ru"] .gp-primary-nav .gp-nav-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
  }
  html[lang="ru"] .gp-primary-nav .gp-nav-link {
    min-height: 46px;
    padding-inline: 12px;
  }
  html[lang="ru"] .gp-primary-nav .gp-nav-toggle { width: 46px; }
  html[lang="ru"] .gp-primary-nav .gp-nav-menu {
    position: static;
    width: auto;
    margin: 0 0 8px;
    display: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
  }
  html[lang="ru"] .gp-primary-nav .gp-nav-item.is-open > .gp-nav-menu { display: block; }
}

/* Russian labels make the inherited five-column, two-row grid visually heavy.
   Keep the product categories in one compact, discoverable horizontal strip. */
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell {
  position: relative;
  z-index: 20;
  padding: 0;
  overflow: hidden;
  background: rgba(14, 16, 15, .97);
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell::after {
  content: "›";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  width: 34px;
  place-items: center;
  color: #f6d18a;
  background: linear-gradient(90deg, rgba(14, 16, 15, 0), rgba(14, 16, 15, .98) 42%);
  font-size: 22px;
  pointer-events: none;
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav {
  display: flex;
  flex-wrap: nowrap;
  max-width: none;
  margin: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav::-webkit-scrollbar { display: none; }
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 46px;
  padding: 0 20px;
  border-right: 1px solid rgba(255, 255, 255, .10);
  border-bottom: 0;
  color: #d8b272;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  scroll-snap-align: start;
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:nth-child(5n),
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:nth-child(-n+5) { border-bottom: 0; }
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a[aria-current="page"] {
  color: #f6d18a;
  background: rgba(216, 178, 114, .10);
  box-shadow: inset 0 -3px 0 #d8b272;
}
@media (max-width: 760px) {
  html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a {
    min-width: 142px;
    padding: 0 16px;
  }
}

/* Make the complete book directory available from the primary Products hover menu too. */
html[lang="ru"] .gp-nav-item--book-directory .gp-nav-book-category-group {
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(216, 178, 114, .28);
}
html[lang="ru"] .gp-nav-item--book-directory .gp-nav-book-category-label {
  display: block;
  margin-bottom: 5px;
  color: #d8b272;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
html[lang="ru"] .gp-nav-item--book-directory .gp-nav-book-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 4px;
}
html[lang="ru"] .gp-nav-item--book-directory .gp-nav-book-category-grid a {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: #f6f2e9;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}
html[lang="ru"] .gp-nav-item--book-directory .gp-nav-book-category-grid a:hover,
html[lang="ru"] .gp-nav-item--book-directory .gp-nav-book-category-grid a:focus-visible {
  color: #d8b272;
  background: rgba(216, 178, 114, .1);
}
@media (min-width: 981px) {
  html[lang="ru"] .gp-nav-item--book-directory > .gp-nav-menu { width: min(640px, calc(100vw - 40px)); }
}
/* gp-ru-navigation-stability-20260920-end */

/* Product categories are a page-level directory.  Keep them out of the
   primary Products popover and show the intended two rows of five on desktop. */
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell {
  position: relative;
  z-index: 20;
  padding: 0;
  overflow: visible;
  background: rgba(14, 16, 15, .97);
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell::after { display: none; }
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 1380px;
  margin: 0;
  overflow: visible;
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 56px;
  padding: 9px 14px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .12);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: #d8b272;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:nth-child(5n) { border-right: 0; }
html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:nth-last-child(-n + 5) { border-bottom: 0; }
@media (max-width: 760px) {
  html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell { overflow: hidden; }
  html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav {
    display: flex;
    max-width: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav::-webkit-scrollbar { display: none; }
  html[lang="ru"] body:is(.book-product-page, .book-directory-page) .book-category-nav a {
    flex: 0 0 auto;
    min-width: 142px;
    min-height: 48px;
    padding: 0 16px;
    border-right: 1px solid rgba(255, 255, 255, .12);
    border-bottom: 0;
    white-space: nowrap;
    scroll-snap-align: start;
  }
}
