/**
 * PBC Shop — Table view, compact grid, filter sidebar, toolbar, quick-add modal.
 *
 * BEM naming: pbc-shop__*, pbc-shop-table__*, pbc-product-card__*, pbc-filter__*
 * All values reference tokens.css custom properties.
 *
 * @package PBC_Core
 * @since 1.1.0
 */

/* ==========================================================================
   Shop Layout — Sidebar + Main Content
   ========================================================================== */

.pbc-shop-page .woocommerce-products-header {
  margin-bottom: 24px;
}

.pbc-shop-page .woocommerce-products-header__title {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-h2, 28px);
  font-weight: 700;
  line-height: var(--pbc-lh-h2, 36px);
  color: var(--pbc-near-black, #0E1720);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

/* Flex layout: filter sidebar + main content */
.pbc-shop-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  width: 100%;
  max-width: var(--pbc-wide-width, 1200px);
  margin: 0 auto;
}

/* Main content area fills remaining space */
.pbc-shop__main-content {
  flex: 1;
  min-width: 0;
}

/* Hide the default WooCommerce ordering — we use our toolbar instead */
.pbc-shop-page .woocommerce-ordering {
  display: none;
}

/* Override default WooCommerce products list */
.pbc-shop-page ul.products {
  display: contents;
}

/* Hide the default WooCommerce result count — toolbar shows count */
.pbc-shop-page .woocommerce-result-count {
  display: none;
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */

.pbc-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  line-height: 20px;
  margin-bottom: 16px;
}

