/* Shop page — thin overrides only */
.modal__info { display: flex; flex-direction: column; }

.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: clamp(2.25rem, 5vw, 4rem);
}

.shop-pagination[hidden] { display: none; }

.shop-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .55rem .78rem;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .035em;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.shop-pagination__button:hover:not(:disabled),
.shop-pagination__button:focus-visible {
  border-color: var(--color-purple-700);
  background: var(--color-purple-700);
  color: #fff;
  outline: none;
}

.shop-pagination__button:focus-visible { box-shadow: 0 0 0 3px rgba(111, 80, 134, .2); }

.shop-pagination__button:active:not(:disabled) { transform: translateY(1px); }

.shop-pagination__button.is-current {
  border-color: var(--color-orange);
  background: var(--color-orange);
  color: #fff;
}

.shop-pagination__button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.shop-pagination__ellipsis {
  min-width: 1.7rem;
  color: var(--color-text-faint);
  text-align: center;
  font-weight: 800;
}

.shop-brand-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin: -1rem 0 2.4rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
}

.shop-brand-filter__label {
  color: var(--color-orange-700);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.shop-brand-filter__rail {
  display: flex;
  gap: .55rem;
  min-width: 0;
  overflow-x: auto;
  padding: .15rem 0 .35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-purple-200) transparent;
}

.shop-brand-filter__button {
  flex: 0 0 auto;
  min-height: 2.2rem;
  padding: .46rem .82rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--color-text-muted);
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .045em;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.shop-brand-filter__button:hover,
.shop-brand-filter__button:focus-visible {
  border-color: var(--color-purple-700);
  color: var(--color-purple-700);
  outline: none;
}

.shop-brand-filter__button:active { transform: translateY(1px); }

.shop-brand-filter__button.is-active {
  border-color: var(--color-purple-700);
  background: var(--color-purple-700);
  color: #fff;
}

@media (max-width: 640px) {
  .shop-pagination { gap: .3rem; margin-top: var(--space-7); }
  .shop-pagination__button { min-width: 2.55rem; min-height: 2.55rem; padding: .45rem .62rem; }
  .shop-pagination__label { display: none; }

  /* Keep the sticky shop controls to one intentional, thumb-friendly row. */
  .page-shop .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: .65rem;
  }

  .page-shop .toolbar__search {
    grid-column: 1;
    min-width: 0;
    max-width: none;
    flex: none;
  }

  .page-shop .toolbar__search input {
    min-height: 52px;
    padding-left: 2.45rem;
    font-size: .92rem;
  }

  /* Products remain alphabetically sorted by default; brand chips scroll
     naturally below the sticky search field. */
  .page-shop #shop-sort,
  .page-shop .toolbar__count { display: none; }

  .shop-brand-filter {
    display: block;
    margin: -.65rem 0 2rem;
    padding: .75rem 0 .5rem;
  }
  .shop-brand-filter__label { display: block; margin: 0 0 .65rem; }
  .shop-brand-filter__rail { padding-inline: .05rem; }
  .shop-brand-filter__button { min-height: 2.45rem; padding-inline: .9rem; }
}

/* 2-up product grid on phones instead of the single-column default */
@media (max-width: 640px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .shop-grid .card__body { padding: var(--space-3); gap: .35rem; }
  .shop-grid .card__footer { padding: 0 var(--space-3) var(--space-3); }
  .shop-grid .product-card__title,
  .shop-grid .card__title { font-size: var(--fs-small); }

  /* price + button no longer fit side by side at 2-up card widths */
  .shop-grid .card__footer { flex-direction: column; align-items: stretch; gap: .5rem; }
  .shop-grid .product-card__add { width: 100%; text-align: center; }
}

/* On mobile, let the site header scroll away and reserve the top of the
   catalogue for the search interaction. */
@media (max-width: 900px) {
  .page-shop .site-header { position: static; }

  .page-shop .toolbar { position: static; top: auto; z-index: auto; }

  .page-shop .toolbar__search-spacer {
    flex: 1 1 260px;
    max-width: 340px;
  }

  .page-shop .toolbar__search-sentinel {
    flex: 0 0 0;
    width: 0;
    height: 1px;
    margin: 0;
    pointer-events: none;
  }

  .page-shop .toolbar__search.is-sticky {
    position: fixed;
    inset: 0 0 auto;
    z-index: 110;
    width: auto;
    max-width: none;
    margin: 0;
    padding: .6rem var(--container-pad);
    background: rgba(255, 253, 249, .97);
    border-bottom: 1px solid rgba(91, 59, 104, .18);
    box-shadow: 0 9px 24px rgba(45, 30, 42, .12);
  }

  .page-shop .toolbar__search.is-sticky svg { left: calc(var(--container-pad) + 1rem); }

  .page-shop .toolbar__search.is-sticky input {
    background: #fff;
    box-shadow: 0 0 0 1px rgba(111, 80, 134, .18);
  }
}

@media (max-width: 640px) {
  /* Brand controls scroll naturally; only search stays available. */
  .page-shop .toolbar { position: static; top: auto; z-index: auto; }

  .page-shop .toolbar__search-spacer {
    grid-column: 1;
    grid-row: 1;
  }

  .page-shop .toolbar__search-sentinel {
    grid-column: 1;
    grid-row: 1;
    height: 1px;
    margin-bottom: -1px;
    pointer-events: none;
  }

  .page-shop .toolbar__search.is-sticky {
    position: fixed;
    inset: 0 0 auto;
    z-index: 110;
    width: auto;
    max-width: none;
    margin: 0;
    padding: .6rem var(--container-pad);
    background: rgba(255, 253, 249, .97);
    border-bottom: 1px solid rgba(91, 59, 104, .18);
    box-shadow: 0 9px 24px rgba(45, 30, 42, .12);
  }

  .page-shop .toolbar__search.is-sticky svg {
    left: calc(var(--container-pad) + 1rem);
  }

  .page-shop .toolbar__search.is-sticky input {
    background: #fff;
    box-shadow: 0 0 0 1px rgba(111, 80, 134, .18);
  }
}
