/* ============================================================
   THE BATH & BODY SPOT — Shop Page & Product Cards
   ============================================================ */

/* ── Shop Page Layout ────────────────────────────── */
#page-shop {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-20);
  min-height: 70vh;
}

.shop-header {
  padding: var(--sp-10) 0 var(--sp-6);
  text-align: center;
  background: linear-gradient(180deg, var(--blush-lightest) 0%, transparent 100%);
}

.shop-header-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 600;
  color: var(--text-dark);
}

.shop-header-subtitle {
  color: var(--text-light);
  font-size: var(--text-base);
  margin-top: var(--sp-2);
}

/* ── Filter + Sort Bar ───────────────────────────── */
.shop-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-4) 0 var(--sp-6);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--sp-8);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  background: var(--white);
  color: var(--text-mid);
  border: 1.5px solid var(--border-soft);
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--blush-deep);
  color: var(--pink-vibrant);
  background: var(--blush-lightest);
}

.filter-chip.active {
  background: var(--pink-vibrant);
  color: var(--white);
  border-color: var(--pink-vibrant);
  box-shadow: var(--shadow-pink);
}

.shop-controls-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.shop-result-count {
  font-size: var(--text-sm);
  color: var(--text-light);
  white-space: nowrap;
  font-family: var(--font-label);
}

.sort-select {
  padding: 8px 36px 8px 14px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  color: var(--text-mid);
  background: var(--white);
  cursor: pointer;
  transition: all var(--ease-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23B89090' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sort-select:focus,
.sort-select:hover {
  border-color: var(--blush-deep);
  outline: none;
}

/* ── Product Grid ────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
  align-items: stretch;
}

/* ── Product Card ────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-soft);
  transition: all var(--ease-med);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: auto;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blush-mid);
}

/* Image Area */
.product-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--blush-lightest);
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease-silk);
}

.product-card:hover .product-card-img {
  transform: scale(1.07);
}

/* Second image on hover */
.product-card-img-alt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-card:hover .product-card-img-alt {
  opacity: 1;
}

/* Card badges */
.product-card-badges {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  z-index: 2;
}

/* Wishlist button */
.wishlist-btn {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--ease-med);
  box-shadow: var(--shadow-xs);
}

.wishlist-btn:hover {
  transform: scale(1.12);
  box-shadow: var(--shadow-sm);
}

.wishlist-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-mid);
  fill: transparent;
  transition: all var(--ease-med);
}

.wishlist-btn.active svg {
  stroke: var(--pink-vibrant);
  fill: var(--pink-vibrant);
  animation: heartPop 0.4s var(--ease-bounce);
}

/* Quick view overlay */
.quick-view-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-3);
  background: linear-gradient(0deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
  transform: translateY(100%);
  transition: transform var(--ease-med);
  display: flex;
  justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover .quick-view-overlay {
    transform: translateY(0);
  }
}

.quick-view-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1.5px solid var(--border-mid);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--ease-fast);
  backdrop-filter: blur(10px);
}

.quick-view-btn:hover {
  background: var(--pink-vibrant);
  color: var(--white);
  border-color: var(--pink-vibrant);
}

/* Card Info Area */
.product-card-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card-category {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose-gold);
  margin-bottom: var(--sp-1);
}

.product-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: var(--sp-1);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-sku {
  font-size: var(--text-xs);
  color: var(--text-placeholder);
  font-family: var(--font-label);
  margin-bottom: var(--sp-3);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
}

.product-card-price {
  font-family: var(--font-label);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-dark);
}

.product-card-price .currency {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-light);
  vertical-align: top;
  line-height: 2.2;
}

.product-card-stock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-label);
  font-size: var(--text-xs);
  color: var(--text-light);
}

.stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4CAF87;
  flex-shrink: 0;
}

.stock-dot.low { background: var(--rose-gold); }
.stock-dot.out { background: var(--blush-deep); }

.product-card-add-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--grad-pink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--ease-med);
  flex-shrink: 0;
  box-shadow: var(--shadow-pink);
}

.product-card-add-btn:hover {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: var(--shadow-glow);
}

.product-card-add-btn:active {
  transform: scale(0.95);
}

.product-card-add-btn svg {
  width: 16px;
  height: 16px;
}

/* Add to Cart Success State */
.btn-added-success {
  background: #25D366 !important; /* WhatsApp/Success Green */
  color: var(--white) !important;
  pointer-events: none;
  animation: tickPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
  transform: none !important;
}

@keyframes tickPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Out of Stock state */
.product-card.out-of-stock .product-card-img-wrap {
  filter: grayscale(0.3) brightness(1.05);
}

.product-card.out-of-stock .product-card-add-btn {
  background: var(--blush-mid);
  box-shadow: none;
  pointer-events: none;
}

.product-card-out-label {
  width: 100%;
  text-align: center;
  padding: 8px;
  background: var(--cream-dark);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.08em;
}

/* Notify Me button for OOS */
.notify-me-btn {
  width: 100%;
  padding: 8px;
  text-align: center;
  background: transparent;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--ease-fast);
  margin-top: var(--sp-2);
}

.notify-me-btn:hover {
  background: var(--blush-light);
  border-color: var(--blush-deep);
  color: var(--text-dark);
}

/* ── Star Ratings on Cards ───────────────────────── */
.product-card-rating {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.product-card-rating .stars {
  font-size: 12px;
}

.product-card-rating-count {
  font-size: var(--text-xs);
  color: var(--text-placeholder);
}

/* ── Load More ───────────────────────────────────── */
.shop-load-more {
  text-align: center;
  margin-top: var(--sp-12);
}

/* ── Skeleton Card ───────────────────────────────── */
.product-card-skeleton {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.product-card-skeleton .ske-img {
  aspect-ratio: 1/1;
  width: 100%;
}

.product-card-skeleton .ske-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.ske-line-sm  { height: 12px; width: 60%; }
.ske-line-md  { height: 14px; width: 85%; }
.ske-line-lg  { height: 14px; width: 100%; }
.ske-line-xs  { height: 10px; width: 40%; }

/* ── Empty State ─────────────────────────────────── */
.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-24) var(--sp-8);
}

.shop-empty-icon {
  font-size: 64px;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.shop-empty-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-style: italic;
  color: var(--text-mid);
  margin-bottom: var(--sp-3);
}

.shop-empty-text {
  color: var(--text-light);
  margin-bottom: var(--sp-6);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
  }

  .shop-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-chips {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--sp-2);
    scrollbar-width: none;
  }

  .filter-chips::after {
    content: '';
    padding-right: var(--sp-4);
  }

  .filter-chips::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .product-card-body {
    padding: var(--sp-3);
  }

  .product-card-name {
    font-size: var(--text-sm);
  }

  .product-card-price {
    font-size: var(--text-sm);
  }

  .product-card-add-btn {
    width: 30px;
    height: 30px;
  }
  
  .product-card-add-btn svg {
    width: 14px;
    height: 14px;
  }
}
