/* ============================================
   MugShop — Products
   Grid, cards, detail page, filters, carousel
   ============================================ */

/* ══════════════════════════════════════════════
   PRODUCT GRID
   ══════════════════════════════════════════════ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--product-min), 1fr));
  gap: var(--grid-gap);
}

.product-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.product-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}


/* ══════════════════════════════════════════════
   PRODUCT CARD
   ══════════════════════════════════════════════ */

.product-card {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(212, 168, 83, 0.08);
  border-color: var(--color-border-hover);
}

/* Image Area */
.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg-3) 0%, var(--color-bg-4) 100%);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.product-card:hover .product-card__image {
  transform: scale(1.08);
}

/* Badge Overlay */
.product-card__badges {
  position: absolute;
  top: var(--space-3);
  inset-inline-start: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 2;
}

/* Quick View Button */
.product-card__quick-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
  z-index: 1;
}

.product-card:hover .product-card__quick-view {
  opacity: 1;
}

.product-card__quick-view .btn {
  transform: translateY(10px);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.product-card:hover .product-card__quick-view .btn {
  transform: translateY(0);
}

/* Wishlist Button */
.product-card__wishlist {
  position: absolute;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  color: var(--color-white);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--duration-normal) var(--ease-spring);
  z-index: 2;
  border: none;
}

.product-card:hover .product-card__wishlist {
  opacity: 1;
  transform: scale(1);
}

.product-card__wishlist:hover {
  background: var(--color-gold);
  color: var(--color-bg);
}

.product-card__wishlist.active {
  background: var(--color-gold);
  color: var(--color-bg);
  opacity: 1;
  transform: scale(1);
}

/* Card Body */
.product-card__body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__category {
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-1);
}

.product-card__name {
  font-size: var(--font-size-base);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__name a {
  text-decoration: none;
  color: inherit;
}

.product-card__name a:hover {
  color: var(--color-gold);
}

/* Rating */
.product-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Price */
.product-card__price {
  margin-bottom: var(--space-4);
  margin-top: auto;
}

/* Add to Cart Button */
.product-card__action {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.product-card__action .btn {
  width: 100%;
}


/* ══════════════════════════════════════════════
   PRODUCT DETAIL PAGE
   ══════════════════════════════════════════════ */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

/* Left: Gallery */
.product-detail__gallery {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-6));
}

.product-detail__main-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-bg-3);
  margin-bottom: var(--space-4);
}

.product-detail__main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail__thumbnails {
  display: flex;
  gap: var(--space-3);
}

.product-detail__thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.product-detail__thumb:hover,
.product-detail__thumb.active {
  border-color: var(--color-gold);
  opacity: 1;
}

.product-detail__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right: Info */
.product-detail__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.product-detail__breadcrumb {
  margin-bottom: var(--space-2);
}

.product-detail__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.product-detail__rating-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.product-detail__sku {
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
}

