#product-grid {
  padding: 1rem 0;
}

.product-grid-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ─── Product Card ───────────────────────────────────────── */
.product-item {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
}

.product-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-premium);
  border-color: rgba(139, 92, 246, 0.3);
}

.product-header {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(217, 70, 239, 0.05) 100%);
  padding: 12px 15px;
  font-weight: 600;
  font-size: 0.95em;
  text-align: center;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

.product-image-wrap {
  position: relative;
  background: #f8f8f8;
  text-align: center;
}

.product-image {
  height: 180px;
  width: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active {
  background: var(--success);
}

.badge-inactive {
  background: var(--text-muted);
}

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

.favorite {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.3rem;
  color: #ccc;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.favorite:hover {
  color: var(--accent-secondary);
}

.product-info {
  padding: 12px 15px;
  flex: 1;
}

.product-discount {
  color: var(--success);
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.product-price {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.current-price {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-primary);
}

.old-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.9em;
}

.price-per-unit {
  font-size: 0.75em;
  color: var(--text-muted);
}

.product-description {
  margin: 8px 0 0;
  font-size: 0.85em;
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 500;
}

/* ─── Product Actions ────────────────────────────────────── */
.inline-group {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  padding: 0 12px 12px;
  gap: 6px;
}

.addcart {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 0;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-quantity {
  width: 52px;
  padding: 4px 6px;
  font-size: 0.85rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  box-sizing: border-box;
}

.product-quantity[type="number"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.product-quantity::-webkit-outer-spin-button,
.product-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-primary);
  font-size: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 600;
}

.qty-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.btnAddAction {
  flex: 1;
  padding: 0 0.75rem;
  background: var(--accent-gradient);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
  font-size: 0.8rem;
  text-align: center;
  height: 32px;
  letter-spacing: 0.03em;
}

.btnAddAction:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.btnAddAction:focus,
.savelist:focus,
.showdetail:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btnAddAction:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.savelist,
.showdetail {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.8rem;
  text-align: center;
}

.savelist:hover,
.showdetail:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--accent-primary);
}

/* ─── Spinner / Loading ──────────────────────────────────── */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.spinner img {
  width: 20px;
  height: 20px;
}

/* Global overlay spinner */
.global-spinner {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

/* ─── Color / Size swatches ──────────────────────────────── */
.colors {
  display: flex;
  gap: 6px;
  padding: 6px 12px 2px;
}

.color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color:hover {
  transform: scale(1.25);
}

.color.red   { background: #e74c3c; }
.color.blue  { background: #3498db; }
.color.gray  { background: #95a5a6; }
.color.green { background: #27ae60; }
.color.black { background: #2c3e50; }

.sizes {
  display: flex;
  gap: 4px;
  padding: 2px 12px 8px;
}

.size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.size:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* ─── Stats Cards ────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(139, 92, 246, 0.07);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: var(--shadow-premium);
}

.stat-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card p {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  line-height: 1;
}

/* ─── Inventory Table ────────────────────────────────────── */
.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  max-height: 600px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

th,
td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  color: var(--text-primary);
  font-size: 0.88rem;
  background: var(--bg-surface);
}

tr:hover td {
  background: rgba(139, 92, 246, 0.03);
}

.fixed-table {
  border-collapse: collapse;
  min-width: 900px;
  width: 100%;
}

.fixed-table th:first-child,
.fixed-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-secondary);
}

.status.in-stock  { color: var(--success); font-weight: 600; }
.status.low-stock { color: var(--warning); font-weight: 600; }
.status.out-of-stock { color: var(--danger); font-weight: 600; }

/* Table action buttons */
.tblacbtn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tblacbtn:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.3);
}

.tblacicon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.remove-btn {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.remove-btn:hover {
  background: var(--danger);
  color: white;
}

/* ─── Alert Box ──────────────────────────────────────────── */
.alert-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}

.alert-box ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.alert-box li {
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-box li::before {
  content: '⚠';
  color: var(--warning);
}

/* ─── Cart ───────────────────────────────────────────────── */
#shopping-cart table {
  width: 100%;
  background: var(--bg-surface);
}

