/* ============================================================
   Product Builder — Frontend Styles v3.1
   Design: Modern Light — brand colour system
   Font: Geist (display) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Geist:wght@500;600;700;800&display=swap');

/* ============================================================
   BRAND TOKENS  (source of truth — edit here only)
   ============================================================ */
:root {
  --s-primary:      #ef4a23;          /* orange-red — primary action */
  --s-primary-dark: #D51E0B;          /* darker shade for hover */
  --s-secondary:    #3749bb;          /* blue — secondary / links */
  --s-tertiary:     #838383;          /* mid-grey — muted text */
  --s-hf-bg:        #081621;          /* dark navy — header / footer bg */
  --s-b-bg:         #f2f4f8;          /* light grey — page background */
  --s-m-bg:         #6E2594;          /* purple — badge / highlight */
  --s-s-bg:         rgba(55,73,187,.05); /* faint blue — surface tint */
  --s-f-c1:         #666666;          /* body text secondary */
  --s-f-c2:         #ffffff;          /* white — text on dark */
}

/* ============================================================
   DESIGN TOKENS  (mapped from brand)
   ============================================================ */
:root {
  /* Surfaces */
  --pb-bg:       var(--s-b-bg);       /* page background */
  --pb-surface:  var(--s-f-c2);       /* white card / panel */
  --pb-surface2: var(--s-b-bg);       /* subtle off-white rows */
  --pb-surface3: var(--s-s-bg);       /* faint blue tint cells */

  /* Borders */
  --pb-border:    #e2e6ef;
  --pb-border-md: #cdd2dd;

  /* Accent — primary orange-red */
  --pb-accent:      var(--s-primary);
  --pb-accent-dark: var(--s-primary-dark);
  --pb-accent-pale: rgba(239,74,35,.06);
  --pb-accent-ring: rgba(239,74,35,.15);

  /* Secondary blue — used for links, choose buttons */
  --pb-secondary:      var(--s-secondary);
  --pb-secondary-pale: rgba(55,73,187,.08);
  --pb-secondary-ring: rgba(55,73,187,.15);

  /* Text */
  --pb-text:  var(--s-hf-bg);         /* #081621 near-black */
  --pb-text2: var(--s-f-c1);          /* #666 secondary */
  --pb-text3: var(--s-tertiary);      /* #838 muted */

  /* Semantic */
  --pb-success:     #059669;
  --pb-danger:      #dc2626;
  --pb-danger-pale: #fef2f2;
  --pb-warn:        #d97706;

  /* Radii */
  --pb-radius:    12px;
  --pb-radius-sm: 8px;
  --pb-radius-xs: 6px;

  /* Shadows */
  --pb-shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --pb-shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --pb-shadow:    0 4px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --pb-shadow-md: 0 8px 24px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);

  /* Typography */
  --pb-font-display: 'Geist', 'Inter', sans-serif;
  --pb-font-body:    'Inter', sans-serif;

  /* Transition */
  --pb-ease: .15s ease;
}

/* ============================================================
   THEME CONTAINER OVERRIDES
   Force builder pages to use their own layout system, not the
   theme's default content container constraints.
   ============================================================ */

/* Remove padding/margin that themes inject into their content wrapper */
body.pb-builder-page .site-content,
body.pb-builder-page .entry-content,
body.pb-builder-page .post-content,
body.pb-builder-page article,
body.pb-builder-page .wp-block-group,
body.pb-builder-page main > .container,
body.pb-builder-page main > .site-inner {
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: none !important;
}

/* Make sure builder pages inherit normal box-sizing */
body.pb-builder-page {
  background-color: var(--pb-bg);
}


#pb-builder-wrap,
.pb-products-page,
#pb-loader {
  font-family: var(--pb-font-body);
  color: var(--pb-text);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

#pb-builder-wrap *,
.pb-products-page *,
#pb-loader * {
  box-sizing: border-box;
}

/* ============================================================
   LOADER
   ============================================================ */
#pb-loader {
  position: fixed;
  inset: 0;
  background: rgba(242,244,248,.94);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.pb-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--pb-border);
  border-top-color: var(--pb-accent);
  border-radius: 50%;
  animation: pb-spin .7s linear infinite;
}

