/* =========================================
   Shop Component
   ========================================= */

.shop-section {
  padding: 2rem 2rem 0 2rem;
  width: 100%;
  border-top: 1px solid var(--color-border);
  margin-top: -1px;
}

.shop-header {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.shop-subheader {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 2.5rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Gaps removed to allow precise wireframe borders between items */
}

.shop-item {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

/* Remove the right border on the last item of every row so it stays clean against the edge */
.shop-item:nth-child(3n) {
  border-right: none;
}

.shop-item-link:nth-child(3n) .shop-item {
  border-right: none;
}

.shop-item-link {
  display: contents;
  text-decoration: none;
  color: inherit;
}

.shop-item--full {
  grid-column: span 2;
}

.shop-item__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background-color: #ffffff;
  margin-bottom: 1.25rem;
}

.shop-item--full .shop-item__image {
  aspect-ratio: 21/9;
}

.shop-item__info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  font-family: var(--font-body);
  color: var(--color-text);
}

.shop-item__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.shop-item__desc {
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

.shop-item__price {
  font-size: 0.875rem;
  font-weight: 400;
  margin-top: auto;
}

.shop-see-more {
  display: none;
}

@media (max-width: 768px) {
  .shop-header {
    font-size: 1.5rem;
  }

  .shop-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    scrollbar-width: none;
    gap: 1rem;
  }

  .shop-grid::-webkit-scrollbar {
    display: none;
  }

  .shop-section {
    padding-bottom: 4rem;
  }

  .shop-item,
  .shop-item:nth-child(3n),
  .shop-item-link:nth-child(3n) .shop-item {
    flex: 0 0 80vw;
    scroll-snap-align: center;
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    /* Reduced padding on mobile to make image larger */
  }

  .shop-item__title {
    font-size: 0.8rem;
    /* Smaller title on mobile */
  }

  .shop-item__desc {
    font-size: 0.6rem;
    margin-bottom: 1rem;
  }

  .shop-item__price {
    font-size: 0.65rem;
  }

  .shop-item__image {
    aspect-ratio: 1 / 1;
    margin-bottom: 0.75rem;
  }

  .shop-item--full .shop-item__image {
    aspect-ratio: 2 / 1;
  }

  .shop-see-more {
    display: contents;
  }

  .shop-item--see-more {
    flex: 0 0 80vw;
    scroll-snap-align: center;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
  }

  .shop-see-more__text {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
  }

  /* Override scroll carousel for the dedicated Shop page */
  .shop-section--page .shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
    overflow-x: visible;
  }

  .shop-section--page .shop-item,
  .shop-section--page .shop-item-link:nth-child(3n) .shop-item,
  .shop-section--page .shop-item:nth-child(3n) {
    flex: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    scroll-snap-align: none;
  }

  /* On mobile 2-column grid, remove right border on 2nd item */
  .shop-section--page .shop-item:nth-child(2n),
  .shop-section--page .shop-item-link:nth-child(2n) .shop-item {
    border-right: none;
  }

  /* Remove bottom border on the last row of the 2-column grid */
  .shop-section--page .shop-item-link:last-child .shop-item,
  .shop-section--page .shop-item-link:nth-last-child(2):nth-child(odd) .shop-item {
    border-bottom: none;
  }

  .shop-section--page .shop-item--full {
    grid-column: span 2;
  }
}