/**
 * CityGaerGame Shop Stylesheet
 * Product listing, filters, and shopping experience
 */

/* ============================================
   SHOP PAGE SECTIONS
   ============================================ */

/* Hero Alternative - Shop Header */
.hero-alt {
  background: linear-gradient(135deg, var(--color-dark-wood) 0%, var(--color-rich-brown) 100%);
  color: var(--color-parchment);
  padding: var(--space-16) var(--space-4);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-alt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(212, 168, 83, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(232, 199, 118, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-alt .hero-inner {
  position: relative;
  z-index: 1;
}

.hero-alt h1 {
  color: var(--color-parchment);
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-sub {
  font-size: var(--font-size-lg);
  color: var(--color-light-gold);
  max-width: 60ch;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .hero-alt h1 {
    font-size: var(--font-size-4xl);
  }
  
  .hero-sub {
    font-size: var(--font-size-base);
  }
}

/* ============================================
   SHOP CONTROLS (FILTERS & SORT)
   ============================================ */

.shop-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  align-items: flex-end;
}

@media (max-width: 768px) {
  .shop-controls {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* Filters Form */
.filters-form {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  border: none;
  padding: 0;
  margin: 0;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 200px;
}

@media (max-width: 768px) {
  .filter-item {
    min-width: 100%;
  }
}

.filter-label {
  font-family: var(--font-family-ui);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select {
  display: block;
  width: 100%;
  font-family: var(--font-family-ui);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
  background-clip: padding-box;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  padding-right: var(--space-8);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--shadow-inner);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a4230' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 12px;
}

.select:hover {
  border-color: var(--color-border-dark);
}

.select:focus {
  outline: 0;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-inner), 0 0 0 3px var(--color-primary-pale);
}

/* Range Slider */
.range-slider {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-base);
  transition: all var(--transition-base);
}

.range-slider::-webkit-slider-thumb:hover {
  background: var(--color-accent-dark);
  transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-base);
  transition: all var(--transition-base);
}

.range-slider::-moz-range-thumb:hover {
  background: var(--color-accent-dark);
  transform: scale(1.1);
}

.price-output {
  display: block;
  font-family: var(--font-family-ui);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* Shop Sort */
.shop-sort {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}

.sort-label {
  font-family: var(--font-family-ui);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

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

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

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

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

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

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-base);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

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

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 1;
}

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

/* Product Image */
.product-image-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background: var(--color-gray-100);
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

/* Product Badges */
.badge-featured,
.badge-new,
.badge-sale {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  font-family: var(--font-family-ui);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-featured {
  background: var(--color-primary);
  color: var(--color-surface);
}

.badge-new {
  background: var(--color-success);
  color: var(--color-surface);
}

.badge-sale {
  background: var(--color-danger);
  color: var(--color-surface);
}

/* Product Info */
.product-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  flex-grow: 1;
}

.product-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-dark-wood);
  margin: 0;
  line-height: var(--line-height-snug);
}

.product-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

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

.product-meta {
  font-family: var(--font-family-ui);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* Product Rating */
.product-rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.stars {
  font-size: var(--font-size-base);
  color: var(--color-accent);
  letter-spacing: 2px;
}

.rating-count {
  font-family: var(--font-family-ui);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Product Description */
.product-description {
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin: 0;
  line-height: var(--line-height-normal);
  flex-grow: 1;
}

/* Product Price */
.product-price {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
}

.price {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
}

.price-original {
  font-family: var(--font-family-ui);
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

/* Product Actions */
.product-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.product-actions .btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

.product-actions .btn-outline {
  flex: 0 0 auto;
  width: auto;
  padding: var(--space-2) var(--space-3);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  justify-content: center;
  margin-top: var(--space-12);
  margin-bottom: var(--space-8);
}

.pagination-list {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-family-ui);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  background: var(--color-surface);
  transition: all var(--transition-base);
  cursor: pointer;
}

.pagination-link:hover {
  background: var(--color-gray-100);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.pagination-link.active {
  background: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
  cursor: default;
}

.pagination-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .products-grid {
    gap: var(--space-4);
  }
  
  .product-card {
    border-radius: var(--radius-md);
  }
  
  .product-info {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  
  .product-title {
    font-size: var(--font-size-base);
  }
  
  .product-actions .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .hero-alt {
    background: linear-gradient(135deg, #1a1510 0%, #2c2416 100%);
  }
  
  .product-card {
    background: var(--color-surface);
    border-color: var(--color-border);
  }
  
  .filter-item {
    color: var(--color-text);
  }
  
  .select {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
  }
}

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

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

.product-card {
  animation: slideIn var(--transition-slow) ease-out;
}