/* ============================================================
   ELBAER LLC — Product Grid & Catalog · Medical Brand
   ============================================================ */

/* ─── Product Card ───────────────────────────────────────── */
.product-card {
  background: var(--color-white); border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-neutral-200); box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.product-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

/* Image */
.product-card-image {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: var(--color-neutral-100); flex-shrink: 0;
}
.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); }

.product-card-badges {
  position: absolute; top: var(--space-2); left: var(--space-2);
  display: flex; flex-direction: column; gap: var(--space-1);
}

.product-card-wishlist {
  position: absolute; top: var(--space-2); right: var(--space-2);
  width: 30px; height: 30px; background: rgba(255,255,255,0.92);
  border-radius: var(--radius-full); display: flex; align-items: center;
  justify-content: center; cursor: pointer; border: none;
  transition: all var(--transition-fast); backdrop-filter: blur(4px);
}
.product-card-wishlist:hover { background: white; box-shadow: var(--shadow-md); }
.product-card-wishlist svg { width: 14px; height: 14px; color: var(--color-neutral-400); transition: color var(--transition-fast); }
.product-card-wishlist.active svg, .product-card-wishlist:hover svg { color: var(--color-danger); fill: var(--color-danger); }

/* Body */
.product-card-body { padding: var(--space-4); display: flex; flex-direction: column; flex: 1; }

.product-card-sku {
  font-size: 10px; font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-400); letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: var(--space-1); font-family: monospace;
}
.product-card-category {
  font-size: var(--font-size-xs); color: var(--color-primary);
  font-weight: var(--font-weight-semibold); text-transform: uppercase;
  letter-spacing: 0.4px; margin-bottom: var(--space-1);
}
.product-card-name {
  font-size: var(--font-size-base); font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-900); margin-bottom: var(--space-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: var(--line-height-snug); text-decoration: none;
}
.product-card-name:hover { color: var(--color-primary); }

.product-card-certs {
  display: flex; gap: var(--space-1); flex-wrap: wrap; margin-bottom: var(--space-3);
}

.product-card-rating {
  display: flex; align-items: center; gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.product-card-rating .rating-count { font-size: var(--font-size-xs); color: var(--color-neutral-400); }

.product-card-price {
  display: flex; align-items: baseline; gap: var(--space-2);
  margin-bottom: var(--space-1); margin-top: auto;
}
.price-current { font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); color: var(--color-neutral-900); }
.price-current.on-sale { color: var(--color-danger); }
.price-original { font-size: var(--font-size-sm); color: var(--color-neutral-400); text-decoration: line-through; }

.product-card-bulk-hint {
  font-size: var(--font-size-xs); color: var(--color-teal-dark);
  font-weight: var(--font-weight-medium); margin-bottom: var(--space-3);
}
.product-card-bulk-hint svg { width: 12px; height: 12px; display: inline-block; vertical-align: middle; }

/* Footer */
.product-card-footer { padding: 0 var(--space-4) var(--space-4); }
.product-card-add-btn {
  width: 100%; background: var(--color-primary); color: white; border: none;
  border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold);
  cursor: pointer; transition: all var(--transition-base);
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
}
.product-card-add-btn:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-blue); }
.product-card-add-btn svg { width: 15px; height: 15px; }

/* ─── Product Grid ───────────────────────────────────────── */
.product-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ─── Products Page ──────────────────────────────────────── */
.products-page { padding: var(--space-8) 0 var(--space-16); }
.products-layout { display: grid; grid-template-columns: 280px 1fr; gap: var(--space-8); align-items: start; }

/* ─── Filters Sidebar ────────────────────────────────────── */
.filters-sidebar {
  background: white; border-radius: var(--radius-lg); padding: var(--space-6);
  border: 1.5px solid var(--color-neutral-200); box-shadow: var(--shadow-sm);
  position: sticky; top: calc(var(--header-height) + var(--topbar-height) + var(--space-4));
}
.filters-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.filters-header h3 { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); }
.filters-clear { font-size: var(--font-size-xs); color: var(--color-danger); font-weight: var(--font-weight-semibold); cursor: pointer; background: none; border: none; padding: 0; }

.filter-group { margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-neutral-100); }
.filter-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-group-title { font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); color: var(--color-neutral-600); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: var(--space-3); }

.filter-option {
  display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2);
  cursor: pointer; user-select: none;
}
.filter-option input[type="checkbox"], .filter-option input[type="radio"] {
  width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; flex-shrink: 0;
}
.filter-option label { font-size: var(--font-size-sm); color: var(--color-neutral-700); cursor: pointer; flex: 1; }
.filter-option .count { font-size: var(--font-size-xs); color: var(--color-neutral-400); }

/* Price range */
.price-inputs { display: flex; gap: var(--space-1); align-items: center; }
.price-input {
  flex: 1; min-width: 0; padding: var(--space-2) var(--space-1);
  border: 1.5px solid var(--color-neutral-200);
  border-radius: var(--radius-sm); font-size: var(--font-size-xs); text-align: center; outline: none;
  transition: border-color var(--transition-fast); width: 0;
}
.price-input:focus { border-color: var(--color-primary); }
.price-sep { color: var(--color-neutral-400); font-size: var(--font-size-sm); flex-shrink: 0; }

