/* Local Spanish review override: keep the primary and contextual navigation distinct. */
html[lang="es"] .site-header { z-index: 30; }

/* Some Spanish templates were missing the shared contextual-navigation CSS,
   exposing the secondary links in browser-default white.  Keep every section
   directory on the same dark, readable strip. */
html[lang="es"] .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);
}

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

html[lang="es"] .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="es"] .gp-context-subnav a:last-child { border-right: 0; }
html[lang="es"] .gp-context-subnav a:hover,
html[lang="es"] .gp-context-subnav a:focus-visible,
html[lang="es"] .gp-context-subnav a.is-current,
html[lang="es"] .gp-context-subnav a[aria-current="page"] {
  color: #d8b272;
  background: transparent;
}

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

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

@media (max-width: 760px) {
  html[lang="es"] .gp-context-subnav-shell { padding: 0; overflow: hidden; }
  html[lang="es"] .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="es"] .gp-context-subnav a {
    flex: 0 0 auto;
    min-width: 150px;
    min-height: 48px;
    padding: 9px 14px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
}

/* Candidate-wide responsive repairs.  They are intentionally scoped to the
   Spanish review tree so no shared production asset is altered. */
@media (max-width: 980px) {
  html[lang="es"] .site-header .nav-toggle {
    color: #f6d18a;
    border-color: rgba(216, 178, 114, .72);
    background: transparent;
  }
}

@media (max-width: 740px) {
  html[lang="es"] body.support-factory .company-profile-exterior--concept img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  html[lang="es"] body.support-factory .factory-equipment-card--press-closeup { overflow: hidden; }
}

html[lang="es"] body.religious-product-page .cultural-window .title-lock {
  display: inline;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Book categories belong below the header, not inside the Product Center menu.
   On desktop they form the intended two rows of five; a compact swipe strip is
   retained only where the viewport cannot accommodate two readable rows. */
html[lang="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell {
  position: relative;
  z-index: 20;
  padding: 0;
  background: rgba(14, 16, 15, .97);
}

html[lang="es"] 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;
}

html[lang="es"] 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="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:nth-child(5n) {
  border-right: 0;
}

html[lang="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:nth-last-child(-n + 5) {
  border-bottom: 0;
}

html[lang="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:hover,
html[lang="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav a:focus-visible,
html[lang="es"] 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="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav-shell {
    overflow: hidden;
  }
  html[lang="es"] 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="es"] body:is(.book-product-page, .book-directory-page) .book-category-nav::-webkit-scrollbar { display: none; }
  html[lang="es"] 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;
  }
}