@keyframes pb-spin { to { transform: rotate(360deg); } }

.pb-loader-text {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pb-text2);
}

/* ============================================================
   BUILDER MAIN PAGE
   ============================================================ */
.pb-page-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  width: 100%;
}

#pb-builder-wrap {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  overflow: hidden;
  box-shadow: var(--pb-shadow);
  animation: pb-fadein .3s ease both;
}

@keyframes pb-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Builder Header ---- */
.pb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: var(--s-hf-bg);         /* dark navy */
  flex-wrap: wrap;
}

.pb-logo img {
  max-height: 36px;
  max-width: 140px;
  object-fit: contain;
}
.pb-logo h1,
.pb-site-name {
  font-family: var(--pb-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--s-f-c2);
  margin: 0;
  letter-spacing: -.02em;
  text-decoration: none;
}
.pb-logo a { display: inline-flex; align-items: center; text-decoration: none; }

.pb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pb-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--pb-radius-sm);
  color: rgba(255,255,255,.88);
  font-family: var(--pb-font-body);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--pb-ease), border-color var(--pb-ease);
  white-space: nowrap;
}
.pb-action:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.28);
  color: var(--s-f-c2);
  text-decoration: none;
}

/* Add-to-cart = primary orange */
.pb-action.pb-add-to-cart {
  background: var(--s-primary);
  border-color: var(--s-primary);
  color: var(--s-f-c2);
  font-weight: 600;
}
.pb-action.pb-add-to-cart:hover {
  background: var(--s-primary-dark);
  border-color: var(--s-primary-dark);
  color: var(--s-f-c2);
}
.pb-action .pb-action-icon {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

/* ---- Top info bar ---- */
.pb-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--pb-surface);
  border-bottom: 1px solid var(--pb-border);
  gap: 12px;
  flex-wrap: wrap;
}

.pb-builder-title h3 {
  font-family: var(--pb-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--pb-text);
  margin: 0 0 2px;
}
.pb-builder-desc {
  font-size: 13px;
  color: var(--pb-text2);
  margin: 0;
}

.pb-totals { text-align: right; flex-shrink: 0; }
.pb-total-price {
  display: block;
  font-family: var(--pb-font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--s-primary);            /* orange price total */
  letter-spacing: -.03em;
  line-height: 1;
  transition: color var(--pb-ease);
}
.pb-total-items {
  font-size: 11px;
  color: var(--pb-text3);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
  font-weight: 500;
}

/* ============================================================
   TABLE HEAD
   ============================================================ */
.pb-table-head {
  display: grid;
  grid-template-columns: 64px 1fr 140px 100px 140px;
  padding: 0 24px;
  background: var(--s-b-bg);          /* light grey */
  border-bottom: 1px solid var(--pb-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.pb-th {
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pb-text3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pb-th:first-child { padding-left: 0; }
.pb-th:nth-child(3),
.pb-th:nth-child(4),
.pb-th:nth-child(5) { justify-content: center; }

/* ============================================================
   COMPONENT ROWS
   ============================================================ */
.pb-components { background: var(--pb-surface); }

.pb-component-row {
  display: grid;
  grid-template-columns: 64px 1fr 140px 100px 140px;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--pb-border);
  transition: background var(--pb-ease);
  position: relative;
}
.pb-component-row:last-child { border-bottom: none; }
.pb-component-row:hover      { background: var(--s-b-bg); }

/* Selected — orange left bar */
.pb-component-row.has-product { background: var(--pb-accent-pale); }
.pb-component-row.has-product::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--s-primary);
  border-radius: 0 2px 2px 0;
}

/* Required missing — danger bar */
.pb-component-row.is-required-missing { background: var(--pb-danger-pale); }
.pb-component-row.is-required-missing::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--pb-danger);
  border-radius: 0 2px 2px 0;
}

/* Cell padding */
.pb-component-row > *             { padding: 14px 8px; }
.pb-component-row > *:first-child { padding-left: 0; }
.pb-component-row > *:last-child  { padding-right: 0; }

