/* ========================================
   SHOP PAGE UI ENHANCEMENTS
   Modern, Consistent & User-Friendly
   ======================================== */

/* ========================================
   ENHANCED SEARCH BAR
   ======================================== */
.search-container {
  max-width: 700px;
  margin: var(--spacing-xl) auto 0;
  position: relative;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  padding: var(--spacing-xs);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 40px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.search-input {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 1.05rem;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.search-input:focus::placeholder {
  color: rgba(255, 255, 255, 1);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--white);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.search-btn:hover {
  background: var(--light-color);
  transform: scale(1.05);
}

.search-btn:active {
  transform: scale(0.98);
}

.search-btn svg {
  width: 22px;
  height: 22px;
  color: var(--primary-color);
  stroke-width: 2;
}

/* ========================================
   CATEGORIES NAVIGATION BAR
   ======================================== */
.categories-nav {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-2xl);
  overflow: hidden;
}

.categories-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--light-color);
}

.categories-nav-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 0;
}

.categories-scroll {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--spacing-xs) 0;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--light-color);
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.category-chip:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-chip.active {
  background: var(--brand-lilac);
  color: var(--white);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.category-chip svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ========================================
   PRODUCT CARDS
   ======================================== */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(30, 58, 95, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Compatibility with old class names */
.product-image-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--light-color);
}

.product-info {
  padding: var(--spacing-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-color);
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
}

.product-pricing {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.original-price {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
}

.product-actions {
  margin-top: auto;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-deepest-blue);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover::before {
  opacity: 1;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(10, 22, 40, 0.15), 0 10px 20px rgba(10, 22, 40, 0.10);
}

.product-image-container {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--light-color);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

/* Product Overlay for Quick View */
.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 22, 40, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.quick-view-btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--white);
  color: var(--primary-color);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

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

.product-badge {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--brand-lilac);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.product-badge.new {
  background: var(--brand-beige);
}

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

/* Compatibility with old badge classes */
.sale-badge,
.featured-badge {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--brand-lilac);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.sale-badge {
  background: #ef4444;
}

.product-content {
  padding: var(--spacing-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.product-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-color);
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.product-card:hover .product-title {
  color: var(--primary-color);
}

.product-age-range {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

.product-age-range svg {
  width: 14px;
  height: 14px;
  color: var(--primary-color);
}

.product-meta {
  margin-top: auto;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--light-color);
}

.product-price-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  text-align: center;
  width: 100%;
}

.price-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.product-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
}

.product-price.original {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
  margin-right: var(--spacing-xs);
}

.product-price .currency {
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: super;
  margin-right: 2px;
}

.add-to-cart-btn {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--brand-lilac);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.add-to-cart-btn:hover::before {
  width: 250px;
  height: 250px;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.add-to-cart-btn:active {
  transform: translateY(0);
}

.add-to-cart-btn.added {
  background: var(--brand-beige);
}

.add-to-cart-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.add-to-cart-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.add-to-cart-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.product-stock-status {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.85rem;
  margin-top: var(--spacing-xs);
}

.product-stock-status.in-stock {
  color: var(--success-color);
}

.product-stock-status.low-stock {
  color: var(--warning-color);
}

.product-stock-status.out-of-stock {
  color: var(--error-color);
}

.stock-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stock-indicator.in-stock {
  background: var(--success-color);
}

.stock-indicator.low-stock {
  background: var(--warning-color);
  animation: pulse 2s ease-in-out infinite;
}

.stock-indicator.out-of-stock {
  background: var(--error-color);
}

/* ========================================
   AGE GROUP CARDS
   ======================================== */
.age-group-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.age-group-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
}

.age-group-card.active {
  border-color: var(--primary-color);
  background: var(--brand-lilac);
  color: var(--white);
}

.age-group-card.active h3,
.age-group-card.active p {
  color: var(--white);
}

.age-group-icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
  transition: var(--transition);
}

.age-group-card:hover .age-group-icon {
  transform: scale(1.1);
}

.age-group-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: var(--spacing-xs);
  transition: color 0.3s ease;
}

.age-group-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0;
  transition: color 0.3s ease;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .search-wrapper {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .search-btn {
    width: 100%;
  }

  .search-input {
    width: 100%;
    text-align: center;
  }

  .categories-nav {
    padding: var(--spacing-md);
  }

  .categories-scroll {
    gap: var(--spacing-sm);
  }

  .category-chip {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.9rem;
  }

  .product-price {
    font-size: 1.2rem;
  }

  .product-image-container {
    height: 180px;
  }

  .age-group-card {
    padding: var(--spacing-md);
  }

  .age-group-icon {
    width: 60px;
    height: 60px;
  }

  /* Hide quick view overlay on mobile */
  .product-overlay {
    display: none;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .categories-scroll {
    justify-content: center;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.products-grid .product-card {
  animation: fadeInUp 0.6s ease-out backwards;
}

.products-grid .product-card:nth-child(1) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.4s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.5s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
