/*
 * Shop grid additions. Enqueued after the child style.css, like mega-menu.css.
 */

/* Age and size on product cards: a label and small pills per row, between
   the title and the price. */
ul.products li.product .kfm-loop-attrs {
  margin: 0 0 10px;
}

ul.products li.product .kfm-loop-attr {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}

ul.products li.product .kfm-loop-attr__label {
  margin-right: 2px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000;
}

ul.products li.product .kfm-loop-attr__values {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.products li.product .kfm-loop-attr__values li {
  margin: 0;
  padding: 1px 9px;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.3px;
  color: var(--gray);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
}

/* ------------------------------------------------------------------
   Compact cards (KFM_CARD_STYLE = 'compact' in functions.php).
   Everything below is scoped to body.kfm-cards-compact, so switching
   back to 'pills' restores the first version untouched.
   ------------------------------------------------------------------ */

/* Card as a column: the details stack under the image and the button sits
   on the bottom edge, so prices and buttons line up across a row whatever
   the title length. */
.kfm-cards-compact ul.products li.product {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
}

.kfm-cards-compact ul.products li.product .woocommerce-loop-product__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
}

.kfm-cards-compact ul.products li.product img {
  margin-bottom: 18px;
}

.kfm-cards-compact ul.products li.product .woocommerce-loop-product__title {
  margin: 0 0 8px;
  padding: 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 1px;
}

.kfm-cards-compact ul.products li.product .kfm-card-meta {
  margin: 0 0 10px;
}

.kfm-cards-compact ul.products li.product .kfm-card-meta__row {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6d6d6d;
}

.kfm-cards-compact ul.products li.product .kfm-card-meta__label {
  margin-right: 4px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a3a3a3;
}

.kfm-cards-compact ul.products li.product .price {
  margin: auto 0 14px;
  padding-top: 2px;
  font-size: 15px;
  color: #000;
}

.kfm-cards-compact ul.products li.product .button {
  margin-top: 0;
}

/* Storefront floats the 3-column desktop grid, so cards in a row don't share
   a height and the bottom-aligned buttons drift. A real grid fixes that. */
@media screen and (min-width: 901px) {
  .kfm-cards-compact ul.products.columns-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px 30px;
  }

  .kfm-cards-compact ul.products.columns-3::before,
  .kfm-cards-compact ul.products.columns-3::after {
    display: none;
  }

  body.kfm-cards-compact .site-main ul.products.columns-3 li.product {
    float: none;
    width: auto;
    margin: 0;
  }
}

.kfm-cards-compact ul.products li.product .kfm-card-meta__row {
  font-size: 14px;
  color: #555;
}

.kfm-cards-compact ul.products li.product .kfm-card-meta__label {
  font-size: 11px;
  color: #8a8a8a;
}