/* Icon */
.pb-component-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--pb-radius-sm);
  background: var(--s-b-bg);
  border: 1px solid var(--pb-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--pb-ease);
}
.pb-component-row.has-product .pb-component-icon { border-color: var(--s-primary); }
.pb-comp-img         { width: 100%; height: 100%; object-fit: cover; }
.pb-comp-placeholder { font-size: 20px; color: var(--pb-text3); }

/* Info */
.pb-component-info { min-width: 0; }
.pb-comp-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pb-text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.pb-required-badge {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: rgba(110,37,148,.08);   /* purple tint from --s-m-bg */
  color: var(--s-m-bg);
  border: 1px solid rgba(110,37,148,.2);
  padding: 1px 6px;
  border-radius: 99px;
}
.pb-comp-product-name {
  font-size: 12px;
  color: var(--pb-text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.pb-component-row.has-product .pb-comp-product-name {
  color: var(--s-secondary);          /* blue when selected */
  font-weight: 500;
}

/* Qty */
.pb-component-qty { display: flex; justify-content: center; }
.pb-qty-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-sm);
  overflow: hidden;
  background: var(--pb-surface);
}
.pb-qty-btn {
  width: 28px;
  height: 30px;
  background: var(--s-b-bg);
  border: none;
  color: var(--pb-text2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--pb-ease), color var(--pb-ease);
  padding: 0;
  flex-shrink: 0;
}
.pb-qty-btn:hover { background: var(--pb-accent-pale); color: var(--s-primary); }
.pb-qty-input {
  width: 34px;
  height: 30px;
  text-align: center;
  background: transparent;
  border: none;
  border-left: 1px solid var(--pb-border);
  border-right: 1px solid var(--pb-border);
  color: var(--pb-text);
  font-family: var(--pb-font-display);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

/* Price */
.pb-component-price {
  font-family: var(--pb-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--pb-text3);
  text-align: center;
  transition: color var(--pb-ease);
}
.pb-component-row.has-product .pb-component-price { color: var(--pb-success); }

/* Actions */
.pb-component-actions { display: flex; justify-content: center; }
.pb-act-group         { display: flex; gap: 5px; align-items: center; }

.pb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--pb-radius-sm);
  font-family: var(--pb-font-body);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--pb-ease);
  white-space: nowrap;
}

/* Choose = secondary blue */
.pb-choose-btn {
  background: var(--pb-secondary-pale);
  border-color: rgba(55,73,187,.2);
  color: var(--s-secondary);
}
.pb-choose-btn:hover {
  background: var(--s-secondary);
  border-color: var(--s-secondary);
  color: var(--s-f-c2);
  text-decoration: none;
}

/* Remove = danger */
.pb-remove-btn {
  background: var(--pb-danger-pale);
  border-color: rgba(220,38,38,.15);
  color: var(--pb-danger);
  padding: 7px 10px;
}
.pb-remove-btn:hover {
  background: #fee2e2;
  border-color: var(--pb-danger);
  color: var(--pb-danger);
  text-decoration: none;
}

/* ============================================================
   PRODUCTS PAGE
   ============================================================ */
.pb-products-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 0 80px;
  animation: pb-fadein .3s ease both;
  width: 100%;
}

/* ---- Header — dark navy ---- */
.pb-products-header {
  background: var(--s-hf-bg);         /* #081621 navy */
  padding: 32px 36px 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  border-radius: var(--pb-radius);
}

/* Subtle decorative circle */
.pb-products-header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: rgba(255,255,255,.03);
  border-radius: 50%;
  pointer-events: none;
}

/* Inner wrapper keeps content above pseudo-element */
.pb-products-header-inner {
  position: relative;
  z-index: 1;
}

/* Breadcrumb nav */
.pb-products-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.pb-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 99px;
  background: rgba(255,255,255,.07);
  transition: background var(--pb-ease), border-color var(--pb-ease), color var(--pb-ease);
}
.pb-back-link:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.32);
  color: var(--s-f-c2);
  text-decoration: none;
}
.pb-breadcrumb-sep {
  color: rgba(255,255,255,.28);
  font-size: 13px;
}
.pb-breadcrumb-current {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  font-weight: 500;
}

