/* ========================
   Shop - Dark Amber Theme
   ======================== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --bg:          #0f0f11;
  --bg-card:     #18181c;

  --text:        #f0f0f0;
  --text-muted:  #888;

  --amber:       #e8a44a;
  --amber-light: #f5c06e;
  --amber-dim:   rgba(232, 164, 74, 0.12);

  --border:       rgba(255, 255, 255, 0.07);
  --border-amber: rgba(232, 164, 74, 0.25);

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;

  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-amber: 0 4px 20px rgba(232, 164, 74, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========================
   Page Layout
   ======================== */
.shop-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* ========================
   Page Header
   ======================== */
.shop-header {
  margin-bottom: 2.25rem;
}

.shop-header h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
}

.shop-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ========================
   Filters
   ======================== */
.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.shop-filters input,
.shop-filters select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.shop-filters input::placeholder {
  color: var(--text-muted);
}

.shop-filters input:focus,
.shop-filters select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 164, 74, 0.12);
}

.shop-filters select option {
  background: #18181c;
}

.shop-filters button {
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

#filterBtn {
  background: var(--amber);
  color: #0f0f11;
}

#filterBtn:hover {
  background: var(--amber-light);
}

#resetBtn {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

#resetBtn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ========================
   Results
   ======================== */
.shop-results {
  min-height: 300px;
}

/* ========================
   Product Grid & Cards
   ======================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.product {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product:hover {
  transform: translateY(-6px);
  border-color: var(--border-amber);
  box-shadow: var(--shadow-card);
}

.thumb-link {
  display: block;
}

.product .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #111;
}

.product .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product:hover .thumb img {
  transform: scale(1.05);
}

.product-body {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.product h3 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.product h3 a:hover {
  color: var(--amber);
}

.product .tags {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.product .description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.84rem;
  flex-grow: 1;
  margin-bottom: 0.75rem;
}

.product .price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.product .price.free-badge {
  color: #4ade80;
}

.product .btn-free {
  background: #16a34a;
  color: #fff;
  text-decoration: none;
  display: block;
  text-align: center;
}

.product .btn-free:hover {
  background: #15803d;
}

.product button,
.product .btn {
  background: var(--amber);
  color: #0f0f11;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
}

.product button:hover,
.product .btn:hover {
  background: var(--amber-light);
  transform: translateY(-1px);
}

/* ========================
   Empty / Error States
   ======================== */
.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 2rem;
  font-size: 0.9rem;
}

.error {
  text-align: center;
  color: #ef4444;
  padding: 2rem;
  font-size: 0.9rem;
}

/* ========================
   Pagination
   ======================== */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 2.5rem 0 0;
  flex-wrap: wrap;
}

.page-link {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-link:hover,
.page-link.active {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: var(--border-amber);
}

/* ========================
   Spinner & Toast
   ======================== */
.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(232, 164, 74, 0.12);
  border-top: 3px solid var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-amber);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

.toast::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 768px) {
  .shop-page {
    padding: 2rem 1.25rem 4rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }

  .shop-filters {
    gap: 0.5rem;
  }

  .shop-filters input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .shop-filters select,
  .shop-filters button {
    flex: 1;
  }
}