.product-detail__price-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.product-detail__description {
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.product-detail__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.product-detail__option-label {
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* Size selector */
.product-detail__sizes {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.product-detail__size {
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  background: var(--color-bg-3);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.product-detail__size:hover {
  border-color: var(--color-border-hover);
  color: var(--color-white);
}

.product-detail__size.active {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: var(--color-gold-dim);
}

.product-detail__size.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Add to Cart + Wishlist Row */
.product-detail__cart-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.product-detail__cart-row .quantity {
  flex-shrink: 0;
}

.product-detail__cart-row .btn--primary {
  flex: 1;
}

/* Features list */
.product-detail__features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.product-detail__feature {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.product-detail__feature svg {
  width: 18px;
  height: 18px;
  color: var(--color-success);
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════
   FILTER SIDEBAR
   ══════════════════════════════════════════════ */

.products-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-8);
}

.filter-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-6));
  height: fit-content;
  max-height: calc(100vh - var(--nav-height) - var(--space-12));
  overflow-y: auto;
  padding: var(--space-5);
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.filter-sidebar__title {
  font-size: var(--font-size-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-sidebar__clear {
  font-size: var(--font-size-xs);
  color: var(--color-gold);
  cursor: pointer;
  border: none;
  background: none;
  font-weight: var(--weight-medium);
}

.filter-sidebar__clear:hover {
  color: var(--color-gold-light);
}

.filter-group {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group__label {
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.filter-group__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Price range slider */
.filter-price-range {
  padding: var(--space-2) 0;
}

.filter-price-range__values {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* Range slider track */
.filter-range {
  width: 100%;
  appearance: none;
  height: 4px;
  background: var(--color-bg-4);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.filter-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--color-gold);
  border-radius: 50%;
  border: 3px solid var(--color-bg-2);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--color-gold);
}


/* ══════════════════════════════════════════════
   CATEGORY PILLS
   ══════════════════════════════════════════════ */

.category-pills {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: all var(--duration-normal) var(--ease-default);
  user-select: none;
}

.category-pill:hover {
  background: var(--color-bg-4);
  color: var(--color-white);
  border-color: var(--color-border-hover);
}

.category-pill.active {
  background: var(--color-gold-dim);
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.category-pill__icon {
  width: 18px;
  height: 18px;
}

.category-pill__count {
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.5em;
  border-radius: var(--radius-full);
}

.category-pill.active .category-pill__count {
  background: rgba(212, 168, 83, 0.2);
}


/* ══════════════════════════════════════════════
   SORT / SEARCH BAR
   ══════════════════════════════════════════════ */

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.products-toolbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.products-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.products-toolbar__count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.products-toolbar__count strong {
  color: var(--color-white);
}

.products-toolbar__search {
  position: relative;
}

.products-toolbar__search .input {
  padding-inline-start: 2.5em;
  width: 220px;
  transition: width var(--duration-normal) var(--ease-default);
}

.products-toolbar__search:focus-within .input {
  width: 280px;
}

.products-toolbar__search-icon {
  position: absolute;
  inset-inline-start: 0.75em;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-dim);
  pointer-events: none;
}

.sort-select {
  min-width: 180px;
}

/* View toggle */
.products-toolbar__view {
  display: flex;
  gap: var(--space-1);
}

.products-toolbar__view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-dim);
  cursor: pointer;
  background: transparent;
  transition: all var(--duration-fast);
}

.products-toolbar__view-btn.active {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background: var(--color-gold-dim);
}

/* List view grid override */
.product-grid--list {
  grid-template-columns: 1fr;
}

.product-grid--list .product-card {
  flex-direction: row;
}

.product-grid--list .product-card__image-wrap {
  width: 200px;
  aspect-ratio: auto;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════
   PRODUCT DETAIL TABS
   ══════════════════════════════════════════════ */

.product-tabs {
  margin-top: var(--space-12);
}

.product-tabs .tabs__list {
  border-bottom: 1px solid var(--color-border);
}

.product-tabs__content {
  padding: var(--space-6) 0;
}

/* Reviews */
.product-review {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
}

.product-review:last-child {
  border-bottom: none;
}

.product-review__content {
  flex: 1;
}

.product-review__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.product-review__author {
  font-weight: var(--weight-semibold);
  color: var(--color-white);
}

.product-review__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
}

.product-review__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.product-review__helpful {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
}


/* ══════════════════════════════════════════════
   RELATED PRODUCTS CAROUSEL
   ══════════════════════════════════════════════ */

.related-products {
  margin-top: var(--space-12);
}

.related-products__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.related-products__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--weight-bold);
}

.related-products__nav {
  display: flex;
  gap: var(--space-2);
}

.related-products__nav-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.related-products__nav-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: var(--color-gold-dim);
}

.related-products__track {
  display: flex;
  gap: var(--grid-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--space-2);
}

.related-products__track::-webkit-scrollbar {
  display: none;
}

.related-products__track .product-card {
  min-width: 270px;
  max-width: 270px;
  scroll-snap-align: start;
  flex-shrink: 0;
}
