/* Product collection cards */
#collections {
  --card-surface: #faf7f1;
  --card-rule: #d8d0c5;
  background: var(--card-surface);
}

#products {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 26px);
}

#products .product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--card-rule);
  border-radius: 10px;
  background: #fffdf9;
  overflow: hidden;
}

#products .product-image {
  position: relative;
  height: auto;
  aspect-ratio: 5 / 4;
  padding: clamp(9px, 1.4vw, 20px);
  background: white;
  border-radius: 0;
}

#products .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#products .product-card:hover img {
  transform: none;
}

@media (hover: hover) {
  #products .product-image:hover img {
    transform: scale(1.045);
  }
}

#products .product-image .no-image {
  color: #65615d;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

#products .card-image-note {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 6px;
  border: 1px solid var(--card-rule);
  border-radius: 3px;
  background: #fffdf9;
  color: #4d453e;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

#products .product-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: clamp(10px, 1.3vw, 18px);
}

#products .product-card h3 {
  margin: 0;
  font-size: clamp(14px, 1.35vw, 19px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#products .card-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

#products .helmet-choices,
#products .helmet-model {
  margin: 2px 0;
}

#products .helmet-choice {
  min-height: 40px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#products .card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  margin-top: auto;
  gap: 8px;
  padding-top: 8px;
}

#products .card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 3px 8px;
}

#products .card-price,
#products .card-availability {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

#products .card-price {
  font-weight: 700;
}

#products .card-availability {
  color: var(--muted);
  font-size: 12px;
}

#products .card-actions .details-button {
  color: #45403a;
  font-size: 12px;
  min-height: 28px;
  text-underline-offset: 3px;
}

#products .card-actions .add {
  width: 100%;
  min-height: 46px;
  padding: 8px 6px;
  border-radius: 4px;
  background: #bc101b;
  color: white;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

#products .card-actions .add:hover {
  background: #990b14;
}

#products .card-quantity {
  justify-content: space-between;
  width: 100%;
}

#products .card-actions .card-quantity button {
  width: 44px;
  height: 44px;
}

#products .card-option-label {
  max-width: 100%;
}

#products button:focus-visible {
  outline: 2px solid #9b0d19;
  outline-offset: 2px;
}

#products .product-image:focus-visible {
  outline-offset: -4px;
}

@media (max-width: 1140px) {
  #products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 740px) {
  #products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #products .card-meta { display: block; }
  #products .card-actions .details-button { text-align: left; }
}

#products .helmet-choices + div > .variant {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
