/* ============================================
   Ndazog Clothing - Shop Page Styles
   File: shop.css
   Note: Assumes main.css contains global styles
   ============================================ */

/* --------------------------------------------
   Shop Page Header
-------------------------------------------- */
.shop-section {
  padding-top: 2rem;
}

.page-header {
  padding: 4rem 0 3rem;
  text-align: center;
}

.page-header .section-tag {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.page-header .page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.page-header > p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
}

/* --------------------------------------------
   Product Grid Layout - Shop Specific
-------------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* --------------------------------------------
   Product Card - Shop Context
-------------------------------------------- */
.product-card {
  background: #fff;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-card:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* Image Container */
.product-image-container {
  position: relative;
  display: block;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  flex-shrink: 0;
}

.product-card > a {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.product-card > a:focus-visible {
  outline: none;
  border-radius: inherit;
}

.product-image {
  position: relative;
  aspect-ratio: 3/4;
  background-color: #ececec;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  background-color: transparent;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Badges */
.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  border-radius: 2px;
  z-index: 1;
}

.badge-new {
  background: var(--accent);
}

.badge-sale {
  background: #e74c3c;
}

.badge-hot {
  background: #f39c12;
}

/* Action Buttons */
.product-actions {
  position: absolute;
  right: 1rem;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateX(10px);
  transition: var(--transition);
  z-index: 2;
}

.product-card:hover .product-actions,
.product-card:focus-within .product-actions {
  opacity: 1;
  transform: translateX(0);
}

.action-btn {
  width: 40px;
  height: 40px;
  background: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--accent);
}

.action-btn:hover svg {
  stroke: #fff;
}

.action-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.action-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-primary);
  fill: none;
  stroke-width: 1.8;
}

/* Quick Add Button */
.product-card .quick-add {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--text-primary);
  color: #fff;
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transform: translateY(100%);
  transition: var(--transition);
  border: none;
  width: 100%;
  z-index: 2;
}

.product-card .quick-add:focus-visible {
  outline: var(--focus-ring);
  outline-offset: -3px;
}

.product-card:hover .quick-add {
  transform: translateY(0);
}

/* Product Info */
.product-info {
  padding: 1.2rem 0.5rem;
  background: #fff;
  position: relative;
  z-index: 1;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.product-category {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.price-current {
  font-weight: 700;
  font-size: 1.1rem;
}

.price-original {
  font-size: 0.9rem;
  color: var(--text-light);
  text-decoration: line-through;
}

/* --------------------------------------------
   Fade-in Animation for Products
-------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for grid items */
.products-grid .fade-in:nth-child(1) { transition-delay: 0.05s; }
.products-grid .fade-in:nth-child(2) { transition-delay: 0.1s; }
.products-grid .fade-in:nth-child(3) { transition-delay: 0.15s; }
.products-grid .fade-in:nth-child(4) { transition-delay: 0.2s; }
.products-grid .fade-in:nth-child(5) { transition-delay: 0.25s; }
.products-grid .fade-in:nth-child(6) { transition-delay: 0.3s; }
.products-grid .fade-in:nth-child(7) { transition-delay: 0.35s; }
.products-grid .fade-in:nth-child(8) { transition-delay: 0.4s; }
.products-grid .fade-in:nth-child(9) { transition-delay: 0.45s; }
.products-grid .fade-in:nth-child(10) { transition-delay: 0.5s; }
.products-grid .fade-in:nth-child(11) { transition-delay: 0.55s; }
.products-grid .fade-in:nth-child(12) { transition-delay: 0.6s; }

/* --------------------------------------------
   Image Fallback State
-------------------------------------------- */
img.img-fallback {
  object-fit: contain;
  padding: 1rem;
  opacity: 0.6;
}

/* --------------------------------------------
   Added to Cart Toast Notification
-------------------------------------------- */
.added-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  z-index: 10000;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
}

.added-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* --------------------------------------------
   Responsive Breakpoints - Shop Specific
-------------------------------------------- */

/* Tablet: 3 columns */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  
  .page-header {
    padding: 3.5rem 0 2.5rem;
  }
}

/* Mobile: 2 columns + adjusted spacing */
@media (max-width: 768px) {
  .shop-section {
    padding-top: 1rem;
  }
  
  .page-header {
    padding: 3rem 0 2rem;
  }
  
  .page-header .page-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .product-card:hover,
  .product-card:focus-within {
    transform: translateY(-3px);
  }
  
  .product-image {
    aspect-ratio: 4/5;
  }
  
  .product-info {
    padding: 1rem 0.5rem;
  }
  
  .product-name {
    font-size: 0.9rem;
  }
  
  .price-current {
    font-size: 1rem;
  }
  
  .product-badge {
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
  }
  
  .product-actions {
    right: 0.75rem;
    top: 0.75rem;
  }
  
  .action-btn {
    width: 36px;
    height: 36px;
  }
  
  .action-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .product-card .quick-add {
    padding: 0.85rem 1.25rem;
    font-size: 0.8rem;
  }
  
  .added-toast {
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* Mobile Small: 1 column */
@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .page-header {
    padding: 2.5rem 0 1.75rem;
  }
  
  .page-header .section-tag {
    font-size: 0.75rem;
    letter-spacing: 2.5px;
  }
  
  .product-image {
    aspect-ratio: 3/4;
  }
  
  .product-info {
    padding: 1.1rem 0.75rem;
  }
  
  .product-name {
    font-size: 1rem;
  }
  
  .product-category {
    font-size: 0.75rem;
  }
  
  .price-current {
    font-size: 1.1rem;
  }
  
  .product-badge {
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.65rem;
  }
  
  .product-actions {
    right: 1rem;
    top: 1rem;
  }
  
  .action-btn {
    width: 38px;
    height: 38px;
  }
  
  .product-card .quick-add {
    padding: 0.9rem 1.5rem;
    font-size: 0.85rem;
  }
}

/* --------------------------------------------
   Reduced Motion Preference
-------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .product-card,
  .product-image img,
  .product-actions,
  .product-card .quick-add,
  .added-toast {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
  
  .fade-in {
    opacity: 1 !important;
  }
  
  .product-card:hover,
  .product-card:focus-within {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
  }
  
  .product-card:hover .product-image img {
    transform: none !important;
  }
  
  .product-card:hover .product-actions {
    opacity: 1 !important;
    transform: none !important;
  }
  
  .product-card:hover .quick-add {
    transform: none !important;
  }
}

/* --------------------------------------------
   High Contrast Mode Support
-------------------------------------------- */
@media (prefers-contrast: high) {
  .product-card:focus-visible {
    outline-width: 4px;
  }
  
  .action-btn:focus-visible,
  .product-card .quick-add:focus-visible {
    outline-width: 3px;
  }
  
  .price-original {
    opacity: 0.7;
  }
}