/* Title */
.pb-products-title {
  font-family: var(--pb-font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--s-f-c2);
  margin: 0 0 14px;
  letter-spacing: -.03em;
  line-height: 1.2;
}

/* Count badge */
.pb-products-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-products-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14);
  padding: 4px 12px;
  border-radius: 99px;
}
.pb-products-count strong { color: var(--s-f-c2); font-weight: 600; }

/* Currently selected banner */
.pb-current-selection {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--pb-radius-sm);
  font-size: 13px;
  color: rgba(255,255,255,.78);
}
.pb-current-selection strong { color: var(--s-f-c2); }
.pb-current-selection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s-primary);       /* orange pulse dot */
  flex-shrink: 0;
  animation: pb-pulse 2s ease infinite;
}
@keyframes pb-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

/* ---- Search bar ---- */
.pb-search-wrap { margin-top: 20px; }

.pb-search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--pb-radius-sm);
  overflow: hidden;
  transition: background var(--pb-ease), border-color var(--pb-ease), box-shadow var(--pb-ease);
}
.pb-search-box:focus-within {
  background: rgba(255,255,255,.13);
  border-color: var(--s-primary);     /* orange focus ring */
  box-shadow: 0 0 0 3px rgba(239,74,35,.2);
}

.pb-search-icon {
  flex-shrink: 0;
  margin: 14px;
  color: rgba(255,255,255,.5);
  pointer-events: none;
  transition: color var(--pb-ease);
}
.pb-search-box:focus-within .pb-search-icon { color: rgba(255,255,255,.85); }

.pb-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--s-f-c2);
  font-family: var(--pb-font-body);
  font-size: 14px;
  padding: 13px 12px !important;
  caret-color: var(--s-primary);
}
.pb-search-input::placeholder                  { color: rgba(255,255,255,.38); }
.pb-search-input::-webkit-search-cancel-button { display: none; }

.pb-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border: none;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--pb-ease), color var(--pb-ease);
}
.pb-search-clear:hover { background: rgba(255,255,255,.2); color: var(--s-f-c2); }

.pb-search-status {
  margin-top: 7px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pb-search-status.is-error { color: #fca5a5; }

.pb-search-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(255,255,255,.22);
  border-top-color: var(--s-f-c2);
  border-radius: 50%;
  animation: pb-spin .65s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   PRODUCTS BODY + GRID
   ============================================================ */
.pb-products-body { padding: 0 24px; }

.pb-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* ---- Product card ---- */
.pb-product-card {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--pb-ease), box-shadow var(--pb-ease), transform var(--pb-ease);
  position: relative;
}
.pb-product-card:hover {
  border-color: var(--pb-border-md);
  box-shadow: var(--pb-shadow-md);
  transform: translateY(-2px);
}
.pb-product-card.is-selected {
  border-color: var(--s-primary);
  box-shadow: 0 0 0 3px var(--pb-accent-ring);
}

/* Selected badge — orange */
.pb-product-card.is-selected::before {
  content: '✓ Selected';
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--s-primary);
  color: var(--s-f-c2);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: .04em;
  text-transform: uppercase;
  z-index: 2;
}

/* Thumbnail */
.pb-product-link { text-decoration: none; color: inherit; display: block; }

.pb-product-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--s-b-bg);
}
.pb-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
  display: block;
}
.pb-product-card:hover .pb-product-thumb img { transform: scale(1.04); }

.pb-product-thumb-placeholder {
  aspect-ratio: 4 / 3;
  background: var(--s-b-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pb-text3);
  font-size: 36px;
}

/* Card body */
.pb-product-body {
  padding: 14px 16px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pb-product-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pb-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  transition: color var(--pb-ease);
}
.pb-product-card:hover .pb-product-title { color: var(--s-secondary); } /* blue on hover */

.pb-product-price {
  font-family: var(--pb-font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--s-primary);            /* orange price */
  margin-top: 2px;
}
.pb-product-price .woocommerce-Price-amount { color: var(--s-primary); }
.pb-product-price del                       { opacity: .5; }
.pb-product-price del .woocommerce-Price-amount {
  color: var(--pb-text3);
  font-size: 12.5px;
  font-weight: 500;
}

