/**
 * ANFISA Collections Page - Plain CSS (No Tailwind complications)
 * Based on https://anfisaskin.com/collections
 */

/* ============================================
   Product Image Container
   ============================================ */

.store-product-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.store-product-image::before {
  content: '';
  display: block;
  padding-top: 120%; /* 5:6 aspect ratio - portrait (taller than wide) like ANFISA */
}

.store-product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Main image visible by default */
.store-product-image-main {
  opacity: 1;
  z-index: 1;
}

/* Hover image hidden by default */
.store-product-image-hover {
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
}

/* On hover, ONLY fade if there's a hover image present */
.store-product-image:has(.store-product-image-hover) .store-product-image-main {
  transition: opacity 0.4s ease;
}

.store-product-card:hover .store-product-image:has(.store-product-image-hover) .store-product-image-main {
  opacity: 0;
}

.store-product-card:hover .store-product-image-hover {
  opacity: 1;
}

/* No image fallback */
.store-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
  font-size: 0.875rem;
  background: #f9fafb;
}

/* ============================================
   Quick Add Button - ANFISA Style
   ============================================ */

.store-product-quick-add {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #66645e;
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: all 0.25s ease-in-out;
}

.store-product-card:hover .store-product-quick-add {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.store-product-quick-add:hover {
  background: #58564f;
}

.store-product-quick-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* In cart state - show item is already in cart */
.store-product-quick-add.in-cart {
  background: var(--store-primary, #383B3B);
  color: #fff;
}

.store-product-quick-add.in-cart:hover {
  background: var(--store-primary_hover, #2a2d2d);
}

/* Just added animation - brief success feedback */
.store-product-quick-add.just-added {
  background: var(--store-primary, #383B3B);
  animation: pulse-success 0.5s ease-out;
}

@keyframes pulse-success {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(0) scale(1.05);
    background: var(--store-accent, #D3C9BE);
  }
}

/* ============================================
   Product Badges
   ============================================ */

.store-product-badges {
  position: absolute;
  left: 16px;
  top: 5px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-product-badge {
  background: #000;
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.store-product-badge.badge-sale {
  background: #ef4444;
}

.store-product-badge.badge-sold-out {
  background: #6b7280;
}

/* ============================================
   Out of Stock State
   ============================================ */

.store-product-card.out-of-stock {
  opacity: 0.6;
}

.store-product-card.out-of-stock .store-product-image::after {
  content: 'Sold Out';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 5;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
  /* Always show Add to Cart button on mobile (no hover on touch devices) */
  .store-product-quick-add {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Disable hover image swap on mobile */
  .store-product-card:hover .store-product-image:has(.store-product-image-hover) .store-product-image-main {
    opacity: 1;
  }

  .store-product-card:hover .store-product-image-hover {
    opacity: 0;
  }
}