/* Color swatches */
.color-swatches { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.color-swatch {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  border: 2px solid var(--color-neutral-200); cursor: pointer;
  transition: all var(--transition-fast); position: relative;
}
.color-swatch:hover, .color-swatch.active { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-light); }
.color-swatch.active::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: white; font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.color-swatch[data-color="Blue"]  { background: #4A90D9; }
.color-swatch[data-color="White"] { background: #F8F9FA; border-color: var(--color-neutral-300); }
.color-swatch[data-color="Black"] { background: #1a1a1a; }
.color-swatch[data-color="Mixed"] { background: linear-gradient(135deg, #4A90D9 33%, #F472B6 33% 66%, #34D399 66%); }
.color-swatch[data-color="Clear"] { background: linear-gradient(135deg, #E0F7F5 50%, white 50%); border-color: var(--color-neutral-300); }

/* ─── Products Toolbar ───────────────────────────────────── */
.products-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap;
}
.products-search-wrap {
  position: relative; flex: 1; max-width: 360px;
}
.products-search-icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--color-neutral-400); pointer-events: none; }
.products-search-icon svg { width: 16px; height: 16px; }
.products-search-input {
  width: 100%; padding: var(--space-3) var(--space-3) var(--space-3) calc(var(--space-3) + 22px);
  border: 1.5px solid var(--color-neutral-200); border-radius: var(--radius-sm);
  font-size: var(--font-size-sm); outline: none; background: white;
  transition: border-color var(--transition-fast);
}
.products-search-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,95,158,0.1); }

.products-right { display: flex; align-items: center; gap: var(--space-4); }
.products-count { font-size: var(--font-size-sm); color: var(--color-neutral-600); white-space: nowrap; }
.products-count strong { color: var(--color-neutral-900); }

.sort-wrap { display: flex; align-items: center; gap: var(--space-2); }
.sort-wrap label { font-size: var(--font-size-sm); color: var(--color-neutral-600); white-space: nowrap; }
.sort-select {
  padding: var(--space-2) var(--space-3); border: 1.5px solid var(--color-neutral-200);
  border-radius: var(--radius-sm); font-size: var(--font-size-sm); background: white;
  outline: none; cursor: pointer;
}
.sort-select:focus { border-color: var(--color-primary); }

/* ─── Empty State ────────────────────────────────────────── */
.products-empty {
  text-align: center; padding: var(--space-20) var(--space-8);
  grid-column: 1 / -1;
}
.products-empty svg { width: 56px; height: 56px; color: var(--color-neutral-300); margin: 0 auto var(--space-4); }
.products-empty h3 { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); color: var(--color-neutral-700); margin-bottom: var(--space-2); }
.products-empty p { color: var(--color-neutral-500); }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-10); }
.pagination-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: var(--font-size-sm); font-weight: var(--font-weight-medium);
  background: white; border: 1.5px solid var(--color-neutral-200);
  color: var(--color-neutral-700); cursor: pointer; transition: all var(--transition-fast);
}
.pagination-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.pagination-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Mobile filter toggle ───────────────────────────────── */
.filter-toggle-btn {
  display: none; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); border: 1.5px solid var(--color-neutral-200);
  border-radius: var(--radius-sm); background: white; font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium); cursor: pointer; color: var(--color-neutral-700);
}
.filter-toggle-btn svg { width: 16px; height: 16px; }
.filter-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; }
.filter-overlay.open { display: block; }

@media (max-width: 1023px) {
  .products-layout { grid-template-columns: 1fr; }
  .filters-sidebar {
    display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 300px;
    border-radius: 0; z-index: 300; overflow-y: auto;
  }
  .filters-sidebar.open { display: block; }
  .filter-toggle-btn { display: flex; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 479px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .product-card-body { padding: var(--space-3); }
  .product-card-footer { padding: 0 var(--space-3) var(--space-3); }
}

/* ─── Medical/Clinical Enhancements ──────────────────────── */

/* Top accent line — appears on hover (clinical blue) */
.product-card::before {
  content: ''; display: block;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-teal));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.product-card:hover::before { transform: scaleX(1); }

/* SKU tag — pill style */
.product-card-sku {
  display: inline-block;
  background: var(--color-neutral-100); border-radius: 3px;
  padding: 1px 6px; width: fit-content;
}

/* Category chip — stronger primary color */
.product-card-category {
  font-size: 10px; letter-spacing: 0.6px;
}

/* Bulk hint — teal left-border bar */
.product-card-bulk-hint {
  border-left: 2px solid var(--color-teal);
  padding-left: var(--space-2);
  background: var(--color-teal-light);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 3px var(--space-2) 3px var(--space-2);
}

/* Add-to-cart button — stronger clinical feel */
.product-card-add-btn {
  letter-spacing: 0.3px; font-size: 12px;
  padding: var(--space-3) var(--space-3);
}

/* Filters sidebar — clinical dividers */
.filter-group-title {
  display: flex; align-items: center; gap: var(--space-2);
}
.filter-group-title::before {
  content: ''; display: block;
  width: 3px; height: 12px;
  background: var(--color-primary);
  border-radius: 2px; flex-shrink: 0;
}

/* Active filter options highlighted */
.filter-option input:checked + label {
  color: var(--color-primary); font-weight: var(--font-weight-semibold);
}
