:root {
  --klx-ux-navy: #06163d;
  --klx-ux-navy-2: #0b2b5e;
  --klx-ux-blue: #2967e8;
  --klx-ux-gold: #ffd447;
  --klx-ux-line: rgba(255, 255, 255, 0.16);
}

/* One intentional Astra header: logo, navigation, search, and account. */
#masthead .ast-primary-header-bar,
#masthead .ast-above-header-bar {
  border: 0;
  background: #fff;
}
#masthead .ast-primary-header-bar {
  border-bottom: 1px solid rgba(11, 43, 94, 0.14);
  box-shadow: 0 12px 30px rgba(4, 18, 52, 0.16);
}
#masthead .site-primary-header-wrap {
  min-height: 78px;
  max-width: 1280px;
  padding-inline: 24px;
}
#masthead .custom-logo-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 7px 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(2, 14, 43, 0.22);
}
#masthead .main-header-menu > .menu-item > .menu-link {
  min-height: 48px;
  color: #0b1b3d;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
#masthead .main-header-menu > .menu-item > .menu-link:hover,
#masthead .main-header-menu > .menu-item > .menu-link:focus-visible,
#masthead .main-header-menu > .current-menu-item > .menu-link {
  color: var(--klx-ux-blue);
}
#masthead .ast-header-search,
#masthead .ast-header-account {
  display: flex;
  align-items: center;
}
#masthead .ast-search-icon a,
#masthead .ast-header-account-link,
#masthead .menu-toggle {
  display: inline-grid;
  min-width: 46px;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(13, 51, 123, 0.18);
  border-radius: 12px;
  color: #0d337b;
  background: rgba(41, 103, 232, 0.05);
}
#masthead .ast-search-icon a:hover,
#masthead .ast-search-icon a:focus-visible,
#masthead .ast-header-account-link:hover,
#masthead .ast-header-account-link:focus-visible,
#masthead .menu-toggle:hover,
#masthead .menu-toggle:focus-visible {
  border-color: var(--klx-ux-blue);
  color: var(--klx-ux-navy);
  background: rgba(41, 103, 232, 0.1);
}
#masthead .ast-header-account-link svg,
#masthead .ast-search-icon svg,
#masthead .menu-toggle svg {
  fill: currentColor;
}
#masthead .ast-header-account-link svg path,
#masthead .ast-header-account-link svg circle,
#masthead .ast-header-account-link svg use {
  fill: currentColor !important;
  color: currentColor !important;
}
.ast-search-box.full-screen,
.ast-search-menu-icon.full-screen .search-form {
  background: rgba(4, 18, 52, 0.96);
}
.ast-search-box.full-screen .search-field,
.ast-search-menu-icon.full-screen .search-field {
  color: #fff;
}

/* Homepage sequence numbers are removed in PHP; this rebalances the cards. */
.home .klx26-values > div {
  align-content: start;
  padding-top: clamp(28px, 4vw, 48px);
}
.home .klx26-values > div > h2 {
  margin-top: 0;
}