.pbc-breadcrumb__link {
  color: var(--pbc-accessible-teal, #078A94);
  text-decoration: none;
  transition: color 0.15s ease;
}

.pbc-breadcrumb__link:hover {
  color: var(--pbc-deep-navy, #0B1F33);
  text-decoration: underline;
}

.pbc-breadcrumb__sep {
  color: var(--pbc-gray-2, #C9D1DB);
  margin: 0 8px;
  font-size: 12px;
}

.pbc-breadcrumb__current {
  color: var(--pbc-graphite, #2B3642);
  font-weight: 500;
}

/* ==========================================================================
   RUO Notice (single banner above catalog)
   ========================================================================== */

.pbc-shop__ruo-notice {
  background-color: var(--pbc-off-white, #F5F7FA);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: 6px;
  padding: 10px 16px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  line-height: 20px;
  color: var(--pbc-graphite, #2B3642);
  font-style: italic;
  margin-bottom: 16px;
}

/* ==========================================================================
   Toolbar — Results count + View toggle
   ========================================================================== */

.pbc-shop__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pbc-shop__toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pbc-shop__results-count {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  color: var(--pbc-near-black, #0E1720);
}

/* Active filter pills */
.pbc-shop__active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pbc-shop__filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(7, 138, 148, 0.08);
  border: 1px solid rgba(7, 138, 148, 0.25);
  border-radius: 100px;
  padding: 2px 10px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: var(--pbc-accessible-teal, #078A94);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pbc-shop__filter-pill:hover {
  background-color: rgba(7, 138, 148, 0.12);
  border-color: rgba(7, 138, 148, 0.35);
}

.pbc-shop__filter-pill-close {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--pbc-accessible-teal, #078A94);
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.pbc-shop__filter-pill-close:hover {
  opacity: 1;
}

/* Toolbar right (sort + view toggle) */
.pbc-shop__toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Sort select */
.pbc-shop__sort-select {
  padding: 6px 28px 6px 10px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: var(--pbc-graphite, #2B3642);
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%232B3642' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s ease;
}

.pbc-shop__sort-select:hover {
  border-color: var(--pbc-gray-2, #C9D1DB);
}

.pbc-shop__sort-select:focus {
  border-color: var(--pbc-accessible-teal, #078A94);
  outline: none;
  box-shadow: 0 0 0 2px rgba(7, 138, 148, 0.2);
}

/* View toggle */
.pbc-shop__view-toggle {
  display: inline-flex;
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: 6px;
  overflow: hidden;
}

.pbc-shop__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--pbc-white, #FFFFFF);
  border: none;
  cursor: pointer;
  color: var(--pbc-graphite, #2B3642);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pbc-shop__view-btn + .pbc-shop__view-btn {
  border-left: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-shop__view-btn:hover {
  background-color: var(--pbc-off-white, #F5F7FA);
}

.pbc-shop__view-btn--active {
  background-color: var(--pbc-deep-navy, #0B1F33);
  color: var(--pbc-white, #FFFFFF);
}

.pbc-shop__view-btn--active:hover {
  background-color: var(--pbc-deep-navy, #0B1F33);
}

/* ==========================================================================
   Table View
   ========================================================================== */

.pbc-shop-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pbc-shop-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: 8px;
  overflow: hidden;
}

.pbc-shop-table thead th {
  position: sticky;
  top: 0;
  background-color: var(--pbc-off-white, #F5F7FA);
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  color: var(--pbc-graphite, #2B3642);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--pbc-gray-1, #E6EAF0);
  white-space: nowrap;
  z-index: 1;
}

.pbc-shop-table__th-price {
  text-align: right !important;
}

.pbc-shop-table__th-action {
  text-align: center !important;
  width: 130px;
}

.pbc-shop-table__action {
  text-align: center;
  vertical-align: middle;
}

.pbc-shop-table__action .pbc-btn {
  white-space: nowrap;
}

.pbc-shop-table tbody tr {
  transition: background-color 0.1s ease, box-shadow 0.1s ease;
  border-left: 3px solid transparent;
}

.pbc-shop-table tbody tr:hover {
  background-color: var(--pbc-off-white, #F5F7FA);
  box-shadow: inset 3px 0 0 var(--pbc-accessible-teal, #078A94);
}

.pbc-shop-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 20px;
  color: var(--pbc-near-black, #0E1720);
  vertical-align: middle;
}

.pbc-shop-table tbody tr:last-child td {
  border-bottom: none;
}

/* Product cell (name + code) */
.pbc-shop-table__product {
  min-width: 180px;
}

.pbc-shop-table__product-name {
  display: block;
  color: var(--pbc-near-black, #0E1720);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}

.pbc-shop-table__product-name:hover {
  color: var(--pbc-accessible-teal, #078A94);
}

.pbc-shop-table__product-code {
  display: block;
  font-family: var(--pbc-font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  line-height: 16px;
  color: var(--pbc-gray-2, #C9D1DB);
  margin-top: 2px;
}

/* Details cell (purity · format) */
.pbc-shop-table__details {
  font-size: 13px;
  color: var(--pbc-graphite, #2B3642);
  white-space: nowrap;
}

.pbc-shop-table__details-sep {
  color: var(--pbc-gray-2, #C9D1DB);
  margin: 0 3px;
}

/* Sizes cell */
.pbc-shop-table__sizes-cell {
  min-width: 140px;
}

/* Price cell */
.pbc-shop-table__price {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.pbc-shop-table__price del {
  color: #6B7280;
  font-weight: 400;
  font-size: 13px;
}

.pbc-shop-table__price ins {
  color: #92400e;
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

/* ==========================================================================
   Size Pills (catalog — clickable variation links)
   ========================================================================== */

.pbc-size-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pbc-size-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pbc-size-pill--instock {
  color: var(--pbc-accessible-teal, #078A94);
  border-color: rgba(7, 138, 148, 0.3);
  background: rgba(7, 138, 148, 0.06);
}

.pbc-size-pill--instock:hover {
  background: rgba(7, 138, 148, 0.14);
  border-color: var(--pbc-accessible-teal, #078A94);
  color: var(--pbc-accessible-teal, #078A94);
}

.pbc-size-pill--backorder {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.pbc-size-pill--backorder:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #92400e;
}

.pbc-size-pill--backorder small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

.pbc-size-pill--out {
  color: var(--pbc-gray-2, #C9D1DB);
  border-color: var(--pbc-gray-1, #E6EAF0);
  background: var(--pbc-off-white, #F5F7FA);
  cursor: default;
}

.pbc-size-pill--out s {
  text-decoration: line-through;
}

/* Stock status dots for filter sidebar */
.pbc-shop__stock-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.pbc-shop__stock-dot--instock {
  background-color: var(--pbc-success, #1FAD83);
}

.pbc-shop__stock-dot--backorder {
  background-color: var(--pbc-warning, #F59E0B);
}

/* ==========================================================================
   Compact Product Card Grid (no images)
   ========================================================================== */

.pbc-shop__grid--compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.pbc-shop__grid--loading {
  opacity: 0.5;
  pointer-events: none;
}

.pbc-shop__no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-body, 16px);
  line-height: var(--pbc-lh-body, 24px);
  color: var(--pbc-graphite, #2B3642);
}

/* Product Card (compact — no image) */
.pbc-product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-top: 3px solid var(--pbc-success, #1FAD83);
  border-radius: var(--pbc-border-radius, 8px);
  padding: 16px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pbc-product-card:hover {
  border-color: var(--pbc-gray-2, #C9D1DB);
  border-top-color: var(--pbc-accessible-teal, #078A94);
  box-shadow: 0 2px 8px rgba(14, 23, 32, 0.06);
}

/* Backorder card: amber top accent */
.pbc-product-card--backorder {
  border-top-color: var(--pbc-warning, #F59E0B);
}

.pbc-product-card--backorder:hover {
  border-top-color: var(--pbc-warning, #F59E0B);
}

/* Backorder badge on card */
.pbc-backorder-card-badge {
  display: inline-block;
  background-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* Card Body Content */
.pbc-product-card__catalog-code {
  display: inline-block;
  font-family: var(--pbc-font-mono, 'IBM Plex Mono', monospace);
  font-size: var(--pbc-text-data, 13px);
  line-height: var(--pbc-lh-data, 18px);
  color: var(--pbc-graphite, #2B3642);
  background-color: var(--pbc-off-white, #F5F7FA);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.pbc-product-card__title {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: var(--pbc-near-black, #0E1720);
  margin: 0 0 4px;
}

.pbc-product-card__title a {
  color: inherit;
  text-decoration: none;
}

.pbc-product-card__title a:hover {
  color: var(--pbc-accessible-teal, #078A94);
}

/* Meta (purity · format) */
.pbc-product-card__meta {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-small, 13px);
  line-height: var(--pbc-lh-small, 20px);
  color: var(--pbc-graphite, #2B3642);
  margin: 0 0 8px;
}

.pbc-product-card__meta-sep {
  color: var(--pbc-gray-2, #C9D1DB);
  margin: 0 4px;
}

/* Price */
.pbc-product-card__price {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: var(--pbc-near-black, #0E1720);
  margin: 4px 0 0;
}

.pbc-product-card__price del {
  color: #6B7280;
  font-weight: 400;
  font-size: 13px;
  text-decoration: line-through;
}

.pbc-product-card__price ins {
  color: #92400e;
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.pbc-product-card__currency {
  font-size: var(--pbc-text-small, 13px);
  font-weight: 400;
  color: var(--pbc-graphite, #2B3642);
}

/* Actions */
.pbc-product-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.pbc-product-card__actions .pbc-btn {
  flex: 1;
  text-align: center;
  justify-content: center;
}

/* ==========================================================================
   Buttons (shop-specific)
   ========================================================================== */

.pbc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-body, 16px);
  font-weight: 600;
  line-height: var(--pbc-lh-body, 24px);
  border: none;
  border-radius: var(--pbc-border-radius, 8px);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.pbc-btn--sm {
  padding: 6px 14px;
  font-size: var(--pbc-text-small, 13px);
  line-height: var(--pbc-lh-small, 20px);
}

.pbc-btn--primary {
  background-color: var(--pbc-deep-navy, #0B1F33);
  color: var(--pbc-white, #FFFFFF);
}

.pbc-btn--primary:hover {
  background-color: #0d2740;
}

.pbc-btn--primary:focus-visible {
  outline: var(--pbc-focus-outline, 2px solid #078A94);
  outline-offset: var(--pbc-focus-offset, 2px);
}

.pbc-btn--primary:disabled {
  background-color: var(--pbc-gray-2, #C9D1DB);
  cursor: not-allowed;
}

.pbc-btn--secondary {
  background-color: var(--pbc-white, #FFFFFF);
  color: var(--pbc-graphite, #2B3642);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  font-weight: 500;
}

.pbc-btn--secondary:hover {
  border-color: var(--pbc-gray-2, #C9D1DB);
  background-color: var(--pbc-off-white, #F5F7FA);
}

.pbc-btn--secondary:focus-visible {
  outline: var(--pbc-focus-outline, 2px solid #078A94);
  outline-offset: var(--pbc-focus-offset, 2px);
}

/* Outline button — looks like a clear, clickable button */
.pbc-btn--outline {
  background-color: var(--pbc-white, #FFFFFF);
  color: var(--pbc-accessible-teal, #078A94);
  border: 2px solid var(--pbc-accessible-teal, #078A94);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease;
}

.pbc-btn--outline:hover {
  background-color: var(--pbc-accessible-teal, #078A94);
  color: var(--pbc-white, #FFFFFF);
}

.pbc-btn--outline:focus-visible {
  outline: var(--pbc-focus-outline, 2px solid #078A94);
  outline-offset: var(--pbc-focus-offset, 2px);
}

/* Quick-add added state */
.pbc-quick-add-btn--added {
  background-color: var(--pbc-success, #1FAD83) !important;
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

@keyframes pbc-skeleton-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.pbc-skeleton {
  background-color: var(--pbc-gray-1, #E6EAF0);
  border-radius: 4px;
  animation: pbc-skeleton-pulse 1.5s ease-in-out infinite;
}

.pbc-skeleton-row {
  height: 44px;
  margin-bottom: 2px;
}

.pbc-skeleton-card {
  height: 150px;
  border-radius: 8px;
}

/* ==========================================================================
   Filter Sidebar
   ========================================================================== */

.pbc-filter {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  align-self: start;
}

.pbc-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-filter__title {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-h3, 20px);
  font-weight: 600;
  line-height: var(--pbc-lh-h3, 28px);
  color: var(--pbc-near-black, #0E1720);
  margin: 0;
}

.pbc-filter__close {
  display: none;
  background: none;
  border: none;
  color: var(--pbc-graphite, #2B3642);
  cursor: pointer;
  padding: 4px;
}

/* Search input in filter sidebar */
.pbc-filter__search-wrap {
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-filter__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pbc-gray-2, #C9D1DB);
  pointer-events: none;
}

.pbc-filter__search-input {
  display: block;
  width: 100%;
  padding: 8px 10px 8px 32px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 20px;
  color: var(--pbc-near-black, #0E1720);
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: var(--pbc-border-radius, 8px);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pbc-filter__search-input::placeholder {
  color: var(--pbc-gray-2, #C9D1DB);
}

.pbc-filter__search-input:focus {
  border-color: var(--pbc-accessible-teal, #078A94);
  outline: none;
  box-shadow: 0 0 0 2px rgba(7, 138, 148, 0.2);
}

.pbc-filter__group {
  border: none;
  padding: 0 0 20px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-filter__group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pbc-filter__group-title {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  color: var(--pbc-graphite, #2B3642);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-filter__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}

.pbc-filter__checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--pbc-accessible-teal, #078A94);
  cursor: pointer;
}

.pbc-filter__checkbox-label {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 22px;
  color: var(--pbc-graphite, #2B3642);
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.pbc-filter__count {
  color: var(--pbc-gray-2, #C9D1DB);
  font-size: 12px;
  font-weight: 400;
  margin-left: auto;
}

/* Availability filter group — stock status radio/checkboxes */
.pbc-filter__availability-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.pbc-filter__availability-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pbc-filter__availability-dot--in-stock {
  background-color: var(--pbc-success, #1FAD83);
}

.pbc-filter__availability-dot--backorder {
  background-color: var(--pbc-warning, #F59E0B);
}

.pbc-filter__select {
  display: block;
  width: 100%;
  padding: 6px 8px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 22px;
  color: var(--pbc-graphite, #2B3642);
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: var(--pbc-border-radius, 8px);
  cursor: pointer;
}

.pbc-filter__select:focus {
  border-color: var(--pbc-accessible-teal, #078A94);
  outline: var(--pbc-focus-outline, 2px solid #078A94);
  outline-offset: var(--pbc-focus-offset, 2px);
}

.pbc-filter__actions {
  padding-top: 16px;
  border-top: 1px solid var(--pbc-gray-1, #E6EAF0);
}

/* Mobile toggle button (hidden on desktop) */
.pbc-filter__mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-body, 16px);
  font-weight: 500;
  line-height: var(--pbc-lh-body, 24px);
  color: var(--pbc-graphite, #2B3642);
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: var(--pbc-border-radius, 8px);
  cursor: pointer;
  margin-bottom: 16px;
  flex: 0 0 100%;
}

.pbc-filter__mobile-toggle:hover {
  border-color: var(--pbc-gray-2, #C9D1DB);
  background-color: var(--pbc-off-white, #F5F7FA);
}

/* Overlay for mobile filter — use visibility+opacity so it can animate */
.pbc-filter__overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(14, 23, 32, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pbc-filter__overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   Load More
   ========================================================================== */

.pbc-shop__load-more-wrap {
  text-align: center;
  padding: 32px 0;
}

.pbc-shop__load-more {
  min-width: 200px;
}

/* ==========================================================================
   Quick-Add Modal
   ========================================================================== */

.pbc-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.pbc-modal--open {
  display: flex;
}

.pbc-modal__backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(14, 23, 32, 0.5);
}

.pbc-modal__content {
  position: relative;
  background-color: var(--pbc-white, #FFFFFF);
  border-radius: var(--pbc-border-radius, 8px);
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(14, 23, 32, 0.12);
  z-index: 1;
}

.pbc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-modal__title {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-h3, 20px);
  font-weight: 600;
  line-height: var(--pbc-lh-h3, 28px);
  color: var(--pbc-near-black, #0E1720);
  margin: 0;
}

.pbc-modal__close {
  background: none;
  border: none;
  color: var(--pbc-graphite, #2B3642);
  cursor: pointer;
  padding: 4px;
}

.pbc-modal__close:hover {
  color: var(--pbc-near-black, #0E1720);
}

.pbc-modal__body {
  padding: 24px;
}

.pbc-modal__product-name {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-body, 16px);
  font-weight: 600;
  line-height: var(--pbc-lh-body, 24px);
  color: var(--pbc-near-black, #0E1720);
  margin: 0 0 16px;
}

/* Volume Pricing in Quick-Add Modal */
.pbc-quick-add__volume { margin-bottom: 16px; }
.pbc-quick-add__volume-title { font-weight: 600; font-size: 13px; margin: 0 0 8px; }
.pbc-quick-add__volume-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pbc-quick-add__volume-table th { text-align: left; padding: 4px 8px; font-weight: 600; border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0); }
.pbc-quick-add__volume-table td { padding: 4px 8px; }

.pbc-modal__certification {
  padding: 16px;
  background-color: var(--pbc-off-white, #F5F7FA);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: var(--pbc-border-radius, 8px);
}

.pbc-modal__cert-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.pbc-modal__cert-input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--pbc-accessible-teal, #078A94);
  cursor: pointer;
}

.pbc-modal__cert-text {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-small, 13px);
  line-height: var(--pbc-lh-small, 20px);
  color: var(--pbc-graphite, #2B3642);
}

.pbc-modal__error {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: var(--pbc-text-small, 13px);
  line-height: var(--pbc-lh-small, 20px);
  color: var(--pbc-critical, #D92D20);
  margin: 8px 0 0;
  min-height: 20px;
}

.pbc-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--pbc-gray-1, #E6EAF0);
}

/* ==========================================================================
   Body Scroll Lock
   ========================================================================== */

body.pbc-modal-open,
body.pbc-filter-open {
  overflow: hidden;
}

/* Desktop: hide mobile-only elements */
.pbc-filter__show-results {
  display: none;
}

.pbc-filter__mobile-badge {
  display: none;
}

.pbc-mobile-search {
  display: none;
}

/* ==========================================================================
   Tablet (max-width: 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  .pbc-shop__grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  /* Prevent toolbar wrapping on tablet */
  .pbc-shop__toolbar {
    flex-wrap: nowrap;
  }

  .pbc-shop__toolbar-left {
    min-width: 0;
    overflow: hidden;
  }

  .pbc-shop__active-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pbc-shop__active-filters::-webkit-scrollbar {
    display: none;
  }
}

/* ==========================================================================
   Mobile (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {

  /* --- Eliminate duplicate titles & breadcrumbs --- */
  .pbc-shop-page .wp-block-query-title {
    display: none;
  }

  .pbc-shop-page .woocommerce-breadcrumb {
    display: none;
  }

  /* --- Prevent ALL horizontal overflow on mobile --- */
  /* overflow-x: clip (not hidden) also clips fixed-position descendants
     like the WooCommerce mini-cart drawer.  Applied to body to prevent
     horizontal scroll from any source. */
  .pbc-shop-page {
    overflow-x: clip;
    max-width: 100vw;
  }

  .pbc-shop-page .wp-site-blocks {
    overflow-x: hidden;
    max-width: 100%;
  }

  .pbc-shop__main-content {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Size pills: allow wrapping on mobile */
  .pbc-size-pill {
    white-space: normal;
  }

  /* --- Footer columns: WP generates flex-wrap:nowrap which prevents
     stacking on mobile. Force wrap + full-width columns. --- */
  .pbc-footer__grid.wp-block-columns,
  .wp-block-columns.pbc-footer__grid {
    flex-wrap: wrap !important;
  }

  .pbc-footer__grid > .wp-block-column {
    flex-basis: 100% !important;
    flex-grow: 0 !important;
  }

  /* --- Shipping banner: prevent text overflow --- */
  .pbc-shipping-banner__inner {
    flex-wrap: wrap;
    overflow: hidden;
    text-align: center;
    justify-content: center;
    max-width: 100%;
  }

  .pbc-shipping-banner__inner span {
    word-break: break-word;
    text-align: center;
  }

  /* --- Compliance banner overflow --- */
  .pbc-compliance-banner {
    overflow: hidden;
    max-width: 100%;
  }

  /* --- alignwide must not exceed viewport --- */
  .content-area.alignwide,
  .alignwide {
    max-width: 100% !important;
  }

  /* --- Stack layout with horizontal padding --- */
  .pbc-shop-layout {
    flex-direction: column;
    gap: 0;
    padding: 0 16px;
    box-sizing: border-box;
    max-width: 100%;
  }

  /* --- Responsive grid: 2 columns on wider phones, 1 on narrow --- */
  .pbc-shop__grid--compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* --- Hide view toggle on mobile — force card view via JS --- */
  .pbc-shop__view-toggle {
    display: none;
  }

  /* --- Toolbar: compact row with filter + sort --- */
  .pbc-shop__toolbar {
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
  }

  .pbc-shop__toolbar-left {
    flex: 1 1 100%;
    min-width: 0;
    order: 2;
  }

  .pbc-shop__results-count {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide active filter pills from toolbar on mobile — they're in the sheet */
  .pbc-shop__active-filters {
    display: none;
  }

  .pbc-shop__toolbar-right {
    flex-shrink: 0;
    order: 1;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .pbc-shop__sort-select {
    font-size: 14px;
    padding: 10px 32px 10px 12px;
    min-height: 44px;
    flex: 1;
    min-width: 0;
  }

  /* --- Filter toggle: sits next to sort in toolbar-right --- */
  .pbc-filter__mobile-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 10px 14px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    order: -1;
  }

  .pbc-filter__mobile-toggle--active {
    border-color: var(--pbc-accessible-teal, #078A94);
    color: var(--pbc-accessible-teal, #078A94);
    background-color: rgba(7, 138, 148, 0.06);
  }

  .pbc-filter__mobile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--pbc-white, #FFFFFF);
    background-color: var(--pbc-accessible-teal, #078A94);
    border-radius: 9px;
  }

  /* --- Backdrop overlay for mobile filter (base styles above handle animation) --- */

  /* --- Filter sidebar becomes slide-up sheet --- */
  .pbc-filter {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85vh;
    background-color: var(--pbc-white, #FFFFFF);
    border-radius: 16px 16px 0 0;
    padding: 24px 24px calc(80px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    z-index: 1000;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 24px rgba(14, 23, 32, 0.16);
  }

  .pbc-filter--open {
    transform: translateY(0);
  }

  /* Drag handle at top of filter sheet */
  .pbc-filter::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background-color: var(--pbc-gray-2, #C9D1DB);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  .pbc-filter__close {
    display: block;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Sticky "Show Results" button inside filter sheet — pinned to bottom */
  .pbc-filter__show-results {
    display: block;
    position: sticky;
    bottom: calc(-80px - env(safe-area-inset-bottom, 0px));
    margin: 16px -24px 0;
    padding: 12px 24px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: var(--pbc-white, #FFFFFF);
    border-top: 1px solid var(--pbc-gray-1, #E6EAF0);
    z-index: 1;
  }

  .pbc-filter__show-results .pbc-btn {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }

  /* --- Table wrap: constrain on mobile --- */
  .pbc-shop-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* --- Table → stacked cards on mobile (fallback if table view loads) --- */
  .pbc-shop-table thead {
    display: none;
  }

  .pbc-shop-table,
  .pbc-shop-table tbody {
    display: block;
    border: none;
    max-width: 100%;
  }

  .pbc-shop-table tr {
    display: flex;
    flex-direction: column;
    background: var(--pbc-white, #FFFFFF);
    border: 1px solid var(--pbc-gray-1, #E6EAF0);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 14px 16px;
    overflow: hidden;
  }

  .pbc-shop-table tbody tr:hover {
    box-shadow: none;
    border-color: var(--pbc-gray-2, #C9D1DB);
  }

  .pbc-shop-table td {
    display: block;
    border: none;
    padding: 2px 0;
    font-size: 14px;
    text-align: left;
  }

  /* Remove data-label pseudo-elements — they waste space */
  .pbc-shop-table td::before {
    content: none;
  }

  /* Product name: full width, prominent */
  .pbc-shop-table__product {
    order: 1;
    min-width: 0;
  }

  .pbc-shop-table__product-name {
    font-size: 15px;
    line-height: 22px;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Category badge: allow wrapping and constrain width */
  .pbc-cat-badge {
    white-space: normal;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Details: hide when empty or show subtle */
  .pbc-shop-table__details {
    order: 3;
    font-size: 13px;
    color: var(--pbc-graphite, #2B3642);
    white-space: normal;
  }

  .pbc-shop-table__details:empty,
  .pbc-shop-table__details--empty {
    display: none;
  }

  /* Price right after product name — allow wrapping for backorder del/ins */
  .pbc-shop-table__price {
    order: 2;
    text-align: left;
    font-size: 15px;
    padding-top: 4px;
    padding-bottom: 4px;
    flex-wrap: wrap;
  }

  /* Sizes below */
  .pbc-shop-table__sizes-cell {
    order: 4;
    min-width: 0;
    padding-top: 6px;
  }

  .pbc-size-pills {
    justify-content: flex-start;
  }

  /* --- Product card: reorder for mobile info hierarchy --- */
  .pbc-product-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
  }

  /* 1. Name — large, clear, first */
  .pbc-product-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    order: 1;
    margin-bottom: 8px;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .pbc-product-card__title a {
    color: var(--pbc-near-black, #0E1720);
  }

  /* 2. Stock status */
  .pbc-product-card__stock {
    order: 2;
    display: inline-flex;
    margin-bottom: 6px;
  }

  /* 3. Price */
  .pbc-product-card__price {
    order: 3;
    margin: 0 0 4px;
    font-size: 15px;
  }

  /* 4. Meta (purity, format) */
  .pbc-product-card__meta {
    order: 4;
    font-size: 12px;
  }

  /* Hide catalog code/SKU on mobile */
  .pbc-product-card__catalog-code {
    display: none;
  }

  /* Ensure backorder badge is inline (not absolute) in compact cards */
  .pbc-shop__grid--compact .pbc-backorder-card-badge {
    position: static;
  }

  .pbc-backorder-card-badge {
    order: 0;
    font-size: 11px;
    padding: 2px 8px;
    margin-bottom: 6px;
  }

  /* 5. Actions */
  .pbc-product-card__actions {
    order: 5;
    flex-direction: column;
    padding-top: 10px;
    gap: 8px;
  }

  .pbc-product-card__actions .pbc-btn {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
    padding: 10px 16px;
    text-align: center;
  }

  /* --- RUO notice: compact, meets readability minimum --- */
  .pbc-shop__ruo-notice {
    font-size: 13px;
    line-height: 18px;
    padding: 8px 12px;
  }

  /* --- Breadcrumb: tighter separators on mobile --- */
  .pbc-breadcrumb__sep {
    margin: 0 4px;
  }

  /* --- Shop page title --- */
  .pbc-shop-page .woocommerce-products-header__title {
    font-size: 22px;
    line-height: 28px;
    margin-bottom: 4px;
  }

  /* --- Search wrap inside filter sheet on mobile --- */
  .pbc-filter__search-wrap {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  /* --- Mobile search bar (cloned outside the filter drawer) --- */
  .pbc-mobile-search {
    display: block;
    position: relative;
    margin-bottom: 12px;
  }

  .pbc-mobile-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pbc-gray-2, #C9D1DB);
    pointer-events: none;
  }

  .pbc-mobile-search__input {
    display: block;
    width: 100%;
    padding: 10px 12px 10px 36px;
    font-family: var(--pbc-font-ui, 'Inter', sans-serif);
    font-size: 16px; /* >=16px prevents iOS zoom */
    line-height: 22px;
    color: var(--pbc-near-black, #0E1720);
    background-color: var(--pbc-white, #FFFFFF);
    border: 1px solid var(--pbc-gray-1, #E6EAF0);
    border-radius: var(--pbc-border-radius, 8px);
    box-sizing: border-box;
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
  }

  .pbc-mobile-search__input::placeholder {
    color: var(--pbc-gray-2, #C9D1DB);
  }

  .pbc-mobile-search__input:focus {
    border-color: var(--pbc-accessible-teal, #078A94);
    outline: none;
    box-shadow: 0 0 0 2px rgba(7, 138, 148, 0.2);
  }

  /* Filter search input — prevent iOS zoom */
  .pbc-filter__search-input {
    font-size: 16px;
  }

  /* --- Filter checkboxes — larger touch targets --- */
  .pbc-filter__checkbox {
    padding: 6px 0;
    min-height: 44px;
    align-items: center;
  }

  .pbc-filter__checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  .pbc-filter__checkbox-label {
    font-size: 15px;
  }

  /* --- Quick-add modal — bottom sheet on mobile --- */
  .pbc-modal__content {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  .pbc-modal__header {
    padding: 14px 16px;
    position: sticky;
    top: 0;
    background: var(--pbc-white, #FFFFFF);
    z-index: 1;
  }

  .pbc-modal__close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pbc-modal__body {
    padding: 16px;
  }

  .pbc-modal__footer {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    background: var(--pbc-white, #FFFFFF);
    flex-direction: column;
    gap: 8px;
  }

  .pbc-modal__footer .pbc-btn {
    min-height: 48px;
    flex: none;
    width: 100%;
  }

  .pbc-modal__cert-input {
    width: 22px;
    height: 22px;
  }

  /* --- No results — less padding on mobile --- */
  .pbc-shop__no-results {
    padding: 40px 0;
  }

  /* --- Load more — full width --- */
  .pbc-shop__load-more {
    width: 100%;
    min-height: 48px;
  }

  /* --- Autocomplete touch targets --- */
  .pbc-autocomplete__item {
    padding: 12px;
    min-height: 44px;
  }
}

/* ==========================================================================
   Size Selector (single product page — replaces native WC variation dropdown)
   ========================================================================== */

/* ==========================================================================
   Dynamic Selected Price Display (above size grid)
   ========================================================================== */

.pbc-size-selector__selected-price {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-size-selector__selected-amount {
  display: block;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--pbc-near-black, #0E1720);
  transition: opacity 0.15s ease;
}

.pbc-size-selector__selected-context {
  display: block;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--pbc-graphite, #2B3642);
  margin-top: 4px;
}

.pbc-size-selector__selected-from {
  display: block;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--pbc-gray-2, #C9D1DB);
  margin-top: 2px;
}

/* ==========================================================================
   Size Selector Container
   ========================================================================== */

.pbc-size-selector {
  margin: 0 0 var(--pbc-space-3, 24px);
  padding: 20px;
  background-color: var(--pbc-off-white, #F5F7FA);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: var(--pbc-border-radius, 8px);
}

.pbc-size-selector__label {
  display: block;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  color: var(--pbc-graphite, #2B3642);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.pbc-size-selector__buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.pbc-size-selector__btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 12px 14px;
  min-height: 44px;
  background-color: var(--pbc-white, #FFFFFF);
  border: 2px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: var(--pbc-border-radius, 8px);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  text-align: left;
}

/* Button content: stacked — size, price, status each on own line */
.pbc-size-selector__btn-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pbc-size-selector__btn-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--pbc-graphite, #2B3642);
  white-space: nowrap;
}

/* Pre-order buttons: slightly muted price */
.pbc-size-selector__btn--backorder .pbc-size-selector__btn-price {
  opacity: 0.75;
}

.pbc-size-selector__btn:hover:not(:disabled) {
  border-color: var(--pbc-accessible-teal, #078A94);
  background-color: rgba(7, 138, 148, 0.03);
}

.pbc-size-selector__btn:focus-visible {
  outline: 2px solid var(--pbc-accessible-teal, #078A94);
  outline-offset: 2px;
}

/* Active: teal border + teal background */
.pbc-size-selector__btn--active {
  border-color: var(--pbc-accessible-teal, #078A94);
  background-color: rgba(7, 138, 148, 0.08);
  box-shadow: 0 0 0 1px var(--pbc-accessible-teal, #078A94);
}

.pbc-size-selector__btn--active:hover:not(:disabled) {
  background-color: rgba(7, 138, 148, 0.12);
}

/* Active + backorder: amber */
.pbc-size-selector__btn--backorder.pbc-size-selector__btn--active {
  border-color: var(--pbc-warning, #F59E0B);
  background-color: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 0 1px var(--pbc-warning, #F59E0B);
}

.pbc-size-selector__btn--backorder.pbc-size-selector__btn--active:hover:not(:disabled) {
  background-color: rgba(245, 158, 11, 0.12);
}

/* Out of stock: disabled */
.pbc-size-selector__btn--out,
.pbc-size-selector__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: var(--pbc-off-white, #F5F7FA);
  border-style: dashed;
}

.pbc-size-selector__size {
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  color: var(--pbc-near-black, #0E1720);
  white-space: nowrap;
}

.pbc-size-selector__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  color: var(--pbc-graphite, #2B3642);
  margin-top: 4px;
}

.pbc-size-selector__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pbc-size-selector__dot--instock {
  background-color: var(--pbc-success, #1FAD83);
}

.pbc-size-selector__dot--backorder {
  background-color: var(--pbc-warning, #F59E0B);
}

.pbc-size-selector__dot--out {
  background-color: var(--pbc-gray-2, #C9D1DB);
}

/* Stock group sections within the selector */
.pbc-size-selector__group {
  margin-bottom: 16px;
}

.pbc-size-selector__group:last-child {
  margin-bottom: 0;
}

.pbc-size-selector__group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-size-selector__group-label--instock {
  color: var(--pbc-success, #1FAD83);
}

.pbc-size-selector__group-label--restock {
  color: var(--pbc-warning-dark, #B45309);
}

/* Legacy selected variation price (now hidden — replaced by above-grid display) */
.pbc-size-selector__price {
  display: none;
}

/* Hide native WC variation controls when size selector is present */
.pbc-size-selector + form .variations,
.pbc-size-selector + form .reset_variations,
.pbc-size-selector ~ form .variations,
.pbc-size-selector ~ form .reset_variations {
  display: none !important;
}

/* Hide WC default price display — our selector shows the price */
.pbc-size-selector ~ form .woocommerce-variation-price,
.pbc-size-selector + form .woocommerce-variation-price {
  display: none !important;
}

@media (max-width: 600px) {
  /* Shop grid: single column on narrow phones */
  .pbc-shop__grid--compact {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pbc-size-selector__buttons {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .pbc-size-selector {
    padding: 12px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .pbc-size-selector__btn {
    padding: 10px 10px;
    min-height: 44px;
  }

  .pbc-size-selector__size {
    font-size: 14px;
  }

  .pbc-size-selector__btn-price {
    font-size: 13px;
  }

  .pbc-size-selector__selected-amount {
    font-size: 24px;
  }

  .pbc-size-selector__selected-price {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
}

/* Extra small screens (320px) */
@media (max-width: 360px) {
  .pbc-size-selector__buttons {
    grid-template-columns: 1fr;
  }

  .pbc-size-selector__btn {
    padding: 10px 12px;
  }
}

/* ==========================================================================
   Category Filter Pills (horizontal quick-filter above grid)
   ========================================================================== */

.pbc-cat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-cat-pills__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: var(--pbc-graphite, #2B3642);
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pbc-cat-pills__pill:hover {
  border-color: var(--pbc-gray-2, #C9D1DB);
  background-color: var(--pbc-off-white, #F5F7FA);
}

.pbc-cat-pills__pill--active {
  background-color: var(--pbc-deep-navy, #0B1F33);
  color: var(--pbc-white, #FFFFFF);
  border-color: var(--pbc-deep-navy, #0B1F33);
}

.pbc-cat-pills__pill--active:hover {
  background-color: #0d2740;
  border-color: #0d2740;
}

.pbc-cat-pills__count {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.6;
}

.pbc-cat-pills__pill--active .pbc-cat-pills__count {
  opacity: 0.7;
}

/* ==========================================================================
   Category Badge (on product cards and table rows)
   ========================================================================== */

.pbc-cat-badge {
  display: inline-block;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  color: #056a72;
  background-color: rgba(7, 138, 148, 0.08);
  border: 1px solid rgba(7, 138, 148, 0.2);
  border-radius: 3px;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   Search Autocomplete Dropdown
   ========================================================================== */

.pbc-autocomplete {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--pbc-white, #FFFFFF);
  border: 1px solid var(--pbc-gray-1, #E6EAF0);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(14, 23, 32, 0.1);
  max-height: 320px;
  overflow-y: auto;
}

.pbc-autocomplete__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--pbc-near-black, #0E1720);
  transition: background-color 0.1s ease;
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-autocomplete__item:last-child {
  border-bottom: none;
}

.pbc-autocomplete__item:hover,
.pbc-autocomplete__item--active {
  background-color: var(--pbc-off-white, #F5F7FA);
}

.pbc-autocomplete__item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.pbc-autocomplete__name {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--pbc-near-black, #0E1720);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pbc-autocomplete__code {
  font-family: var(--pbc-font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  line-height: 16px;
  color: var(--pbc-gray-2, #C9D1DB);
}

.pbc-autocomplete__category {
  flex-shrink: 0;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  color: var(--pbc-accessible-teal, #078A94);
  background-color: rgba(7, 138, 148, 0.08);
  border-radius: 3px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pbc-autocomplete__empty,
.pbc-autocomplete__blocked {
  padding: 16px 12px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 13px;
  line-height: 20px;
  color: var(--pbc-graphite, #2B3642);
  text-align: center;
  font-style: italic;
}

.pbc-autocomplete__blocked {
  color: var(--pbc-warning, #F59E0B);
}

/* ==========================================================================
   Stock Status Indicator (product cards)
   ========================================================================== */

.pbc-product-card__stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  margin-top: 4px;
}

.pbc-product-card__stock-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pbc-product-card__stock--instock {
  color: var(--pbc-success, #1FAD83);
}

.pbc-product-card__stock--instock .pbc-product-card__stock-dot {
  background-color: var(--pbc-success, #1FAD83);
}

.pbc-product-card__stock--backorder {
  color: #92400e;
}

.pbc-product-card__stock--backorder .pbc-product-card__stock-dot {
  background-color: var(--pbc-warning, #F59E0B);
}

.pbc-product-card__stock--outofstock {
  color: var(--pbc-gray-2, #C9D1DB);
}

.pbc-product-card__stock--outofstock .pbc-product-card__stock-dot {
  background-color: var(--pbc-gray-2, #C9D1DB);
}

/* ==========================================================================
   Verify-to-See-Pricing CTA (non-verified users)
   ========================================================================== */

.pbc-product-card__price--locked {
  margin: 6px 0 0;
}

.pbc-product-card__verify-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  color: var(--pbc-accessible-teal, #078A94);
  text-decoration: none;
  transition: color 0.15s ease;
}

.pbc-product-card__verify-link:hover {
  color: #056a72;
  text-decoration: underline;
}

.pbc-product-card__verify-link svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Quick Add Button on Product Cards
   ========================================================================== */

.pbc-product-card__quick-add {
  white-space: nowrap;
}

/* ==========================================================================
   Enhanced Empty State
   ========================================================================== */

.pbc-shop__no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--pbc-graphite, #2B3642);
}

.pbc-shop__no-results-icon {
  display: block;
  margin: 0 auto 16px;
  color: var(--pbc-gray-2, #C9D1DB);
}

.pbc-shop__no-results-title {
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--pbc-near-black, #0E1720);
  margin: 0 0 8px;
}

.pbc-shop__no-results-text {
  font-size: 14px;
  line-height: 22px;
  margin: 0 0 20px;
  color: var(--pbc-graphite, #2B3642);
}

.pbc-shop__no-results-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--pbc-accessible-teal, #078A94);
  background: none;
  border: 1px solid var(--pbc-accessible-teal, #078A94);
  border-radius: var(--pbc-border-radius, 8px);
  cursor: pointer;
  transition: background-color 0.15s ease;
  min-height: 44px;
}

.pbc-shop__no-results-cta:hover {
  background-color: rgba(7, 138, 148, 0.06);
}

/* Mobile search clear button */
.pbc-mobile-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--pbc-off-white, #F5F7FA);
  border: none;
  border-radius: 50%;
  color: var(--pbc-graphite, #2B3642);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pbc-mobile-search__clear:hover {
  background-color: var(--pbc-gray-1, #E6EAF0);
}

.pbc-mobile-search--has-value .pbc-mobile-search__clear {
  display: flex;
}

.pbc-mobile-search--has-value .pbc-mobile-search__input {
  padding-right: 40px;
}

/* ==========================================================================
   Enhanced Product Card Hover
   ========================================================================== */

.pbc-product-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pbc-product-card:hover {
  border-color: var(--pbc-gray-2, #C9D1DB);
  border-top-color: var(--pbc-accessible-teal, #078A94);
  box-shadow: 0 4px 16px rgba(14, 23, 32, 0.08);
  transform: translateY(-2px);
}

.pbc-product-card--backorder:hover {
  border-top-color: var(--pbc-warning, #F59E0B);
}

/* Enhanced table row hover */
.pbc-shop-table tbody tr {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

/* ==========================================================================
   Category Pills — Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .pbc-cat-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 12px;
    margin-bottom: 12px;
    gap: 6px;
    /* Allow horizontal swipe on touch devices */
    touch-action: pan-x;
    /* Fade hint for scrollable content */
    mask-image: linear-gradient(to right, black calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent);
  }

  .pbc-cat-pills::-webkit-scrollbar {
    display: none;
  }

  /* Remove fade when scrolled to end */
  .pbc-cat-pills--scrolled-end {
    mask-image: none;
    -webkit-mask-image: none;
  }

  .pbc-cat-pills__pill {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 44px;
    box-sizing: border-box;
  }

  /* Use short names on mobile */
  .pbc-cat-pills__pill-name {
    display: none;
  }

  .pbc-cat-pills__pill::before {
    content: attr(data-short-name);
  }

  /* "All" pill has no data-short-name — show original text */
  .pbc-cat-pills__pill:not([data-short-name])::before {
    content: none;
  }

  .pbc-cat-pills__pill:not([data-short-name]) .pbc-cat-pills__pill-name {
    display: inline;
  }

  /* Autocomplete: full-width on mobile */
  .pbc-autocomplete {
    max-height: 250px;
  }

  /* Mobile search autocomplete needs higher z-index than cat pills */
  .pbc-mobile-search .pbc-autocomplete {
    z-index: 200;
  }
}

/* ==========================================================================
   Cardo Font Override — prevent FSE theme from injecting serif font
   ========================================================================== */

.has-cardo-font-family {
  font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif) !important;
}

/* ==========================================================================
   Low Stock Urgency Signals
   ========================================================================== */

.pbc-low-stock-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  margin: 8px 0;
}

.pbc-stock-low {
  display: inline-block;
  color: #d97706;
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   Product Description Accordion
   ========================================================================== */

.pbc-accordion__section {
  border-bottom: 1px solid var(--pbc-border, #e5e7eb);
}

.pbc-accordion__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--pbc-font-ui, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--pbc-near-black, #0E1720);
  text-align: left;
  line-height: 1.4;
}

.pbc-accordion__toggle:hover {
  color: var(--pbc-primary, #2563eb);
}

.pbc-accordion__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
  color: var(--pbc-muted, #6b7280);
}

.pbc-accordion__section--open .pbc-accordion__chevron {
  transform: rotate(180deg);
}

.pbc-accordion__content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.pbc-accordion__section--open .pbc-accordion__content {
  max-height: 2000px;
}

.pbc-accordion__content-inner {
  padding: 0 0 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--pbc-body-text, #374151);
}

/* --- Specification tables inside accordion --- */
.pbc-accordion__content-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}

.pbc-accordion__content-inner table tr {
  border-bottom: 1px solid var(--pbc-gray-1, #E6EAF0);
}

.pbc-accordion__content-inner table tr:last-child {
  border-bottom: none;
}

.pbc-accordion__content-inner table td {
  padding: 10px 12px;
  vertical-align: top;
  line-height: 1.5;
}

.pbc-accordion__content-inner table td:first-child {
  font-weight: 600;
  color: var(--pbc-near-black, #0E1720);
  white-space: nowrap;
  width: 1%;
}

.pbc-accordion__content-inner table td:last-child {
  color: var(--pbc-graphite, #2B3642);
}

/* Mobile: stack spec table rows vertically */
@media (max-width: 768px) {
  .pbc-accordion__content-inner table td:first-child {
    white-space: normal;
  }

  .pbc-accordion__content-inner table,
  .pbc-accordion__content-inner table tbody,
  .pbc-accordion__content-inner table tr,
  .pbc-accordion__content-inner table td {
    display: block;
    width: 100%;
  }

  .pbc-accordion__content-inner table tr {
    padding: 10px 0;
  }

  .pbc-accordion__content-inner table td {
    padding: 0;
  }

  .pbc-accordion__content-inner table td:first-child {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--pbc-muted, #6b7280);
    padding-bottom: 2px;
  }

  .pbc-accordion__content-inner table td:last-child {
    font-size: 14px;
    color: var(--pbc-near-black, #0E1720);
  }
}
