/*
 * Product tile. The most-repeated component in the design -- Home, Listing,
 * "frequently bought together" and Buy-again all use it.
 *
 * The tile is a card with a full-bleed link overlay so the whole surface
 * navigates to the PDP, while the add-to-cart button sits above it in the
 * stacking order and stops propagation.
 */

.m-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--cream-100);
  border: 1px solid var(--border-200);
  border-radius: var(--r-card);
  padding: 10px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.m-tile:hover {
  border-color: var(--green-700);
  box-shadow: var(--shadow-card);
}

/* Covers the card so the tile navigates; the Add button sits above it. */
.m-tile__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--r-card);
}

/* ---------------------------------------------------------------------------
 * Image well
 *
 * White surface, white-background pack shot, contain-fitted. mix-blend-mode is
 * deliberately NOT used -- the photos are already cut out on white.
 * ------------------------------------------------------------------------ */

.m-tile__well {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-100);
  border-radius: var(--r-control);
  aspect-ratio: 1 / 1;
  padding: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.m-tile__well img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.m-tile__badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  border-radius: 3px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
}
.m-tile__badge--green  { background: var(--green-700); color: var(--gold-200); }
.m-tile__badge--red    { background: var(--sale-600);  color: #fff; }
.m-tile__badge--gold   { background: var(--gold-500);  color: var(--ink-900); }
.m-tile__badge--muted  { background: var(--border-400); color: var(--ink-700); }

/* ---------------------------------------------------------------------------
 * Body
 * ------------------------------------------------------------------------ */

.m-tile__brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.m-tile__name {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.28;
  color: var(--ink-900);
  text-wrap: pretty;
  margin: 0;
}

.m-tile__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}
.m-tile__rating-value { color: var(--ink-500); }

.m-tile__meta { font-size: 13px; color: var(--ink-500); }

/* Pushes the price row and button to the bottom of an uneven-height grid. */
.m-tile__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-tile__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.m-tile__price-now {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-900);
}
.m-tile__price .m-strike { font-size: 13px; }
.m-tile__price .m-off { font-size: 12px; }

.m-tile__add { position: relative; z-index: 2; }

.m-tile__oos {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-400);
}

/* ---------------------------------------------------------------------------
 * Compact variant: "frequently bought together"
 * ------------------------------------------------------------------------ */

.m-tile--compact .m-tile__foot {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.m-tile--compact .m-tile__price-now { font-size: 16px; }
.m-tile--compact .m-tile__add { padding: 6px 12px; font-size: 13px; }

.m-tile__price-tbc {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-400);
}