/* CTA — primary orange */
.pb-product-cta { padding: 10px 14px 14px; }
.pb-choose-product-btn {
  width: 100%;
  background: var(--s-primary);
  border: none;
  color: var(--s-f-c2);
  border-radius: var(--pb-radius-sm);
  padding: 10px;
  font-family: var(--pb-font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--pb-ease);
  letter-spacing: .01em;
}
.pb-choose-product-btn:hover  { background: var(--s-primary-dark); }
.pb-choose-product-btn:active { transform: scale(.98); }

/* Already selected state — muted */
.pb-product-card.is-selected .pb-choose-product-btn {
  background: var(--s-b-bg);
  color: var(--s-primary);
  border: 1px solid rgba(239,74,35,.25);
}

/* Empty state */
.pb-no-products {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--pb-text2);
  font-size: 15px;
  background: var(--pb-surface);
  border: 1.5px dashed var(--pb-border-md);
  border-radius: var(--pb-radius);
  line-height: 1.7;
}
.pb-no-products strong { color: var(--s-primary); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pb-pagination {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pb-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--pb-radius-sm);
  border: 1px solid var(--pb-border);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--pb-text2);
  background: var(--pb-surface);
  transition: all var(--pb-ease);
  box-shadow: var(--pb-shadow-xs);
}
.pb-pagination .page-numbers:hover {
  border-color: var(--s-secondary);   /* blue border on hover */
  color: var(--s-secondary);
  background: var(--pb-secondary-pale);
  text-decoration: none;
}
.pb-pagination .page-numbers.current {
  background: var(--s-primary);       /* orange active page */
  border-color: var(--s-primary);
  color: var(--s-f-c2);
  font-weight: 700;
  box-shadow: none;
}

/* ============================================================
   DESIGN IMPROVEMENTS — Small refinements
   ============================================================ */

/* Qty controls: slightly larger touch targets */
.pb-qty-btn {
  width: 32px;
  height: 34px;
}
.pb-qty-input {
  width: 38px;
  height: 34px;
}

/* Selected product card — green check icon enhancement */
.pb-product-card.is-selected .pb-product-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(239,74,35,.06);
  pointer-events: none;
}
.pb-product-thumb { position: relative; }

/* pb-head actions: show text labels on all sizes >= 640px */
@media (min-width: 641px) {
  .pb-action span { display: inline; }
}

/* Improve back-link chevron spacing on products page */
.pb-back-link { gap: 6px; }

/* Products-body consistent side gutter at all breakpoints */
@media (min-width: 1025px) {
  .pb-products-body { padding: 0 36px; }
}

/* Component row: smooth highlight transition when product is added */
.pb-component-row {
  transition: background var(--pb-ease), box-shadow var(--pb-ease);
}
.pb-component-row.has-product {
  box-shadow: inset 3px 0 0 var(--s-primary);
}
/* Remove the ::before bar since we now use inset box-shadow (cleaner) */
.pb-component-row.has-product::before,
.pb-component-row.is-required-missing::before {
  display: none;
}
.pb-component-row.is-required-missing {
  box-shadow: inset 3px 0 0 var(--pb-danger);
}

/* Total price: pop animation on change */
@keyframes pb-price-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); color: var(--s-primary-dark); }
  100% { transform: scale(1); }
}
.pb-total-price.is-animating { animation: pb-price-pop .3s ease; }

/* Product card image: consistent aspect ratio enforcement */
.pb-product-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: block;
  background: var(--s-b-bg);
}

/* Improve search bar padding consistency */
.pb-search-input {
  padding: 13px 10px 13px 0 !important;
}

/* Mobile: pb-page-wrap reduce padding */
@media (max-width: 480px) {
  .pb-page-wrap { padding: 8px 0 48px; }
}


