/**
 * Product / search-result cards (.child-results / .child-card), shared by the
 * search results page and dropdown.
 *
 * Compact vertical cards (image over title/excerpt). .child-results is an
 * auto-fit grid that adds/removes columns with the container width; each card
 * is capped and centered so a lone card stays a normal product card instead of
 * stretching the whole row.
 */

.child-results,
.child-results__pagination {
  --billys-brand: #de2629;
}

.child-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  /* Align capped cards to the start of their track. */
  justify-items: start;
}

.child-card {
  /* Cap width so a lone card stays a normal product card instead of
     stretching the whole row. */
  width: 100%;
  max-width: 22rem;

  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.child-card:hover,
.child-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  border-color: var(--billys-brand);
}

.child-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
}

.child-card__media img {
  width: 100%;
  height: 100%;
  /* contain, not cover — show the whole product, don't crop it. */
  object-fit: contain;
  display: block;
  padding: 0.75rem;
  box-sizing: border-box;
  transition: transform 0.5s ease;
}

.child-card:hover .child-card__media img {
  transform: scale(1.04);
}

/* No thumbnail → drop the empty gray box (:has dodges the :empty whitespace trap). */
.child-card:not(:has(.child-card__media img)) .child-card__media {
  display: none;
}

.child-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
}

.child-card__type {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--billys-brand);
}

.child-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}

.child-card__title a {
  color: #0f172a;
  text-decoration: none;
}

.child-card__title a:hover {
  color: var(--billys-brand);
}

.child-card__excerpt {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #475569;
}

.child-card__price {
  font-weight: 700;
  color: #0f172a;
}

.child-card__more {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--billys-brand);
  text-decoration: none;
}

.child-card__more::after {
  content: " →";
}

/* Pagination (search results page) */
.child-results__pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}

.child-results__pagination a,
.child-results__pagination span {
  padding: 0.5rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-decoration: none;
  color: #334155;
  font-weight: 600;
}

.child-results__pagination .current {
  background: var(--billys-brand);
  border-color: var(--billys-brand);
  color: #fff;
}

.child-results__empty {
  margin: 1.5rem 0;
  color: #475569;
}