/* Pokemon root: only the hero goes full bleed; content remains readable. */
body.term-pokemon .klx-t1 {
  overflow: visible;
}
body.term-pokemon .klx-t1-hero {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
}
body.term-pokemon .klx-t1-hero-media img {
  height: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: linear-gradient(145deg, #0d2d72, #1a4ca7);
  border-radius: 22px;
  box-shadow: 0 22px 52px rgba(2, 15, 48, 0.3);
}
body.term-pokemon .klx-t1-hero-media {
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.term-pokemon .klx-t1-hero-badge {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  margin: -8px 18px 0;
}
.klx-t1-status--live .label {
  background: #dff9ec;
  color: #12633e;
}
.klx-t1-resource-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.klx-t1-status--live .klx-t1-btn {
  width: 100%;
  box-shadow: none;
}
.klx-t1-status--live .klx-t1-btn.alt {
  border-color: #bfd1ed;
  background: #edf4ff;
  color: #123f85 !important;
}

/* Shared set/product cards: deliberate desktop density and one phone column. */
@media (min-width: 901px) {
  body.klxs-catalog-set ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 26px !important;
  }
  html body.klxs-catalog-set .astra-shop-thumbnail-wrap {
    min-height: 290px !important;
    height: 290px !important;
    padding: 20px !important;
  }
  html body.klxs-catalog-set .astra-shop-thumbnail-wrap img {
    width: 100% !important;
    height: 250px !important;
    max-height: 250px !important;
    object-fit: contain !important;
  }
  body.klxs-catalog-set .astra-shop-summary-wrap {
    min-height: 166px;
  }
  body.klxs-catalog-set .woocommerce-loop-product__title {
    min-height: 0;
    font-size: 1.08rem !important;
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  html body.klxs-catalog-set .astra-shop-thumbnail-wrap {
    min-height: 270px !important;
    height: 270px !important;
    padding: 18px !important;
  }
  html body.klxs-catalog-set .astra-shop-thumbnail-wrap img {
    width: 100% !important;
    height: 234px !important;
    max-height: 234px !important;
    object-fit: contain !important;
  }
}
@media (max-width: 600px) {
  body.klxs-catalog-set ul.products {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-inline: 18px !important;
  }
  html body.klxs-catalog-set .astra-shop-thumbnail-wrap {
    min-height: 300px !important;
    height: 300px !important;
    padding: 15px !important;
  }
  html body.klxs-catalog-set .astra-shop-thumbnail-wrap img {
    width: 100% !important;
    height: 270px !important;
    max-height: 270px !important;
    object-fit: contain !important;
  }
  html body.klxs-catalog-set .astra-shop-summary-wrap {
    min-height: 0 !important;
    height: auto !important;
  }
  body.klxs-catalog-set .woocommerce-loop-product__title {
    min-height: 0;
    font-size: 1.08rem !important;
  }
}

/* Balanced collection call-to-action at the end of set pages. */
.klx-set-collection-links {
  max-width: 760px;
  margin: 48px auto !important;
  padding: 25px 28px;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 14px 34px rgba(10, 34, 74, 0.09);
}
.klx-set-collection-links > strong {
  flex: 1 0 100%;
  color: #0b2b5e;
  font-size: 1.3rem;
}

/* Product images adapt to the actual source aspect ratio. */
body.klxs-catalog-product div.product div.images {
  overflow: hidden;
}
body.klxs-catalog-product div.product div.images .woocommerce-product-gallery__image > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
body.klx-product-image-landscape div.product div.images .woocommerce-product-gallery__wrapper,
body.klx-product-image-landscape div.product div.images .woocommerce-product-gallery__image,
body.klx-product-image-landscape div.product div.images .woocommerce-product-gallery__image > a {
  min-height: 450px;
  height: 100%;
}
body.klx-product-image-landscape div.product div.images img.wp-post-image {
  width: 100% !important;
  height: 450px !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}
body.klx-product-image-portrait div.product div.images img.wp-post-image,
body.klx-product-image-square div.product div.images img.wp-post-image {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 500px !important;
  object-fit: contain !important;
}

/* Buyer Fit reads as one coordinated three-part decision aid on desktop. */
.klx-buyer-fit__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.925fr 0.925fr;
  gap: 18px;
  margin-top: 24px;
}
.klx-buyer-fit__grid article {
  padding: 25px;
  border: 1px solid #dce4f1;
  border-radius: 15px;
  background: #f7faff;
}
.klx-buyer-fit__grid h3 {
  margin: 0 0 15px;
  color: #0a1d45;
  font-size: 1.35rem;
}
.klx-buyer-fit__grid h4 {
  margin: 17px 0 8px;
  color: #425879;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.klx-buyer-fit__pros {
  border-top: 4px solid #2b9b69 !important;
}
.klx-buyer-fit__cons {
  border-top: 4px solid #d49a32 !important;
}

/* Card Library: full-bleed top presentation, normal-width content below. */
.page-template-page-card-library .klx-collection {
  overflow: visible;
}
.page-template-page-card-library .klx-collection__hero {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  padding: 52px max(28px, calc((100vw - 1240px) / 2 + 20px));
  border-radius: 0;
}

/* Existing WP User Manager routes become one KLXCards account experience. */
body.klx-account-experience main#primary {
  max-width: 900px;
  margin-inline: auto;
  padding: 48px 20px 80px;
}
body.klx-account-experience article.ast-article-single {
  overflow: hidden;
  border: 1px solid #dce5f3;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(8, 27, 70, 0.1);
}
body.klx-account-experience .entry-header {
  margin: 0;
  padding: 36px 40px 28px;
  background: linear-gradient(125deg, #06163d, #174dae);
}
body.klx-account-experience .entry-header .entry-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  letter-spacing: -0.04em;
}
body.klx-account-experience .entry-content {
  padding: 34px 40px 44px;
}
body.klx-account-experience .wpum-form fieldset {
  margin-bottom: 18px;
}
body.klx-account-experience .wpum-form label {
  color: #0b1e3f;
  font-weight: 800;
}
body.klx-account-experience .wpum-form input[type='text'],
body.klx-account-experience .wpum-form input[type='email'],
body.klx-account-experience .wpum-form input[type='password'],
body.klx-account-experience .wpum-form select,
body.klx-account-experience .wpum-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #b7c7dd;
  border-radius: 10px;
  background: #fff;
}
body.klx-account-experience .wpum-form input[type='submit'],
body.klx-account-experience .wpum-form button {
  min-height: 48px;
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  background: #1456cc;
  color: #fff;
  font-weight: 900;
}

