/*
 * WooCommerce catalog styles (WWW-WP04 / WS-M40–M43).
 */

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

.shop-layout {
  display: grid;
  gap: 24px;
}

@media (min-width: 60em) {
  .shop-layout {
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 3fr);
    align-items: start;
  }
}

.filter-panel {
  background: #ffffff;
  border: 1px solid var(--w24h-border);
  border-radius: var(--w24h-radius-lg);
  padding: 18px;
}

@media (min-width: 960px) {
  .filter-panel {
    position: sticky;
    top: 96px;
  }
}

.filter-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.filter-close {
  display: none;
}

.filter-group {
  border-bottom: 1px solid var(--w24h-border);
  padding: 12px 0;
}

.filter-group:last-of-type {
  border-bottom: 0;
}

.filter-group h3 {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.filter-selects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.filter-selects--price {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.filter-selects--price input[type="number"] {
  width: 100%;
  min-width: 0;
}

.filter-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mobile-filter-toggle {
  width: 100%;
  margin-bottom: 14px;
}

@media (min-width: 960px) {
  .mobile-filter-toggle {
    display: none;
  }
}

.filter-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 27, 27, 0.5);
  z-index: 80;
}

.filter-drawer-backdrop[hidden] {
  display: none;
}

@media (max-width: 959px) {
  .filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    z-index: 90;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    padding-bottom: 90px;
  }

  .filter-panel.is-open {
    transform: translateX(0);
  }

  .filter-close {
    display: inline-flex;
    border: 0;
    background: var(--w24h-surface);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
}

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.shop-toolbar .result-count {
  font-size: 0.9rem;
  color: var(--w24h-muted);
  margin-right: auto;
}

.shop-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.shop-search input[type="search"] {
  flex: 1;
  font: inherit;
  padding: 10px 12px;
  border: 1.5px solid var(--w24h-border-strong);
  border-radius: 10px;
}

.product-grid,
.catalog-featured-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.product-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--w24h-border);
  border-radius: var(--w24h-radius-lg);
  overflow: hidden;
  box-shadow: var(--w24h-shadow);
  position: relative;
  isolation: isolate;
}

.product-card.is-unavailable {
  background: var(--w24h-surface-2);
}

.product-card.is-unavailable .product-photo img {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.product-photo {
  position: relative;
  background: var(--w24h-surface-2);
  border-bottom: 1px solid var(--w24h-border);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-photo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: var(--w24h-muted, #6d6d6d);
  background: linear-gradient(160deg, var(--w24h-surface-2, #f4f4f4), var(--w24h-surface, #ececec));
}

.product-photo-fallback svg {
  width: 42px;
  height: 42px;
  opacity: 0.6;
}

.product-photo-fallback__text {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.product-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  background: var(--w24h-yellow);
  color: var(--w24h-ink);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.product-badge--out {
  background: var(--w24h-ink);
  color: #ffffff;
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  flex: 1;
}

.product-title {
  font-size: 0.99rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
}

.product-title a {
  text-decoration: none;
}

.product-title a:hover {
  text-decoration: underline;
}

.product-availability {
  font-size: 0.83rem;
  font-weight: 700;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 900;
  margin-top: auto;
}

.btn--disabled {
  background: var(--w24h-surface);
  color: var(--w24h-muted);
  border-color: var(--w24h-border);
  cursor: not-allowed;
  pointer-events: none;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  border: 1px dashed var(--w24h-border-strong);
  border-radius: var(--w24h-radius-lg);
  background: var(--w24h-surface-2);
}

.product-single-layout {
  display: grid;
  gap: 28px;
}

.product-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: 480px;
  padding: 20px;
  overflow: hidden;
  background: var(--w24h-surface-2);
  border: 1px solid var(--w24h-border);
  border-radius: var(--w24h-radius-lg);
}

.product-gallery .product-photo-fallback {
  min-height: 280px;
  max-height: 400px;
  aspect-ratio: 4 / 3;
}

@media (min-width: 900px) {
  .product-single-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.product-spec-table table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.product-spec-table th,
.product-spec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--w24h-border);
  text-align: left;
}

.product-spec-table th {
  width: 40%;
  font-weight: 700;
  background: var(--w24h-surface-2);
}

.single_add_to_cart_button {
  background: var(--w24h-yellow);
  color: var(--w24h-ink);
  border: 2px solid var(--w24h-yellow);
  font-weight: 800;
  padding: 12px 22px;
  border-radius: var(--w24h-radius);
  cursor: pointer;
}

.single_add_to_cart_button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* WooCommerce archive and card presentation.  These dimensions are bounded
 * so the intentional no-photo fallback never becomes a page-sized image. */
.shop-results .product-grid,
.catalog-featured-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.product-card {
  min-width: 0;
}

.product-photo {
  aspect-ratio: 4 / 3;
  max-height: 230px;
}

.product-photo-fallback {
  min-height: 0;
}

.product-photo-fallback svg {
  width: clamp(38px, 14%, 62px);
  height: clamp(38px, 14%, 62px);
}

.product-summary .price,
.product-summary .price .woocommerce-Price-amount {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 900;
}

.product-gallery .woocommerce-product-gallery__image img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  background: var(--w24h-surface-2);
  border-radius: var(--w24h-radius-lg);
}

.woocommerce-cart-form,
.cart-collaterals,
.woocommerce-account .woocommerce,
.woocommerce-checkout {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.woocommerce .cart-empty,
.woocommerce .return-to-shop {
  text-align: center;
}

.woocommerce .cart-empty {
  margin: 24px auto 12px;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 800;
}
