/* Shop Page Styles */

/* Ensure smooth scrolling and proper overflow */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  overflow-x: hidden;
}

.shop-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 24px;
}

.shop-header {
  text-align: left;
  margin-bottom: 24px;
  padding: 4px 0 12px;
  border-bottom: none;
}

.shop-header h1 {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 10px;
}

.shop-header p {
  font-size: 1.1rem;
  color: #666;
}

.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.search-box,
.category-filter {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.category-filter {
  min-width: 150px;
  cursor: pointer;
}

.search-box:focus,
.category-filter:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.product-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transform: translateY(-5px);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #f5f5f5;
}

.product-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #999;
}

.product-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  min-height: 2.2em;
}

.product-category {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 5px;
}

.product-description {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 10px;
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  font-size: 1.3rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 10px;
}

.product-stock {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.stock-available {
  color: #28a745;
}

.stock-low {
  color: #ffc107;
}

.stock-out {
  color: #dc3545;
}

.product-actions {
  display: flex;
  gap: 10px;
}

.btn-add-cart,
.btn-view {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-add-cart {
  background-color: #007bff;
  color: white;
}

.btn-add-cart:hover:not(:disabled) {
  background-color: #0056b3;
}

.btn-add-cart:disabled {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-view {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-view:hover {
  background-color: #e9e9e9;
}

.loading,
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: #999;
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .shop-header h1 {
    font-size: 1.8rem;
  }

  .filters {
    flex-direction: column;
  }

  .search-box,
  .category-filter {
    width: 100%;
  }
}

:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --accent: #f093fb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Breadcrumbs */
.breadcrumb {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--primary);
  font-weight: 500;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
}

.breadcrumb i {
  font-size: 0.7rem;
}

/* Main Layout */
main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px 24px 24px;
  overflow-x: clip;
}

.shop-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
  align-items: stretch;
  min-width: 0;
}

.shop-sidebar-backdrop,
.shop-mobile-filter-bar,
.sidebar-close-btn {
  display: none;
}

/* Sidebar Filters */
.sidebar {
  background: linear-gradient(160deg, #ffffff 0%, #f4f9ff 100%);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(14, 76, 146, 0.14);
  border: 1px solid #d9e8f7;
  height: fit-content;
  position: sticky;
  top: 12px;
  transform: none;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #b388f9 0%, #1abc9c 100%);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #9c6fe8 0%, #15a085 100%);
}

.sidebar h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #1d4ed8 0%, #0f766e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.filter-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #dbe7f3;
}

.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.filter-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-list-box {
  background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
  border: 1.5px solid #d3e3f4;
  border-radius: 12px;
  padding: 8px;
}

.filter-list-scroll {
  max-height: 220px;
  overflow-y: auto;
}

.filter-list-scroll::-webkit-scrollbar {
  width: 6px;
}

.filter-list-scroll::-webkit-scrollbar-thumb {
  background: #b9cee4;
  border-radius: 999px;
}

.filter-select-list {
  width: 100%;
  padding: 11px 12px;
  background: #ffffff;
  color: #1f2937;
  border: 1.5px solid #cbdcf0;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: auto;
  cursor: pointer;
}

.filter-select-list option {
  color: #1f2937;
}

.filter-select-list:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.filter-input-box {
  padding: 10px;
}

#searchInput,
#minPrice,
#maxPrice {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid #cbdcf0;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #1f2937;
}

/* Filter Section Input Fields */
.filter-section input[type="text"],
.filter-section input[type="number"] {
  transition: all 0.3s ease;
}

.filter-section input[type="text"]:focus,
.filter-section input[type="number"]:focus {
  outline: none;
  border-color: #1d4ed8 !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14) !important;
  background: #ffffff !important;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.filter-list-box .filter-option + .filter-option {
  margin-top: 4px;
}

.filter-option:hover {
  background: #eef6ff;
  border-color: #c9def3;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.filter-option label {
  cursor: pointer;
  flex: 1;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
}

.filter-option .count {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.price-inputs {
  display: flex;
  gap: 8px;
  margin-top: 0;
  align-items: center;
  background: #edf4fb;
  border-radius: 8px;
  padding: 6px 8px;
  border: 1.5px solid #d1e2f4;
  max-width: 100%;
  box-sizing: border-box;
}

.price-inputs input {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 8px;
  border: 1.5px solid #c6d9ef;
  border-radius: 8px;
  font-size: 0.98rem;
  background: #ffffff;
  color: #1f2937;
  transition: border 0.2s;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .sidebar {
    max-width: 100%;
  }

  .price-inputs {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    max-width: 100%;
  }

  .price-inputs {
    max-width: 100%;
  }
}

.price-inputs input:focus {
  outline: none;
  border-color: var(--secondary);
  background: var(--bg);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: stretch;
}

.filter-btn {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.filter-btn.apply {
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: white;
  border: 1.5px solid #1d4ed8;
}

.filter-btn.apply:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, #0f766e, #2563eb);
}

.filter-btn.reset {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #c9d9ea;
}

.filter-btn.reset:hover {
  background: #edf4fb;
  color: #1d4ed8;
  border-color: #1d4ed8;
}

/* Main Content */
.shop-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  position: relative;
  overflow-x: clip;
}

