.collection {
  padding-bottom: 2.5rem;
}

@media only screen and (min-width: 992px) {
  .collection {
    width: 100%;
    box-sizing: border-box;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-space);
    padding-bottom: 5rem;
  }
}

.collection__header {
  font-family: Montserrat, serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.04em;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
}

@media only screen and (min-width: 768px) {
  .collection__header {
    margin-bottom: 1.5rem;
  }
  .collection__header--has-subcollection {
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
  }
  .collection__header--has-image {
    margin-top: 1.5rem;
  }
}

.collection__header-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

@media only screen and (min-width: 992px) {
  .collection__header-item {
    width: auto;
    justify-content: flex-start;
  }
  .collection__header-item:first-child {
    min-width: 20.625rem;
  }
  .collection__header-item:last-child {
    min-width: 12.5rem;
  }
}

@media only screen and (max-width: 991px) {
  .collection__header-item {
    padding: 0 var(--container-space);
    grid-column: 1 / 4;
  }
  .collection__header-item:first-child {
    border-top: 1px solid #ececec;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

.collection__header-item:last-child {
  justify-self: end;
}

.collection__header-item button[data-collection-section-facets-toggler] {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

.collection__header-filters-toggle {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

@media only screen and (min-width: 992px) {
  .collection__header-filters-toggle svg {
    display: block;
  }
}

.collection__header-filters-toggle--opened {
  display: none;
}

collection-section[facets-open] .collection__header-filters-toggle--opened {
  display: flex;
}

collection-section[facets-open] .collection__header-filters-toggle--closed {
  display: none;
}

.collection__header-filters-toggle svg {
  display: block;
}

@media only screen and (max-width: 991px) {
  .collection__header-filters-toggle svg {
    display: none;
  }
}

.collection__sort {
  position: relative;
}

.collection__sort-selected {
  position: relative;
  text-transform: capitalize;
  cursor: pointer;
}

@media only screen and (min-width: 992px) {
  .collection__sort-selected {
    padding-right: 1.5rem;
  }
  .collection__sort-selected::after {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23252424' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    content: "";
    width: 1rem;
    height: 1rem;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.15s;
  }
  .collection__sort-selected--open::after {
    transform: translateY(-50%) rotate(180deg);
  }
}

.collection__sort-options {
  position: absolute;
  left: -1rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
  background-color: #fff;
  padding: 1rem;
}

@media only screen and (max-width: 991px) {
  .collection__sort-options {
    left: auto;
    right: -0.75rem;
    text-align: right;
    padding: 0.75rem;
  }
}

.collection__sort--open .collection__sort-options {
  opacity: 1;
  pointer-events: initial;
}

.collection__sort-options--open {
  opacity: 1;
  pointer-events: initial;
}

.collection__sort-options label {
  white-space: nowrap;
}

.collection__sort-options input {
  position: absolute;
  visibility: hidden;
}

.collection__sort-option {
  cursor: pointer;
}

/* ── Subcollection nav (default) ── */
.collection__nav {
  display: flex;
  gap: 0.5rem;
}

@media only screen and (min-width: 992px) {
  .collection__nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media only screen and (max-width: 991px) {
  .collection__nav {
    overflow: auto;
    scrollbar-width: none;
    margin-bottom: 1rem;
  }
  nav.collection__header-item {
    order: -1;
  }
  .collection__nav::-webkit-scrollbar {
    display: none;
  }
}

.collection__nav a {
  color: inherit;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  background-color: #ececec;
  border-radius: 2.5rem;
  transition: color 0.3s ease-out, background-color 0.3s ease-out;
  padding: 0.25rem 1rem;
}

@media only screen and (max-width: 991px) {
  .collection__nav a {
    flex: 0 0 25%;
    margin: 0 auto;
  }
}

.collection__nav a:hover {
  color: #fff;
  background-color: #252424;
}

/* ── Halloween chip pills ──────────────────────────────────────────
   Scoped to #hw-cat-nav so these rules never affect other buttons
   or nav links anywhere else on the site.
────────────────────────────────────────────────────────────────── */
#hw-cat-nav .hw-cat-chip {
  /* reset button defaults */
  appearance: none;
  -webkit-appearance: none;
  border: none;
  margin: 0;

  /* match .collection__nav a exactly */
  display: inline-block;
  cursor: pointer;
  color: inherit;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  background-color: #ececec;
  border-radius: 2.5rem;
  padding: 0.25rem 1rem;
  font-family: Montserrat, serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.04em;
  transition: color 0.3s ease-out, background-color 0.3s ease-out;
}

@media only screen and (max-width: 991px) {
  #hw-cat-nav .hw-cat-chip {
    flex: 0 0 auto;
    margin: 0 auto;
  }
}

#hw-cat-nav .hw-cat-chip:hover{
   background-color: #dededeff;
; 
}
#hw-cat-nav .hw-cat-chip--active,
#hw-cat-nav .hw-cat-chip[aria-pressed="true"] {
  color: #fff;
  background-color: #252424;
}

/* keyboard focus — visible ring for accessibility, hidden on mouse click */
#hw-cat-nav .hw-cat-chip:focus-visible {
  outline: 2px solid #252424;
  outline-offset: 2px;
}

#hw-cat-nav .hw-cat-chip:focus:not(:focus-visible) {
  outline: none;
}

/* ── Product layout toggles ── */
.collection__product-layouts {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media only screen and (min-width: 992px) {
  .collection__product-layouts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

.collection__product-layouts svg {
  display: block;
}

.collection_product-layout {
  border: 1px solid #ececec;
  border-radius: 0.125rem;
  cursor: pointer;
  transition: background-color 0.3s ease-out;
}

.collection_product-layout.active {
  background-color: #ececec;
}

.collection_product-layout:hover {
  background-color: #ececec;
}

/* ── Collection main layout ── */
@media only screen and (min-width: 992px) {
  .collection__main {
    display: grid;
  }
  .collection__main--facets-open {
    grid-template-columns: 18% auto;
    gap: 1.5rem;
  }
}

@media only screen and (min-width: 992px) {
  .collection__facets {
    display: none;
  }
  .collection__main--facets-open .collection__facets {
    display: block;
  }
}

.collection__facets-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.1);
}

.collection__main--facets-open .collection__facets-overlay {
  opacity: 1;
  pointer-events: initial;
}

@media only screen and (max-width: 991px) {
  .collection__facets-inner {
    position: fixed;
    width: 100%;
    max-height: 95vh;
    bottom: 0;
    z-index: 21;
    display: flex;
    flex-direction: column;
    transform: translateY(110%);
    background-color: #fff;
    border-radius: 1rem 1rem 0 0;
    transition: transform 0.3s ease-out;
    padding: 1.5rem;
  }
  .collection__main--facets-open .collection__facets-inner {
    transform: translateY(0);
  }
}

/* ── Products grid ── */
.collection__products-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem 0.0625rem;
}

@media only screen and (min-width: 992px) {
  .collection__products-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem 1rem;
  }
  .collection__products.grid-3 .collection__products-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Empty state ── */
.collection__empty {
  width: 100%;
  box-sizing: border-box;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-space);
  text-align: center;
  padding-top: 7.5rem;
  padding-bottom: 7.5rem;
}

/* ── Halloween product wrap animation ── */
.hw-product-wrap {
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform-origin: center;
}

.hw-product-wrap.hw-hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

@media only screen and (max-width: 991px) {
  .collection__products-count {
    font-size: 0.75rem;
  }
}