/* Complianz remains available without a persistent floating obstruction. */
.klx-consent-footer-ready #cmplz-manage-consent,
.klx-consent-footer-ready .cmplz-manage-consent:not(.klx-consent-settings) {
  display: none !important;
}
.klx-consent-settings[hidden] {
  display: none !important;
}
.klx-consent-settings:not([hidden]) {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.klx-global-footer nav[aria-label="Legal"] .klx-consent-settings:not([hidden]) {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
.klx-consent-settings:hover,
.klx-consent-settings:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 921px) {
  #masthead .ast-above-header-bar {
    min-height: 68px;
    border-bottom: 1px solid rgba(11, 43, 94, 0.14);
    box-shadow: 0 10px 28px rgba(4, 18, 52, 0.18);
  }
  #masthead .site-above-header-wrap {
    padding-inline: 14px;
  }
  #masthead .site-header-above-section-right {
    gap: 8px;
  }
  #masthead .ast-mobile-header-content {
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(11, 43, 94, 0.14);
    background: #fff;
    box-shadow: 0 18px 34px rgba(3, 15, 44, 0.22);
  }
  #masthead .ast-mobile-header-content .main-header-menu {
    display: grid;
    gap: 9px;
    padding: 0;
    background: transparent;
  }
  #masthead .ast-mobile-header-content .menu-item {
    border: 0;
  }
  #masthead .ast-mobile-header-content .menu-link {
    display: flex;
    min-height: 52px;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid rgba(13, 51, 123, 0.18);
    border-radius: 12px;
    background: rgba(41, 103, 232, 0.05);
    color: #0b1b3d;
    font-weight: 850;
  }
  #masthead .ast-mobile-header-content .menu-link:hover,
  #masthead .ast-mobile-header-content .menu-link:focus-visible,
  #masthead .ast-mobile-header-content .current-menu-item .menu-link {
    border-color: var(--klx-ux-blue);
    background: rgba(41, 103, 232, 0.1);
    color: var(--klx-ux-navy);
  }
}

@media (max-width: 700px) {
  body.term-pokemon .klx-t1-hero-media img {
    padding: 10px;
  }
  body.term-pokemon .klx-t1-hero-media {
    min-height: 0;
  }
  body.term-pokemon .klx-t1-hero-badge {
    margin: 12px 0 0;
  }
  .page-template-page-card-library .klx-collection__hero {
    width: auto;
    margin-inline: -20px;
    padding: 34px 22px;
    border-radius: 0;
  }
  .klx-buyer-fit__grid {
    grid-template-columns: 1fr;
  }
  body.klx-account-experience main#primary {
    padding: 24px 14px 60px;
  }
  body.klx-account-experience .entry-header {
    padding: 28px 22px 22px;
  }
  body.klx-account-experience .entry-content {
    padding: 25px 22px 32px;
  }
}

@media (max-width: 600px) {
  .klxu-jumpbar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 17px;
  }
  .klxu-jumpbar b {
    grid-column: 1 / -1;
    margin: 0 0 3px;
    text-align: center;
  }
  .klxu-jumpbar a {
    display: flex;
    width: auto !important;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    text-align: center;
  }
  .klx-set-collection-links {
    display: grid;
    margin-inline: 18px !important;
  }
  body.klx-product-image-landscape div.product div.images .woocommerce-product-gallery__wrapper,
  body.klx-product-image-landscape div.product div.images .woocommerce-product-gallery__image,
  body.klx-product-image-landscape div.product div.images .woocommerce-product-gallery__image > a {
    min-height: 300px;
  }
  body.klx-product-image-landscape div.product div.images img.wp-post-image {
    height: 300px !important;
  }
}

@media (max-width: 430px) {
  #masthead .custom-logo-link {
    min-height: 42px;
    padding: 6px 9px;
  }
  #masthead .ast-search-icon a,
  #masthead .ast-header-account-link,
  #masthead .menu-toggle {
    min-width: 42px;
    min-height: 42px;
  }
  #masthead .site-header-above-section-right {
    gap: 5px;
  }
}

@media (max-width: 340px) {
  #masthead .site-logo-img {
    padding-right: 0 !important;
  }
  #masthead .site-header-above-section-right > .ast-builder-layout-element {
    padding-inline: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #masthead *,
  .klx-buyer-fit__grid *,
  body.klxs-catalog-set ul.products li.product {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
