/* Shop / archive catalog (WooCommerce shop + Mizhan static shop template) */

.mizhan-shop-page.shop-page--catalog {
  background: #ffffff;
  overflow-x: clip;
}

.shop-page--catalog {
  --shop-shell-max: min(100%, 1640px);
  --shop-shell-pad-x: 40px;
}

.shop-page--catalog > .container {
  /* 与首页 borumdo-home__shell 同宽 */
  width: 100%;
  max-width: var(--shop-shell-max);
  padding-top: 0;
  padding-right: var(--shop-shell-pad-x);
  padding-bottom: 56px;
  padding-left: var(--shop-shell-pad-x);
  box-sizing: border-box;
}

@media (max-width: 1180px) {
  .shop-page--catalog {
    --shop-shell-pad-x: 24px;
  }
}

@media (max-width: 640px) {
  .shop-page--catalog {
    --shop-shell-pad-x: 16px;
  }
}

.shop-page.shop-page--catalog .woocommerce-notices-wrapper {
  /* 空容器仍有 margin-bottom 时会在页眉与 shop-catalog-intro 之间挤出白条 */
  margin: 0;
}

.shop-page.shop-page--catalog .woocommerce-notices-wrapper:has(
  .woocommerce-message,
  .woocommerce-info,
  .woocommerce-error,
  .woocommerce-notice
) {
  margin-bottom: 20px;
}

/* ---------- 商店页头：全宽纯色条（低调、压缩高度） ---------- */

.shop-page--catalog .shop-catalog-intro {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 20px;
  padding: 0;
  border: none;
  border-bottom: 1px solid #ececec;
  border-radius: 0;
  background: #f7f7f7;
  box-shadow: none;
}

.shop-page--catalog .shop-catalog-intro > .container {
  position: relative;
  width: 100%;
  max-width: var(--shop-shell-max);
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--shop-shell-pad-x);
  padding-left: var(--shop-shell-pad-x);
  box-sizing: border-box;
  padding-top: clamp(14px, 2vw, 20px);
  padding-bottom: clamp(12px, 1.8vw, 18px);
}

.shop-catalog-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 0;
}

.shop-catalog-hero__text {
  flex: 1 1 min(100%, 420px);
  min-width: 0;
  max-width: min(100%, 52rem);
}

.shop-catalog-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #222222;
  text-wrap: balance;
}

.shop-catalog-hero__subtitle {
  margin: 0;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  color: #737373;
  letter-spacing: 0;
}

.shop-catalog-intro__sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  flex: 0 0 auto;
  margin: 0;
  margin-inline-start: auto;
  padding: 0;
  border: none;
  background: transparent;
}

.shop-catalog-intro__sort .shop-sort-by {
  font-size: 12px;
  font-weight: 500;
  color: #555555;
  letter-spacing: 0;
  white-space: nowrap;
}

.shop-catalog-intro__sort .woocommerce-ordering {
  float: none;
  margin: 0;
  position: relative;
}

.shop-sort-select {
  position: relative;
}

.shop-sort-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shop-sort-select__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #333333;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  appearance: none;
  outline: none;
}

.shop-sort-select__trigger:hover,
.shop-sort-select__trigger:focus-visible {
  color: #111111;
}

.shop-sort-select__value {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-sort-select__chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 1px;
  border-right: 1.5px solid #555555;
  border-bottom: 1.5px solid #555555;
  transform: rotate(45deg);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.shop-sort-select.is-open .shop-sort-select__chevron {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.shop-sort-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  max-height: min(320px, 70vh);
  overflow-y: auto;
}

.shop-sort-select__option {
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.4;
  color: #333333;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.shop-sort-select__option:hover,
.shop-sort-select__option.is-focused {
  background: #f5f5f5;
  color: #111111;
}

.shop-sort-select__option.is-selected {
  background: #f0f0f0;
  color: #111111;
  font-weight: 500;
}

.shop-catalog-intro__meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.shop-catalog-intro__meta .woocommerce-result-count {
  float: none;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: #888888;
}

.shop-page--catalog {
  --borumdo-blue: #2563eb;
  --borumdo-line: #e8eaed;
}

.shop-catalog-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.shop-catalog-grid .borumdo-home__product-card {
  scroll-snap-align: unset;
}

.shop-catalog-grid .borumdo-home__product-media {
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: 330px;
}

.shop-catalog-grid .borumdo-home__product-media picture,
.shop-catalog-grid .borumdo-home__product-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.shop-catalog-grid .borumdo-home__product-media img {
  object-fit: cover;
}

.shop-catalog-grid .borumdo-home__product-price del {
  color: #aaaaaa;
  font-weight: 400;
}

.shop-catalog-grid .borumdo-home__product-price ins {
  text-decoration: none;
  color: #e02020;
  font-weight: 800;
}

.shop-catalog-pagination {
  margin: 8px 0 40px;
}

.shop-catalog-pagination .woocommerce-pagination {
  margin: 0;
}

.shop-catalog-pagination .woocommerce-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-catalog-pagination .woocommerce-pagination ul li {
  margin: 0;
}

.shop-catalog-pagination .woocommerce-pagination a,
.shop-catalog-pagination .woocommerce-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.shop-catalog-pagination .woocommerce-pagination a:hover,
.shop-catalog-pagination .woocommerce-pagination a:focus-visible {
  border-color: #000000;
}

.shop-catalog-pagination .woocommerce-pagination span.current {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

.mizhan-shop-empty {
  padding: 40px 24px;
  border-radius: 14px;
  background: #fafafa;
  color: #555555;
  text-align: center;
  margin-bottom: 32px;
}

.shop-trust-bar.shop-note {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid #eeeeee;
}

.shop-trust-bar__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.shop-trust-bar__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f5f5f6;
  color: #111111;
}

.shop-trust-bar__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.shop-trust-bar__text strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
}

.shop-trust-bar__text span {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: #555555;
}

@media (max-width: 1200px) {
  .shop-catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .shop-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shop-page--catalog .container {
    padding-top: 0;
    padding-bottom: 44px;
  }

  .shop-page--catalog .shop-catalog-intro {
    margin-bottom: 16px;
  }

  .shop-page--catalog .shop-catalog-intro > .container {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .shop-catalog-hero {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 0;
  }

  .shop-catalog-intro__meta {
    flex-direction: column;
    align-items: stretch;
    margin-top: 16px;
    padding-top: 14px;
  }

  .shop-catalog-intro__meta .woocommerce-result-count {
    flex: 0 0 auto;
  }

  .shop-catalog-intro__sort {
    margin-inline-start: 0;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .shop-catalog-intro__sort .shop-sort-select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .shop-catalog-intro__sort .shop-sort-select__trigger {
    width: 100%;
    justify-content: space-between;
  }

  .shop-catalog-intro__sort .shop-sort-select__value {
    max-width: none;
    flex: 1 1 auto;
    text-align: left;
  }

  .shop-catalog-intro__sort .shop-sort-select__menu {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
  }

  .shop-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .shop-trust-bar.shop-note {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .shop-catalog-grid {
    grid-template-columns: 1fr;
  }

  .shop-trust-bar.shop-note {
    grid-template-columns: 1fr;
  }
}
