/* Appily thirtyone — Techhike-style shop catalog */

.page-shop .page-main {
  padding-top: 0;
}

.a31-shop {
  padding: 1.75rem 0 3rem;
  background: var(--a31-white);
}

.a31-shop-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 2rem;
  align-items: start;
}

/* ── Filter sidebar ── */
.a31-shop-filters {
  position: sticky;
  top: 110px;
}

.a31-filters-title {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--a31-ink);
  display: inline-block;
  border-bottom: 4px solid var(--a31-yellow);
  padding-bottom: 0.2rem;
  line-height: 1.2;
}

.a31-filter-block {
  border-bottom: 1px solid var(--a31-border);
}

.a31-filter-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--a31-ink);
  cursor: pointer;
  text-align: left;
}

.a31-filter-toggle {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
  color: var(--a31-muted);
  width: 1.25rem;
  text-align: center;
}

.a31-filter-block.is-open .a31-filter-toggle::before {
  content: '−';
}

.a31-filter-block:not(.is-open) .a31-filter-toggle::before {
  content: '+';
}

.a31-filter-panel {
  padding: 0 0 0.85rem;
  display: grid;
  gap: 0.5rem;
}

.a31-filter-panel[hidden] {
  display: none;
}

.a31-filter-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--a31-muted);
  cursor: pointer;
  line-height: 1.35;
}

.a31-filter-check input {
  margin-top: 0.15rem;
  accent-color: var(--a31-ink);
}

.a31-filter-check:has(input:checked) {
  color: var(--a31-ink);
}

.a31-price-note {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--a31-muted);
}

.a31-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.a31-price-field {
  position: relative;
}

.a31-price-field span {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: var(--a31-muted);
  pointer-events: none;
}

.a31-price-field input {
  width: 100%;
  padding: 0.5rem 0.55rem 0.5rem 1.35rem;
  border: 1px solid var(--a31-border);
  border-radius: 0;
  font: inherit;
  font-size: 0.82rem;
}

.a31-price-apply {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--a31-border);
  background: var(--a31-white);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.a31-price-apply:hover {
  border-color: var(--a31-ink);
}

.a31-clear-filters {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--a31-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.a31-filter-mobile-toggle {
  display: none;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--a31-border);
  background: var(--a31-white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

/* ── Toolbar ── */
.a31-shop-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0;
  padding-bottom: 1rem;
}

.a31-shop-count {
  margin: 0;
  font-size: 0.88rem;
  color: var(--a31-ink);
  flex: 1;
}

.a31-shop-count strong {
  font-weight: 700;
}

.a31-shop-sort {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--a31-muted);
}

.a31-shop-sort select {
  padding: 0.4rem 1.75rem 0.4rem 0.55rem;
  border: 1px solid var(--a31-border);
  border-radius: 0;
  font: inherit;
  font-size: 0.82rem;
  background: var(--a31-white);
  cursor: pointer;
}

.a31-view-switch {
  display: flex;
  gap: 0.25rem;
}

.a31-view-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--a31-border);
  background: var(--a31-white);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--a31-muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.a31-view-btn.is-active {
  background: var(--a31-yellow);
  border-color: var(--a31-yellow);
  color: #000;
}

/* ── Product grid (divided cells) ── */
.a31-shop-grid {
  display: grid;
  border-left: 1px solid var(--a31-border);
  border-top: 1px solid var(--a31-border);
}

.a31-shop-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.a31-shop-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.a31-shop-grid[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.a31-shop-grid[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }

.a31-shop-card {
  position: relative;
  border-right: 1px solid var(--a31-border);
  border-bottom: 1px solid var(--a31-border);
  background: var(--a31-white);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.a31-shop-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0.85rem 1.1rem;
}

.a31-shop-card-img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
  padding: 0.35rem;
}

.a31-shop-card-img img {
  max-width: 100%;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.a31-shop-sale {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  background: var(--a31-yellow);
  color: #000;
  border-radius: 999px;
}

.a31-shop-card-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--a31-link);
  flex: 1;
}

.a31-shop-card-price {
  margin: 0;
  font-size: 0.85rem;
  color: var(--a31-ink);
}

.a31-shop-card-price strong {
  font-weight: 700;
}

.a31-shop-card-price s {
  color: var(--a31-muted);
  font-weight: 400;
  margin-right: 0.35rem;
}

.a31-shop-card.is-sold-out .a31-shop-card-img {
  opacity: 0.5;
}

.a31-shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--a31-muted);
  border-right: 1px solid var(--a31-border);
  border-bottom: 1px solid var(--a31-border);
}

.a31-shop-empty a {
  color: var(--a31-link);
  font-weight: 600;
}

/* ── Pagination ── */
.a31-shop .a31-shop-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.a31-shop .a31-page-num,
.a31-shop .a31-page-arrow {
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--a31-border);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  color: var(--a31-ink);
  background: var(--a31-white);
}

.a31-shop .a31-page-num.is-active {
  background: var(--a31-yellow);
  border-color: var(--a31-yellow);
  color: #000;
}

.a31-shop .a31-page-arrow:hover,
.a31-shop .a31-page-num:not(.is-active):hover {
  border-color: var(--a31-ink);
}

.a31-shop .a31-page-gap {
  padding: 0 0.25rem;
  color: var(--a31-muted);
}

@media (max-width: 1100px) {
  .a31-shop-grid[data-cols="6"],
  .a31-shop-grid[data-cols="5"] {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .a31-shop-layout {
    grid-template-columns: 1fr;
  }

  .a31-filter-mobile-toggle {
    display: block;
  }

  .a31-shop-filters {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    width: min(300px, 88vw);
    background: var(--a31-white);
    padding: 1.25rem;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  body.a31-filters-open .a31-shop-filters {
    transform: translateX(0);
  }

  .a31-filter-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(0, 0, 0, 0.35);
  }

  body.a31-filters-open .a31-filter-backdrop {
    display: block;
  }

  .a31-shop-grid[data-cols="4"],
  .a31-shop-grid[data-cols="5"],
  .a31-shop-grid[data-cols="6"] {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .a31-shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .a31-view-switch {
    justify-content: flex-end;
  }

  .a31-shop-grid[data-cols="3"],
  .a31-shop-grid[data-cols="4"],
  .a31-shop-grid[data-cols="5"],
  .a31-shop-grid[data-cols="6"] {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .a31-shop-grid[data-cols="3"],
  .a31-shop-grid[data-cols="4"],
  .a31-shop-grid[data-cols="5"],
  .a31-shop-grid[data-cols="6"] {
    grid-template-columns: 1fr;
  }
}
