/*
 * PIT64 2.1.21 — responsive, inventory-aware catalog filters.
 * Desktop uses a left sidebar. Mobile turns the same form into a bottom sheet.
 */

/*
 * PIT64 2.1.26 — one catalog scale for parent and child categories.
 * Managed leaf archives use the same 1450px content wrapper and responsive
 * horizontal padding as their parent. Every native override is scoped to the
 * managed landing so WooCommerce categories outside PIT64 stay untouched.
 */
.pit64-v2 .catalog-native-landing.site-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 40px clamp(22px, 7vw, 110px) 84px;
}

.pit64-v2 .catalog-native-landing .catalog-native-hero,
.pit64-v2 .catalog-native-landing .catalog-native-products {
  width: 100%;
  max-width: 1450px;
  margin-inline: auto;
}

.pit64-v2 .catalog-native-landing .catalog-native-products {
  padding: 64px 0 0;
}

.pit64-v2 .catalog-native-landing .catalog-native-products-heading {
  margin-bottom: 40px;
}

.pit64-v2 .catalog-native-landing.catalog-native-pokemon-tcg .catalog-native-products-heading {
  margin-bottom: 32px;
}

.pit64-v2 .catalog-native-landing.catalog-native-pokemon-tcg .catalog-native-products-heading h2 {
  font-size: clamp(34px, 3.5vw, 52px);
}

.pit64-v2 .catalog-native-landing .catalog-native-products .woocommerce-products-header {
  display: none;
}

.pit64-v2 .catalog-native-landing .catalog-native-products .products {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
}

.pit64-v2 .catalog-native-landing .catalog-native-products .products li.product {
  min-width: 0;
  border-radius: 14px;
}

.pit64-v2 .catalog-native-landing .catalog-native-products .products li.product img.pit64-catalog-product-image {
  width: 100% !important;
  max-width: none !important;
  border-radius: 10px;
  background: #fff !important;
}

.pit64-v2 .catalog-native-landing .catalog-native-products .products li.product .woocommerce-loop-product__title:not(.pit64-loop-title-split),
.pit64-v2 .catalog-native-landing .catalog-native-products .products li.product .pit64-loop-title-split {
  min-height: 3.75em;
}

.pit64-v2 .catalog-native-landing .catalog-native-products .products li.product .woocommerce-loop-product__title:not(.pit64-loop-title-split) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.pit64-v2 .catalog-native-landing .catalog-native-products .products li.product .pit64-loop-title-split {
  display: grid;
  align-content: start;
  overflow: hidden;
  -webkit-box-orient: initial;
  -webkit-line-clamp: initial;
}

