/* ============================================================
   ZD PACK — MODULE 3: SHOP / CATALOG & SKU SEARCH STYLES
   ============================================================ */

/* Main shop container */
.zd-shop-container {
  width: 100%;
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px 20px 60px;
}
@media (min-width: 640px) {
  .zd-shop-container { padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1280px) {
  .zd-shop-container { padding-left: 48px; padding-right: 48px; }
}

/* Compact Catalog Header */
.zd-shop-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 24px;
}
.zd-shop-header-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 768px) {
  .zd-shop-header-top {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}
.zd-shop-h1 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--brand-black);
  margin: 0;
}
.zd-shop-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Contextual Search Bar */
.zd-shop-search-bar {
  margin-top: 16px;
  background-color: var(--surface-soft);
  border: 1px solid var(--border-subtle);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 768px) {
  .zd-shop-search-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.zd-search-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  white-space: nowrap;
}
.zd-search-form {
  display: flex;
  flex: 1;
  gap: 8px;
  max-width: 640px;
}
.zd-search-input-wrap {
  position: relative;
  flex: 1;
}
.zd-search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.zd-search-input-wrap input {
  height: 42px;
  padding-left: 36px !important;
  padding-right: 12px !important;
  width: 100%;
}

/* Quick Category Navigation Pills */
.zd-quick-cats {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 8px;
  scrollbar-width: none;
}
.zd-quick-cats::-webkit-scrollbar { display: none; }
.zd-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--brand-white);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 150ms ease;
}
.zd-cat-pill:hover,
.zd-cat-pill.is-active {
  border-color: var(--brand-black);
  color: var(--brand-black);
  background-color: var(--surface-soft);
}

/* Shop Layout: Sidebar + Main Grid */
.zd-shop-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 16px;
}
@media (min-width: 1024px) {
  .zd-shop-layout {
    grid-template-columns: 220px 1fr;
    gap: 36px;
  }
}

/* Desktop Sidebar / Mobile Filter Controls */
.zd-filter-sidebar {
  display: none;
}
@media (min-width: 1024px) {
  .zd-filter-sidebar {
    display: block;
  }
}
.zd-filter-group {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.zd-filter-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-black);
  margin: 0 0 12px;
}
.zd-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zd-filter-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 150ms ease;
}
.zd-filter-link:hover,
.zd-filter-link.is-active {
  color: var(--brand-black);
  font-weight: 600;
}
.zd-filter-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* Mobile Filter Bar & Drawer */
.zd-mobile-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 1024px) {
  .zd-mobile-filter-bar { display: none; }
}
.zd-mobile-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  background-color: var(--brand-white);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-black);
  cursor: pointer;
}
.zd-sort-select {
  height: 40px;
  padding: 0 12px !important;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
  background-color: var(--brand-white);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

/* Mobile Filter Drawer Overlay */
.zd-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.zd-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.zd-mobile-drawer {
  position: fixed;
  top: 0; bottom: 0; right: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--brand-white);
  z-index: 99999;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 250ms ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.zd-mobile-drawer.is-open {
  transform: translateX(0);
}
.zd-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.zd-drawer-title { font-size: 14px; font-weight: 800; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.zd-drawer-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); padding: 4px; }

/* Active Filter Chips Bar */
.zd-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.zd-active-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.zd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--surface-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-black);
  text-decoration: none;
}
.zd-chip-remove { color: var(--text-muted); font-size: 14px; line-height: 1; margin-left: 2px; }
.zd-clear-all { font-size: 11px; font-weight: 600; color: var(--status-danger); text-decoration: underline; margin-left: 8px; }

/* Top Sorting Toolbar for Desktop */
.zd-desktop-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
@media (min-width: 1024px) {
  .zd-desktop-toolbar { display: flex; }
}

/* Product Grid Layout */
.zd-shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) {
  .zd-shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .zd-shop-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 1280px) {
  .zd-shop-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

/* Product Card — B2B Density */
.zd-shop-card {
  background-color: var(--brand-white);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.zd-shop-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.zd-shop-card-thumb {
  aspect-ratio: 1;
  background-color: var(--surface-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.zd-shop-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 250ms ease;
}
.zd-shop-card:hover .zd-shop-card-thumb img {
  transform: scale(1.04);
}
.zd-shop-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zd-shop-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.zd-card-sku {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.zd-stock-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
}
.zd-stock-badge.instock { background: #eef7f0; color: var(--status-success); }
.zd-stock-badge.outofstock { background: #fdf2f2; color: var(--status-danger); }
.zd-stock-badge.onbackorder { background: #fef8ec; color: var(--status-warning); }

.zd-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brand-black);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.zd-card-title a {
  color: inherit;
  text-decoration: none;
}
.zd-card-title a:hover {
  color: var(--brand-gold-hover);
}

.zd-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.zd-card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.zd-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-black);
}

/* Quick Add Form / Actions */
.zd-card-action {
  width: 100%;
}
.zd-card-action .button,
.zd-card-action .zd-btn-action {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms ease;
  padding: 0 12px;
  border: none;
}
.zd-card-action .add_to_cart_button {
  background-color: var(--brand-black);
  color: var(--brand-white);
}
.zd-card-action .add_to_cart_button:hover {
  background-color: #333333;
}
.zd-card-action .add_to_cart_button.added::after {
  content: ' ✓';
}
.zd-card-action .zd-btn-variable {
  background-color: var(--surface-soft);
  color: var(--brand-black);
  border: 1px solid var(--border-subtle);
}
.zd-card-action .zd-btn-variable:hover {
  border-color: var(--brand-black);
}
.zd-card-action .zd-btn-disabled {
  background-color: #eee;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Native Pagination Override */
.zd-pagination-wrap {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}
.zd-pagination-wrap .page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.zd-pagination-wrap .page-numbers li a,
.zd-pagination-wrap .page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  background-color: var(--brand-white);
}
.zd-pagination-wrap .page-numbers li span.current {
  background-color: var(--brand-black);
  color: var(--brand-white);
  border-color: var(--brand-black);
}
.zd-pagination-wrap .page-numbers li a:hover {
  border-color: var(--brand-black);
  color: var(--brand-black);
}

/* Empty Catalog State */
.zd-shop-empty {
  padding: 64px 20px;
  text-align: center;
  background-color: var(--surface-soft);
  border: 1px solid var(--border-subtle);
}
.zd-shop-empty h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}
.zd-shop-empty p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
