/* konfetki/prototip/ProductTile.dc.html:10–56; index.html:2050–2074 (tile). */
.k-tile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  height: 100%;
}

.k-tile--tint-0 { --k-tile-tint: var(--k-tint-raspberry); }
.k-tile--tint-1 { --k-tile-tint: var(--k-tint-peach); }
.k-tile--tint-2 { --k-tile-tint: var(--k-tint-warm); }

/* ProductTile.dc.html:11–12; index.html:2063. */
.k-tile__photo {
  position: relative;
  overflow: hidden;
  flex: none;
  aspect-ratio: 312 / 320;
  border-radius: 28px;
  background: var(--k-tile-tint);
}

.k-tile__image-link { position: absolute; inset: 0; }
.k-tile__image-link:focus-visible { outline-offset: -4px; }

.k-tile__image {
  position: absolute;
  left: 12.8%;
  top: 13.75%;
  width: 74.4%;
  height: 72.5%;
  object-fit: contain;
}

/* ProductTile.dc.html:13–17; index.html:1730, :2057, :2063, :2074. */
.k-tile__badge, .k-tile__fav {
  position: absolute;
  inset-block-start: 16px;
}

.k-tile__badge { inset-inline-start: 16px; pointer-events: none; }

.k-tile__fav {
  inset-inline-end: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: calc(var(--rounded-full) * 1px);
  background: var(--bg-default);
  color: var(--typo-primary);
  cursor: pointer;
}

.k-tile__fav:hover { background: var(--bg-surface); }
.k-tile__fav[aria-pressed="true"] { color: var(--typo-brand); }

.k-tile__fav[aria-pressed="true"] .k-tile__fav-outline,
.k-tile__fav[aria-pressed="false"] .k-tile__fav-filled { display: none; }

/* ProductTile.dc.html:20–23; index.html:2063. */
.k-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding-inline: 8px;
}

.k-tile__brand {
  overflow: hidden;
  min-height: 20px;
  color: var(--typo-secondary);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.k-tile__name {
  display: -webkit-box;
  overflow: hidden;
  min-height: 40px;
  color: var(--typo-primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.k-tile__name:hover { color: var(--typo-primary); }

/* ProductTile.dc.html:23–33; index.html:2054, :2063–2073. */
.k-tile__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 0;
  margin-top: auto;
  padding-block: 8px;
}

.k-tile__prices {
  display: flex;
  flex: 9999 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  white-space: nowrap;
}

.k-tile__price {
  color: var(--typo-primary);
  font-size: 16px;
  line-height: 28px;
  font-weight: 600;
}

.k-tile__old-price {
  color: var(--typo-secondary);
  font-size: 12px;
  line-height: 16px;
}

/* ProductTile.dc.html:37–56; index.html:2067–2073. The threshold excludes the body's 2 x 8px padding. */
.k-tile__bottom > :is(.k-tile-add, .k-tile__stepper) {
  flex: 1 0 auto;
  min-width: clamp(0px, (202px - 100%) * 999, 100%);
  margin-block: 2px;
}

.k-tile .k-tile-add[aria-disabled="true"] {
  background: var(--k-btn-bg);
  color: var(--k-btn-ink);
}
.k-tile .k-tile-add--added:hover { color: var(--k-btn-ink); }

.k-tile__stepper {
  display: flex;
  align-items: center;
  height: 40px;
  border-radius: calc(var(--rounded-full) * 1px);
  background: var(--control-primary-bg);
  color: var(--typo-inverted);
  font-size: 14px;
  font-weight: 600;
}

.k-tile__stepper button {
  width: 38px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

.k-tile__stepper button:disabled { opacity: .5; cursor: default; }
.k-tile__stepper button:focus-visible { outline-offset: 2px; }
.k-tile__stepper span { flex: 1; min-width: 16px; text-align: center; }
.k-tile__bottom > [hidden] { display: none; }

/* Mobile geometry comes from index.html:2062. */
@media (max-width: 767.98px) {
  .k-tile__photo { aspect-ratio: 171 / 188; }
  .k-tile__image {
    left: 10.2%;
    top: 19.1%;
    width: 79.6%;
    height: 72.3%;
    filter: drop-shadow(0 24px 40px rgba(115, 26, 31, .25));
  }

  .k-tile__badge, .k-tile__fav { inset-block-start: 8px; }
  .k-tile__badge { inset-inline-start: 8px; }
  .k-tile__badge .k-badge { height: 24px; }
  .k-tile__fav { inset-inline-end: 8px; width: 32px; height: 32px; }

  .k-tile__brand { font-size: 14px; }
  .k-tile__name { min-height: 48px; font-size: 16px; line-height: 24px; }

  .k-tile__bottom { flex-flow: column; align-items: stretch; gap: 8px; }
  .k-tile__prices { flex: 0 1 auto; min-height: 0; }
  .k-tile__price { font-size: 20px; }
  .k-tile__bottom > :is(.k-tile-add, .k-tile__stepper) { flex: 0 0 auto; width: 100%; min-width: 0; margin: 0; }
  .k-tile [data-tile-add] .k-icon { display: none; }
}