.pb-component-row { animation: pb-row-in .25s ease both; }
.pb-component-row:nth-child(1)   { animation-delay: .03s; }
.pb-component-row:nth-child(2)   { animation-delay: .06s; }
.pb-component-row:nth-child(3)   { animation-delay: .09s; }
.pb-component-row:nth-child(4)   { animation-delay: .12s; }
.pb-component-row:nth-child(5)   { animation-delay: .15s; }
.pb-component-row:nth-child(6)   { animation-delay: .18s; }
.pb-component-row:nth-child(7)   { animation-delay: .21s; }
.pb-component-row:nth-child(8)   { animation-delay: .24s; }
.pb-component-row:nth-child(n+9) { animation-delay: .26s; }

@keyframes pb-row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

.pb-product-card { animation: pb-card-in .25s ease both; }
.pb-product-card:nth-child(1)   { animation-delay: .04s; }
.pb-product-card:nth-child(2)   { animation-delay: .08s; }
.pb-product-card:nth-child(3)   { animation-delay: .12s; }
.pb-product-card:nth-child(4)   { animation-delay: .16s; }
.pb-product-card:nth-child(5)   { animation-delay: .20s; }
.pb-product-card:nth-child(6)   { animation-delay: .24s; }
.pb-product-card:nth-child(n+7) { animation-delay: .27s; }

@keyframes pb-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.pb-card-animate { animation: pb-card-in .25s ease both; }

/* ============================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .pb-products-grid { grid-template-columns: repeat(3, 1fr); }
  .pb-table-head,
  .pb-component-row {
    grid-template-columns: 56px 1fr 120px 90px 120px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .pb-head,
  .pb-top-bar         { padding-left: 20px; padding-right: 20px; }
  .pb-products-header { padding: 28px 28px 24px; }
  .pb-products-body   { padding: 0 16px; }
  .pb-products-title  { font-size: 26px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  .pb-page-wrap { padding: 12px 0 60px; }

  .pb-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 16px;
  }
  .pb-logo    { display: flex; justify-content: center; }
  .pb-actions { gap: 5px; }
  .pb-action  {
    flex: 1;
    justify-content: center;
    padding: 9px 8px;
    font-size: 12px;
    min-width: 44px;
    min-height: 44px;
  }
  .pb-action span { display: none; }
  .pb-action .pb-action-icon { width: 18px; height: 18px; }

  .pb-top-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
  }
  .pb-total-price { font-size: 22px; }

  .pb-table-head { display: none; }

  .pb-component-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
  }
  .pb-component-row > *    { padding: 0; }
  .pb-component-icon       { width: 44px; height: 44px; flex-shrink: 0; }
  .pb-component-info       { flex: 1; min-width: 0; }
  .pb-comp-product-name    { max-width: 100%; }
  .pb-component-price      { margin-left: auto; font-size: 14px; align-self: center; }
  .pb-component-qty {
    order: 10;
    width: 100%;
    justify-content: flex-start;
    padding-top: 6px;
    border-top: 1px solid var(--pb-border);
    margin-top: 4px;
  }
  .pb-component-actions {
    order: 11;
    width: 100%;
    justify-content: stretch;
    padding-top: 8px;
    border-top: 1px solid var(--pb-border);
  }
  .pb-act-group  { width: 100%; gap: 6px; }
  .pb-choose-btn,
  .pb-remove-btn { flex: 1; justify-content: center; }

  .pb-products-page   { padding-bottom: 48px; }
  .pb-products-header { padding: 22px 16px 18px; margin-bottom: 20px; }
  .pb-products-body   { padding: 0 12px; }
  .pb-products-title  { font-size: 22px; }
  .pb-products-grid   { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pb-search-input    { font-size: 14px; padding: 11px 10px; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .pb-products-grid      { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pb-product-body       { padding: 10px 12px 4px; }
  .pb-product-title      { font-size: 12.5px; }
  .pb-product-price      { font-size: 15px; }
  .pb-product-cta        { padding: 8px 10px 10px; }
  .pb-choose-product-btn { padding: 9px; font-size: 12px; }
  .pb-total-price        { font-size: 20px; }
  .pb-products-title     { font-size: 20px; }
  .pb-action             { font-size: 11px; padding: 7px 4px; }
  .pb-products-header    { padding: 18px 14px 16px; }
  .pb-pagination .page-numbers { min-width: 34px; height: 34px; font-size: 12px; }
}