/**
 * Store Page Styles
 * Professional product browsing with filtering
 */

/* ========================================
   STORE HEADER
   ======================================== */

.store-header {
  padding: var(--space-20) 0 var(--space-12);
  text-align: center;
  background: linear-gradient(180deg, var(--theme-bg-secondary) 0%, var(--theme-bg-primary) 100%);
}

.store-header__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: var(--font-extrabold);
  margin-bottom: var(--space-4);
  line-height: 1.1;
}

.store-header__description {
  font-size: var(--text-xl);
  color: var(--theme-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   FILTERS BAR
   ======================================== */

.store-filters {
  padding: var(--space-8) 0;
  background: var(--theme-bg-primary);
  border-bottom: 1px solid var(--theme-border-subtle);
  position: sticky;
  top: var(--navbar-height);
  z-index: var(--z-sticky);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
}

.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--radius-lg);
  color: var(--theme-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-border-medium);
  color: var(--theme-text-primary);
}

.filter-btn--active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
  border-color: var(--theme-accent-primary);
  color: var(--theme-accent-primary);
}

.filter-btn svg {
  width: 16px;
  height: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--radius-lg);
  min-width: 280px;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--theme-accent-primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.search-box svg {
  color: var(--theme-text-tertiary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--theme-text-primary);
  font-size: var(--text-sm);
  outline: none;
}

.search-input::placeholder {
  color: var(--theme-text-muted);
}

/* ========================================
   PRODUCTS SECTION
   ======================================== */

.store-products {
  padding: var(--space-16) 0;
}

.products-section {
  margin-bottom: var(--space-20);
}

.products-section:last-child {
  margin-bottom: 0;
}

.products-section__header {
  margin-bottom: var(--space-8);
}

.products-section__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--theme-text-primary);
  margin-bottom: var(--space-2);
}

.products-section__subtitle {
  font-size: var(--text-base);
  color: var(--theme-text-secondary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
}

/* ========================================
   PRODUCT CARD
   ======================================== */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  text-decoration: none;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.03) 0%, rgba(59, 130, 246, 0.03) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

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

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--theme-border-medium);
  box-shadow: var(--theme-shadow-lg);
}

/* Badge positioning */
.product-card__badges {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-end;
  z-index: 2;
}

/* Image */
.product-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-4);
  background: var(--theme-bg-tertiary);
}

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

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

/* Content */
.product-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__name {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--theme-text-primary);
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.product-card:hover .product-card__name {
  color: var(--theme-accent-primary);
}

.product-card__description {
  font-size: var(--text-sm);
  color: var(--theme-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  flex: 1;
}

/* Meta info */
.product-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--theme-border-subtle);
}

.product-card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--theme-text-tertiary);
}

.product-card__meta-item svg {
  width: 14px;
  height: 14px;
}

/* Footer */
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card__price {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
  color: var(--theme-accent-primary);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--transition-fast);
}

.product-card:hover .product-card__cta {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
}

.product-card__cta svg {
  width: 16px;
  height: 16px;
}

/* Card variants */
.product-card--featured {
  border-color: rgba(251, 191, 36, 0.3);
}

.product-card--featured::before {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.product-card--coming-soon {
  opacity: 0.7;
}

.product-card--coming-soon:hover {
  transform: none;
  cursor: not-allowed;
}

/* Hidden state for filtering */
.product-card--hidden {
  display: none;
}

/* Empty state */
.products-empty {
  text-align: center;
  padding: var(--space-20) 0;
}

.products-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  color: var(--theme-text-muted);
}

.products-empty__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--theme-text-primary);
  margin-bottom: var(--space-2);
}

.products-empty__description {
  font-size: var(--text-base);
  color: var(--theme-text-secondary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .store-header {
    padding: var(--space-16) 0 var(--space-8);
  }
  
  .store-header__title {
    font-size: 2.5rem;
  }
  
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    justify-content: center;
  }
  
  .search-box {
    min-width: auto;
    width: 100%;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .store-filters {
    position: relative;
    top: 0;
  }
}

@media (max-width: 480px) {
  .filter-btn {
    flex: 1;
    justify-content: center;
  }
  
  .product-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  
  .product-card__cta {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.product-card {
  animation: fadeIn 0.4s ease-out backwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .product-card {
    animation: none;
  }
}