#shopping-cart table td {
  background: var(--bg-surface);
  vertical-align: middle;
}

.cart-item-image {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 92, 246, 0.15);
  vertical-align: middle;
  margin-right: 10px;
}

#btnEmpty {
  background: transparent;
  border: 1px solid var(--danger);
  padding: 7px 18px;
  color: var(--danger);
  margin: 10px 0 10px auto;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  display: block;
  width: fit-content;
}

#btnEmpty:hover {
  background: var(--danger);
  color: white;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 100%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 92, 246, 0.08);
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
}

.sidebar h3 {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 0.65rem;
}

.sidebar button,
.sidebar a {
  width: 100%;
  margin-bottom: 2px;
  padding: 0.65rem 0.9rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar button:hover,
.sidebar a:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--accent-primary);
  transform: translateX(3px);
}

/* ─── Filter Bar ─────────────────────────────────────────── */
#filterForm {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--bg-surface);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 92, 246, 0.08);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.market-select,
#filterForm select {
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
  font-family: inherit;
  cursor: pointer;
}

.market-input,
#filterForm input[type="text"] {
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
  font-family: inherit;
}

.market-select:focus,
#filterForm select:focus,
.market-input:focus,
#filterForm input[type="text"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#clearButton {
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
}

#clearButton:hover {
  background: var(--danger);
  border-color: var(--danger);
}

#clearButton img {
  width: 16px;
  height: 16px;
}

.filicon {
  width: 16px;
  height: 16px;
}

/* ─── POS / Sales Dashboard ──────────────────────────────── */
.pos-wrapper {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.product-list {
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(139, 92, 246, 0.08);
  max-width: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.product-list h2 {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.pos-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
  background: var(--bg-primary);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pos-product-card:hover {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.pos-product-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.pos-center {
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(139, 92, 246, 0.08);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.receipt {
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(139, 92, 246, 0.08);
  max-width: 28%;
}

.receipt table {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
}

.receipt table th,
.receipt table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px 4px;
  text-align: left;
  font-size: 0.82rem;
}

.pay-keypad-wrapper {
  display: flex;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
  align-items: flex-start;
}

.keypad-wrapper,
.pay-controls {
  flex: 1;
}

/* Numpad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 0.5rem;
}

.keypad button {
  width: 100%;
  aspect-ratio: 1;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.keypad button:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--accent-primary);
}

.keypad button:last-child {
  grid-column: span 2;
}

/* Scanner input */
#scanner {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition-fast);
  outline: none;
}

#scanner:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ─── Product Detail View ────────────────────────────────── */
.detail-card {
  display: flex;
  gap: 2rem;
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: var(--shadow-md);
  background: var(--bg-surface);
}

.detail-image-panel {
  flex: 0 0 380px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.detail-image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-info-panel {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.detail-code {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--bg-secondary);
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-current-price {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.detail-discount-badge {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.detail-specs {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.detail-specs li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.4rem;
}

.detail-specs li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.detail-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 0.75rem;
}

.buy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent-gradient);
  color: white;
  padding: 0.75rem 2rem;
  margin-top: 0.5rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-base);
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

.buy-button:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
  transform: translateY(-2px);
}

/* ─── Form Styles ────────────────────────────────────────── */
.market-label,
.uflab {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.upload-container {
  border: 2px dashed rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: var(--transition-fast);
}

.upload-container:hover {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.03);
}

.upload-box {
  cursor: pointer;
}

.preview img {
  max-width: 160px;
  max-height: 160px;
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(139, 92, 246, 0.2);
  object-fit: cover;
  display: block;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .product-grid-wrap {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }

  .pos-wrapper {
    flex-direction: column;
  }

  .product-list,
  .pos-center,
  .receipt {
    max-width: 100%;
  }

  .detail-card {
    flex-direction: column;
  }

  .detail-image-panel {
    flex: none;
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .product-grid-wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  #filterForm {
    flex-direction: column;
    align-items: stretch;
  }

  #filterForm select,
  #filterForm input[type="text"] {
    width: 100%;
  }

  .detail-specs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .product-grid-wrap {
    grid-template-columns: 1fr;
  }
}