/* Shared, bounded shopping discovery for cart and post-order customer views. */

.customer-order-discovery {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 0;
  padding: clamp(10px, 1.1vw, 12px);
  overflow: hidden;
  border: 1px solid var(--customer-border, #d6e1ef);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(15, 35, 67, 0.045);
}

.customer-area > .customer-order-discovery {
  grid-column: 1 / -1;
}

.checkout-page--status > .customer-order-discovery {
  margin-top: clamp(22px, 4vw, 36px);
}

.checkout-page--cart > .customer-order-discovery {
  margin-top: clamp(18px, 3vw, 28px);
}

.customer-order-discovery__header {
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--customer-border, #e1e8f1);
}

.customer-order-discovery__header h2 {
  margin: 0;
  color: var(--customer-ink, #10284d);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.customer-order-discovery .category-product-rail {
  min-width: 0;
  margin: 0;
}

.customer-order-discovery .category-product-rail + .category-product-rail {
  padding-top: 10px;
  border-top: 1px solid var(--customer-border, #e1e8f1);
}

.customer-order-discovery .category-product-rail__heading {
  margin-bottom: 6px;
}

.customer-order-discovery .category-product-rail__heading > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
  min-width: 0;
}

.customer-order-discovery .category-product-rail__heading :is(h2, h3) {
  margin: 0;
  color: var(--customer-ink, #10284d);
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
}

.customer-order-discovery .category-product-rail__heading :is(h2, h3) a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.customer-order-discovery .category-product-rail__heading-title--visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.customer-order-discovery .category-product-rail__heading p:not(.eyebrow) {
  display: none;
}

.customer-order-discovery .category-product-rail__eyebrow {
  margin: 0;
  color: var(--customer-muted, #64748b);
  font-size: 0.66rem;
  letter-spacing: 0.055em;
}

.customer-order-discovery .collection-scroller__viewport {
  padding: 1px 2px 4px;
  scroll-snap-type: x proximity;
}

.customer-order-discovery .collection-scroller__track {
  gap: 8px;
}

.customer-order-discovery .collection-scroller__track > .customer-discovery-card {
  flex: 0 0 clamp(132px, 10.5vw, 148px);
}

.customer-discovery-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  overflow: hidden;
  color: var(--customer-ink, #10284d);
  text-decoration: none;
  scroll-snap-align: start;
  border: 1px solid var(--customer-border, #dbe5f1);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgba(15, 35, 67, 0.045);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.customer-discovery-card:hover {
  color: var(--customer-ink, #10284d);
  text-decoration: none;
  border-color: #b9cce7;
  box-shadow: 0 6px 14px rgba(15, 35, 67, 0.09);
  transform: translateY(-1px);
}

.customer-discovery-card:focus-visible {
  outline: 3px solid #8fb1eb;
  outline-offset: 2px;
}

.customer-discovery-card__media {
  display: grid;
  place-items: center;
  height: clamp(96px, 9vw, 112px);
  min-width: 0;
  overflow: hidden;
  border-radius: 7px;
  background: #ffffff;
}

.customer-discovery-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  transition: transform 180ms ease;
}

.customer-discovery-card:hover .customer-discovery-card__media img {
  transform: scale(1.025);
}

.customer-discovery-card__placeholder {
  max-width: 11ch;
  color: var(--customer-muted, #64748b);
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
}

.customer-discovery-card__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 1px 1px 2px;
}

.customer-discovery-card__name {
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-discovery-card__price {
  color: var(--customer-ink, #10284d);
  font-size: 0.79rem;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.customer-order-discovery .customer-discovery-card__summary {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 4px;
}

.customer-order-discovery .customer-discovery-card__name {
  display: -webkit-box;
  min-height: calc(1.25em * 3);
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.customer-order-discovery .customer-discovery-card__price {
  justify-self: end;
}

.customer-order-discovery .collection-scroller__arrow {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.checkout-status-account-invitation {
  border-style: dashed;
  background: #f8fbff;
  box-shadow: none;
}

.checkout-status-account-invitation .button {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .customer-order-discovery {
    gap: 10px;
    padding: 10px;
  }

  .customer-order-discovery .category-product-rail + .category-product-rail {
    padding-top: 10px;
  }

  .customer-order-discovery .collection-scroller__track > .customer-discovery-card {
    flex-basis: min(38vw, 138px);
  }

  .customer-discovery-card__media {
    height: 96px;
  }

  .customer-discovery-card__name {
    font-size: 0.73rem;
  }

  .customer-discovery-card__price {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-order-discovery .collection-scroller__viewport {
    scroll-behavior: auto;
  }

  .customer-discovery-card,
  .customer-discovery-card__media img {
    transition: none;
  }
}
