/* Purchase suggestions (ui.SuggestionBlock): a few other products to buy in
   one click, in the added-to-cart sheet, on the cart page and on a sold-out
   product's page. The row is the ordinary .product-strip holding ordinary
   .product-tile cards; what this pack adds is the block's head, the item that
   stacks a tile over its button, and how many tiles show at once in each
   place — a fraction on purpose, so the edge of the next tile says the row
   scrolls. The strip's own --strip-per-view needs a whole number in an inline
   style, so the count lives here instead. */
.suggest {
  display: grid;
  gap: var(--space-4);
  --suggest-per-view: 2.4;
}

.suggest__head {
  display: grid;
  gap: var(--space-1);
}

.suggest__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-transform);
  color: var(--ink-muted);
}

.suggest__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
}

.suggest .product-strip {
  --strip-gap: var(--space-4);
}

.suggest .product-strip__track > * {
  flex-basis: calc((100% - (var(--suggest-per-view) - 1) * var(--strip-gap)) / var(--suggest-per-view));
}

/* One suggestion: the tile, then its button — "Dodaj" posts the add, "Wybierz
   wersję" leads to the product's page. The tile takes the height left over,
   so the buttons of one row stand on one line. */
.suggest__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.suggest__item > .product-tile {
  flex: 1;
}

.suggest__item .product-tile__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--text-sm);
}

.suggest__item form {
  display: contents;
}

/* The other versions of the product just added, above the tiles in the sheet:
   plain text chips, each an add of that version. */
.suggest__versions {
  display: grid;
  gap: var(--space-3);
}

.suggest__versions .chip {
  gap: var(--space-2);
}

/* In the sheet: under its buttons, on the sheet's own ground. */
.cart-added .suggest {
  padding: var(--space-5) var(--space-6) var(--space-6);
  border-top: 1px solid var(--line);
  background: var(--surface);
  --suggest-per-view: 2.2;
}

/* On a sold-out product's page: under the disabled button, in the info
   column — beside the add-to-cart form rather than in it, since the block's
   own adds are forms and a form cannot hold another. */
.suggest--soldout {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

/* On the cart page: under the lines, in the main column. */
.suggest--cart {
  margin-top: var(--space-8);
}

@media (min-width: 640px) {
  .suggest {
    --suggest-per-view: 4;
  }

  .cart-added .suggest {
    --suggest-per-view: 2.8;
  }

  .suggest--soldout {
    --suggest-per-view: 3.3;
  }
}