.pit64-catalog-toolbar {
  width: 100%;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.pit64-filter-open {
  min-height: 46px;
  padding: 0 18px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #171512;
  border-radius: 7px;
  background: #171512;
  color: #fff;
  font: 900 10px/1 Arial, sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.pit64-filter-open svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.pit64-filter-open > span {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ed1c24;
  color: #fff;
  font-size: 9px;
}

.pit64-filter-result-count {
  margin: 0;
  color: #6b655d;
  font-size: 13px;
}

.pit64-catalog-ordering {
  justify-self: end;
}

.pit64-catalog-ordering select {
  min-width: 220px;
  min-height: 46px;
  padding: 0 38px 0 13px;
  border: 1px solid #d8d1c7;
  border-radius: 6px;
  background: #fff;
  color: #292622;
  font-size: 12px;
}

.pit64-filtered-catalog-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(238px, 270px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 2.5vw, 36px);
}

.pit64-filtered-catalog-main {
  min-width: 0;
}

.pit64-filtered-catalog-main .products {
  grid-auto-rows: 1fr;
  align-items: stretch;
}

/* Match the canonical 1450px product canvas used by the other families. */
.pit64-v2 .catalog-landing-diecast .catalog-products-section {
  max-width: 1450px;
}

.pit64-filtered-catalog-main > .woocommerce-result-count,
.pit64-filtered-catalog-main > .woocommerce-ordering,
.pit64-filtered-catalog-main > .woocommerce-notices-wrapper + .woocommerce-result-count,
.pit64-filtered-catalog-main > .woocommerce-notices-wrapper + .woocommerce-result-count + .woocommerce-ordering {
  display: none !important;
}

.pit64-catalog-filter-panel {
  position: sticky;
  top: 20px;
  z-index: 8;
  max-height: calc(100vh - 40px);
  overflow: hidden auto;
  overscroll-behavior: contain;
  border: 1px solid #d8d1c7;
  border-radius: 10px;
  background: #fffdfa;
  color: #24211e;
  box-shadow: 0 15px 38px rgba(35, 28, 20, .07);
  scrollbar-width: thin;
}

.pit64-filter-drag,
.pit64-filter-close {
  display: none;
}

.pit64-filter-panel-header {
  padding: 22px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pit64-filter-panel-header small {
  display: block;
  margin-bottom: 7px;
  color: #986d08;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.pit64-filter-panel-header h2 {
  margin: 0;
  color: #191714;
  font: 600 24px/1.08 Arial, sans-serif;
  letter-spacing: -.025em;
}

.pit64-filter-help {
  margin: 0;
  padding: 0 20px 17px;
  color: #777068;
  font-size: 11px;
  line-height: 1.45;
}

.pit64-catalog-filter-form {
  display: block;
}

.pit64-filter-search {
  min-height: 46px;
  margin: 0 16px 8px;
  padding: 0 13px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid #ded8ce;
  border-radius: 7px;
  background: #fff;
}

.pit64-filter-search svg {
  width: 19px;
  fill: none;
  stroke: #37332e;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.pit64-filter-search input {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #24211e;
  font-size: 13px;
}

.pit64-filter-group {
  margin: 0 16px;
  border-top: 1px solid #e5dfd6;
}

.pit64-filter-group:last-of-type {
  border-bottom: 1px solid #e5dfd6;
}

.pit64-filter-group summary {
  min-height: 52px;
  padding: 0 3px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: #36312c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.pit64-filter-group summary::-webkit-details-marker { display: none; }

.pit64-filter-group summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1;
  color: #686159;
  font-size: 18px;
  font-weight: 400;
}

.pit64-filter-group[open] summary::after { content: "−"; }

.pit64-filter-group summary > span {
  grid-column: 2;
  grid-row: 1;
  margin-right: 22px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f1ece4;
  font-size: 8px;
}

.pit64-filter-group-content {
  padding: 0 2px 16px;
  display: grid;
  gap: 10px;
}

.pit64-filter-choice {
  min-height: 27px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #443f39;
}

.pit64-filter-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pit64-filter-choice > span {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1.5px solid #8e877e;
  border-radius: 5px;
  background: #fff;
}

.pit64-filter-choice input:checked + span {
  border-color: #ed1c24;
  background: #ed1c24;
}

.pit64-filter-choice input:checked + span::after {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.pit64-filter-choice input:focus-visible + span {
  outline: 2px solid #171512;
  outline-offset: 2px;
}

.pit64-filter-choice b {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.pit64-filter-choice small {
  color: #8b837a;
  font-size: 10px;
}

.pit64-filter-price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
}

.pit64-filter-price label {
  display: grid;
  gap: 6px;
  color: #686159;
  font-size: 10px;
  font-weight: 800;
}

.pit64-filter-price input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 1px solid #d8d1c7;
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
}

.pit64-filter-price i {
  padding-bottom: 12px;
  color: #989086;
  font-style: normal;
}

.pit64-filter-actions {
  padding: 18px 16px;
  display: grid;
  gap: 10px;
  background: #fffdfa;
}

.pit64-filter-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: #ed1c24;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.pit64-filter-actions a {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: #5e5750;
  font-size: 10px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pit64-filter-empty {
  min-height: 310px;
  padding: 42px;
  display: grid;
  align-content: center;
  justify-items: start;
  border: 1px solid #ddd6cc;
  border-radius: 12px;
  background: #fff;
}

.pit64-filter-empty strong {
  color: #1b1815;
  font: 500 clamp(28px, 3vw, 40px)/1.05 Georgia, serif;
}

.pit64-filter-empty p {
  max-width: 540px;
  margin: 13px 0 24px;
  color: #6c655d;
  line-height: 1.6;
}

.pit64-filter-backdrop[hidden] { display: none !important; }

/* Four wide, three on laptops, two on tablets/phones and one below 360px. */
@media (min-width: 1400px) {
  .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-products-section .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-native-landing .catalog-native-products .pit64-filtered-catalog-main .products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1051px) and (max-width: 1399px) {
  .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-products-section .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-native-landing .catalog-native-products .pit64-filtered-catalog-main .products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 360px) and (max-width: 1050px) {
  .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-products-section .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-native-landing .catalog-native-products .pit64-filtered-catalog-main .products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
}

@media (max-width: 900px) {
  body.pit64-filter-is-open { overflow: hidden; }

  .pit64-v2 .catalog-native-landing .catalog-native-products-heading {
    margin-bottom: 28px;
  }

  .pit64-catalog-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
  }

  .pit64-filter-open { display: flex; }
  .pit64-filter-result-count { display: none; }
  .pit64-catalog-ordering { width: 100%; }
  .pit64-catalog-ordering select { width: 100%; min-width: 0; }

  .pit64-filtered-catalog-layout { grid-template-columns: minmax(0, 1fr); }

  .pit64-filter-backdrop {
    position: fixed;
    z-index: 99997;
    inset: 0;
    display: block;
    background: rgba(17, 14, 11, .48);
    opacity: 0;
    transition: opacity .22s ease;
  }

  .pit64-filter-backdrop.is-visible { opacity: 1; }

  .pit64-catalog-filter-panel {
    position: fixed;
    z-index: 99998;
    inset: auto 0 0;
    width: 100%;
    max-height: min(82dvh, 760px);
    padding-bottom: env(safe-area-inset-bottom, 0);
    border: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 55px rgba(20, 16, 12, .22);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.22, .75, .2, 1), visibility 0s linear .28s;
  }

  .pit64-catalog-filter-panel.is-open {
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s;
  }

  .pit64-filter-drag {
    width: 52px;
    height: 5px;
    margin: 11px auto 0;
    display: block;
    border-radius: 999px;
    background: #c9c1b7;
  }

  .pit64-filter-close {
    width: 38px;
    height: 38px;
    padding: 0 0 3px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f0ece6;
    color: #302b26;
    font: 300 30px/1 Arial, sans-serif;
  }

  .pit64-filter-panel-header { padding: 14px 20px 9px; }
  .pit64-filter-panel-header small { display: none; }
  .pit64-filter-panel-header h2 { font-size: 23px; }
  .pit64-filter-help { padding-bottom: 13px; }
  .pit64-filter-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid #e4ddd3;
    box-shadow: 0 -8px 20px rgba(36, 29, 22, .04);
  }

  .pit64-filtered-catalog-main .products,
  .pit64-v2 .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-products-section .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-native-landing .catalog-native-products .pit64-filtered-catalog-main .products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
}

@media (max-width: 700px) {
  .pit64-v2 .catalog-native-landing.site-main {
    padding: 25px 20px 75px;
  }

  .pit64-v2 .catalog-native-landing .catalog-native-products {
    padding: 48px 0 0;
  }
}

@media (max-width: 540px) {
  .catalog-native-landing .catalog-native-products .pit64-catalog-toolbar { margin-bottom: 17px; }
  .pit64-filter-open,
  .pit64-catalog-ordering select { min-height: 46px; font-size: 9px; }
  .pit64-filtered-catalog-main ul.products > li.product { min-width: 0 !important; }
  .pit64-filter-empty { min-height: 250px; padding: 28px 20px; }
}

@media (max-width: 359px) {
  .pit64-filtered-catalog-main .products,
  .pit64-v2 .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-products-section .pit64-filtered-catalog-main .products,
  .pit64-v2 .catalog-native-landing .catalog-native-products .pit64-filtered-catalog-main .products {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .pit64-v2 .pit64-filtered-catalog-main ul.products > li.product {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pit64-filter-backdrop,
  .pit64-catalog-filter-panel { transition: none; }
}
