/* Theme-agnostic defaults for shop list/filter/card UI. */

:where(.product-meta) {
  font-family: inherit;
}

:where(.pd-caption) {
  border-color: currentColor;
}

:where(.price) {
  font-weight: 600;
}

:where(.old-price) {
  margin-right: 0.35em;
  text-decoration: line-through;
  opacity: 0.7;
}

:where(.sale-badge) {
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.75rem;
  line-height: 1.1;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--shop-sale-badge-border, #1f6d1f);
  background: var(--shop-sale-badge-bg, #2e8b57);
  color: var(--shop-sale-badge-fg, #ffffff);
  vertical-align: middle;
  text-transform: uppercase;
}

:where(.stock-status),
:where(.sku),
:where(.condition) {
  padding-top: 10px;
}

/* Inherited: input { width: 100%; } */
:is(.price-row, .shop-products-toolbar) {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

:where(.price-row input) {
  width: auto;
  max-width: 6rem;
}

:where(.price-row label) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:where(#shop-products-ui) {
  min-height: 42px;
  transition: min-height 0.3s ease;
}

:where(.fixed-hints) {
  margin: 0.5rem 0;
}

:where(.shop-products-toolbar .sorter) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  flex: 0 0 auto;
  align-self: flex-start;
}

:where(.shop-products-toolbar .sorter select) {
  width: auto;
}

.shop-products-toolbar #shop-filters-details {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

:where(.shop-products-toolbar summary) {
  --summary-pad-x: 10px;
  line-height: normal;
}

:where(.product-grid) {
  display: grid;
  grid-template-columns: repeat(var(--shop-grid-cols-lg, 4), minmax(0, 1fr));
  gap: var(--shop-grid-gap, 1rem);
  margin: var(--shop-grid-margin, 1.5rem 0);
}

:where(.product-card) {
  padding: var(--shop-card-padding, 0.875rem 0.5rem);
  border: var(--shop-card-border, 1px solid);
  background: var(--shop-card-bg, transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  align-items: center;
}

:where(.product-card > img) {
  display: block;
  width: 100%;
  height: auto;
}

.product-card :is(h2, h3) {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

:where(.product-card .short) {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0.3em 0;
}

@media (max-width: 768px) {
  :where(.product-grid) {
    grid-template-columns: repeat(var(--shop-grid-cols-md, 3), minmax(0, 1fr));
    gap: var(--shop-grid-gap-sm, 0.875rem);
  }
}

@media (max-width: 576px) {
  :where(.product-grid) {
    grid-template-columns: repeat(var(--shop-grid-cols-sm, 2), minmax(0, 1fr));
  }
}

@media (max-width: 384px) {
  :where(.product-grid) {
    grid-template-columns: repeat(var(--shop-grid-cols-xs, 1), minmax(0, 1fr));
  }
}

:where(#shop-products-ui) button {
  margin-bottom: 0.5rem;
}

:where(.filter-group) {
  margin-bottom: 0.5rem;
}

:where(.wishlist-list) {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

:where(.wish-item) {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid;
  padding: 0.5rem;
}

:where(.wish-item > img) {
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex: 0 0 auto;
}

:where(.wish-body) {
  min-width: 0;
}

:where(.wish-body a) {
  overflow-wrap: anywhere;
}
