/* The shop (./shop.js, ./productDetail.js, ./productOptions.js). */

.shop {
  padding: 0 var(--card-spacer-x) var(--card-spacer-y);
}

.shop__tabs {
  margin-bottom: 0.75rem;
}

/* grid: 2/3 across by the shop's own width */
.shop__products {
  container-type: inline-size;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@container (min-width: 560px) {
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* a card inside the page's card: the theme's `.card.card-tertiary.border-0`
   (./shop.js), as in the dashboard - only the shop's own sizing here */
.shop-card {
  overflow: hidden;
  min-height: 15rem; /* the skeleton holds a real card's space */
  --flux-skeleton-radius: var(--card-radius);
}

.shop-card__photo {
  aspect-ratio: 4 / 3;
  --flux-skeleton-radius: 0;
}

.shop-card__photo img,
.product-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
  padding: 0.75rem;
}

.shop-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.shop-card__caption {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.shop-card__price {
  color: var(--brand-primary);
  font-size: 1.15rem;
}

/* product detail */
.product-photo {
  width: 100%;
  height: 100%;
  border-radius: var(--media-radius);
  overflow: hidden;
}

.product-detail__photos .flux-card {
  background: none;
}

.product-detail__qty {
  max-width: 10rem;
}

.product-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.product-date {
  min-width: 3.75rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--bs-border-radius-lg);
  cursor: pointer;
  line-height: 1.1;
}

.product-date.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

/* variant options */
.option-group + .option-group {
  margin-top: 0.75rem;
}

.option-group__label {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.option-group__value {
  font-weight: 600;
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.option-label {
  display: inline-flex;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--bs-border-radius-pill);
  cursor: pointer;
  font-size: 0.85rem;
}

.option-label input {
  display: none;
}

.option-label:has(input:checked) {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

.option-label.incompatible {
  opacity: 0.4;
}

/* "In cart · 2" on a product card */
.shop-card__photo {
  position: relative;
}

.shop-card__in-cart {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
}

/* photos full screen (./lightbox.js) */
.lightbox .modal-content {
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.lightbox__track {
  height: 85vh;
}

.lightbox__slide.flux-card {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
}

.lightbox__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* the legacy card: the whole card opens the product */
.shop-card[data-id] {
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.shop-card[data-id]:hover {
  box-shadow: var(--bs-box-shadow);
}

.shop-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.5rem;
  background: var(--bg-primary);
}

.shop-card__price sup {
  font-size: 0.6em;
  font-weight: normal;
  color: var(--text-secondary);
}

.shop-card__from {
  font-size: 0.75em;
  color: var(--text-secondary);
}

.shop-card__options {
  align-self: flex-start;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-weight: 600;
}

.shop-card__action {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* the product modal: its button stays in the footer */
.product-modal__footer .product-detail__actions {
  text-align: center;
}

.product-photo[data-index] {
  cursor: zoom-in;
}