.shop-header {
  margin-bottom: 24px;
}

.shop-header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  font-weight: 900;
  background: linear-gradient(135deg, #1d4ed8 0%, #0f766e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: static;
  top: auto;
  background-color: transparent;
  padding: 0;
  z-index: auto;
  margin: 0;
}

.shop-subtitle {
  color: #5b6b80;
  font-size: 1rem;
}

/* Toolbar */
.toolbar {
  background: linear-gradient(160deg, #ffffff 0%, #f0f7ff 100%);
  border-radius: 0 0 12px 12px;
  padding: 18px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 10px 28px rgba(11, 60, 120, 0.12);
  border: 1px solid #d8e7f6;
  border-top: 2px solid #2563eb;
  position: sticky;
  top: 12px;
  z-index: 1000;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.results-count {
  color: #4b5f76;
  font-weight: 600;
  font-size: 1rem;
}

.results-count strong {
  color: #1d4ed8;
  font-weight: 700;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: #e9f2fb;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #c9ddef;
}

.view-toggle button {
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: #36516b;
  transition: all 0.3s ease;
  font-weight: 600;
}

.view-toggle button:hover {
  background: #dcecff;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.view-toggle button.active {
  background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
  transform: translateY(0);
}

.sort-select {
  padding: 11px 16px;
  border: 1px solid #c6d9ed;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.sort-select:hover {
  border-color: #2563eb;
  background: #ffffff;
}

.sort-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Primary Button (for bundles toggle, etc) */
.btn-primary {
  padding: 11px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.36);
  background: linear-gradient(135deg, #1d4ed8 0%, #0b5f56 100%);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.24);
}

/* Active Filters */
.active-filters {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.filter-badge i {
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.filter-badge i:hover {
  opacity: 1;
}

.clear-all {
  background: var(--danger);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-all:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Products Grid */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
  position: relative;
  min-width: 0;
}

#productsGrid {
  width: 100%;
  min-height: 400px;
  position: relative;
  min-width: 0;
}

/* Prevent horizontal scroll from cards */
.products,
#productsGrid {
  overflow: visible;
}

.products.list-view {
  grid-template-columns: 1fr;
}

.products.list-view .card {
  flex-direction: row;
  max-width: 100%;
}

.products.list-view .card img {
  width: 200px;
  height: 200px;
}

.products.list-view .card-body {
  flex: 1;
  padding: 20px;
}

.products.compact-view {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.products.compact-view .product-card {
  max-width: 100% !important;
  margin: 0 0 18px 0 !important;
}

.products.compact-view .product-card img {
  height: 140px !important;
}

.products.wide-view {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.products.wide-view .product-card {
  max-width: 100% !important;
  margin: 0 0 26px 0 !important;
}

.products > *,
#productsGrid > * {
  min-width: 0;
  max-width: 100%;
}

/* Product Cards */
.card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.card-image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.3s;
}

.card:hover img {
  transform: scale(1.1);
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s;
}

.card:hover .card-actions {
  opacity: 1;
  transform: translateX(0);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  color: var(--text-secondary);
}

.icon-btn:hover {
  transform: scale(1.1);
  background: white;
  color: var(--primary);
}

.icon-btn i {
  font-size: 16px;
}

.icon-btn.active {
  background: var(--danger);
  color: white;
}

.icon-btn.active:hover {
  background: #dc2626;
}

.badge-group {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.new {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.badge.sale {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.badge.trending {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.stock-badge {
  background: rgba(16, 185, 129, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.stock-badge.low {
  background: rgba(245, 158, 11, 0.95);
}

.stock-badge.out {
  background: rgba(239, 68, 68, 0.95);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  width: fit-content;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.stars {
  color: #fbbf24;
}

.rating-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.price-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.4rem;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 1rem;
}

.discount {
  background: var(--danger);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.quantity-control button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
  font-size: 1.1rem;
  color: var(--text);
}

.quantity-control button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

.quantity-control input {
  width: 70px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.card-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.card-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.card-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.card-btn.secondary {
  background: var(--bg);
  color: var(--text-secondary);
}

.card-btn.secondary:hover {
  background: var(--bg-secondary);
}

.card-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Loading & Empty States */
.loading {
  text-align: center;
  padding: 80px 20px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty i {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text);
}

.empty p {
  color: var(--text-secondary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  margin-bottom: 40px;
  padding: 20px 0;
  flex-wrap: wrap;
  width: 100%;
}

.pagination button {
  padding: 10px 16px;
  border: 1px solid rgba(179, 136, 249, 0.3);
  background: rgba(35, 36, 42, 0.8);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: #e2e8f0;
  transition: all 0.3s ease;
  min-width: 44px;
}

.pagination button:hover:not(:disabled) {
  background: linear-gradient(135deg, #b388f9 0%, #1abc9c 100%);
  color: white;
  border-color: #b388f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(179, 136, 249, 0.3);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.active {
  background: linear-gradient(135deg, #b388f9 0%, #1abc9c 100%);
  color: white;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(179, 136, 249, 0.3);
}

.pagination span {
  color: #bdbdbd;
  padding: 0 8px;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5f5;
  padding: 40px 24px;
  margin-top: 60px;
}

footer .footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
}

footer h3 {
  margin-bottom: 16px;
  color: #fff;
  font-size: 1.2rem;
}

footer a {
  color: #cbd5f5;
  transition: all 0.2s;
  display: inline-block;
}

footer a:hover {
  color: #fff;
  transform: translateX(4px);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  color: #fff;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.social-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

/* Dark Mode */
body.dark-mode {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
}

body.dark-mode header:not(.site-header) {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

body:not(.dark-mode) header:not(.site-header) {
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body:not(.dark-mode) header:not(.site-header) a,
body:not(.dark-mode) header:not(.site-header) button,
body:not(.dark-mode) header:not(.site-header) span,
body:not(.dark-mode) header:not(.site-header) i {
  color: #1f2937;
}

body.dark-mode .price-inputs input,
body.dark-mode .sort-select {
  background: #0f172a;
  color: #f1f5f9;
}

body.dark-mode .card-image {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Responsive */
@media (max-width: 1024px) {
  .shop-container {
    grid-template-columns: 240px 1fr;
    gap: 20px;
  }

  .sidebar {
    padding: 20px;
    top: 16px;
    transform: none;
    max-height: none;
  }
  
  .toolbar {
    padding: 14px 18px;
  }
}

@media (max-width: 1024px) {
  .shop-container {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .sidebar {
    position: fixed;
    top: 50%;
    left: 0;
    bottom: auto;
    width: min(86vw, 320px);
    max-width: 320px;
    height: auto;
    max-height: none;
    margin-bottom: 0;
    padding: 18px 16px 22px;
    overflow: visible;
    transform: translate(-108%, -50%);
    transition: transform 0.28s ease;
    z-index: 1400;
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.22);
    border-radius: 0 16px 16px 0;
  }

  body.items-aside-open .sidebar {
    transform: translate(0, -50%);
  }

  body.items-aside-open {
    overflow: hidden;
  }

  .shop-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(15, 23, 42, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.items-aside-open .shop-sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .shop-mobile-filter-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: -10px 0 14px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .shop-mobile-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .shop-mobile-filter-btn,
  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .shop-mobile-filter-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(11, 60, 120, 0.2);
    margin-left: 0;
  }

  .sidebar-close-btn {
    width: 100%;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #edf4fb;
    color: #1d4ed8;
    border: 1px solid #c9d9ea;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }

  .card img {
    height: 220px;
  }

  .professional-footer .footer-wrapper,
  .professional-footer .footer-column,
  .professional-footer .footer-column * {
    text-align: center !important;
  }

  .professional-footer .footer-columns,
  .professional-footer .links-column ul,
  .professional-footer .contact-column > div,
  .professional-footer .social-buttons {
    justify-content: center !important;
    align-items: center !important;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: 0;
    padding: 12px 16px;
    width: 100%;
    min-width: 0;
  }

  .toolbar-controls {
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .shop-header h1 {
    font-size: 2rem;
    padding: 12px 0;
  }

  .bundles-grid,
  .products.wide-view,
  .products.compact-view,
  .products.list-view,
  #productsGrid {
    grid-template-columns: 1fr !important;
  }

  .products .product-card,
  #productsGrid .product-card,
  #productsGrid .list-card,
  #productsGrid .sheng-card {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 768px) {
  .professional-footer .footer-columns {
    grid-template-columns: 1fr !important;
  }
}

/* Bundle Box Style */
.bundles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.bundle-box {
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.10);
  padding: 20px 18px 18px 18px;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bundle-box:hover {
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.18);
  border-color: var(--secondary);
}

.bundle-box .bundle-products {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bundle-box .bundle-products img {
  max-width: 140px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
}

.bundle-box .bundle-products .bundle-prod-img-wrap {
  position: relative;
  min-width: 120px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bundle-box .bundle-products input[type="checkbox"] {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

@media (max-width: 700px) {
  .bundles-grid {
    grid-template-columns: 1fr;
  }
}