/* Penshelf Smart Bundles frontend — v2.5.1 */
.psb-builder{--psb-border:#e3e6ea;--psb-muted:#667085;--psb-soft:#f7f8fa;--psb-text:#1f2937;--psb-success:#168a50;--psb-radius:12px;margin:18px 0 22px;color:var(--psb-text);font-family:inherit}
.psb-builder *{box-sizing:border-box}
.psb-shortcode-builder{width:100%;max-width:1320px;margin:0 auto}

.psb-heading{margin:0 0 12px}
.psb-kicker{display:block;margin-bottom:3px;font-size:10px;font-weight:700;letter-spacing:.11em;text-transform:uppercase;color:var(--psb-muted)}
.psb-heading h2{margin:0 0 4px;font-size:clamp(22px,2.2vw,29px);line-height:1.15}
.psb-heading p{margin:0;max-width:760px;font-size:14px;color:var(--psb-muted)}
.psb-note{margin:10px 0;padding:10px 12px;border:1px solid var(--psb-border);border-radius:9px;background:var(--psb-soft);font-size:13px}

/* Suggested entry points + category chips */
.psb-suggestions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:0 0 10px;padding:8px 10px;border:1px solid var(--psb-border);border-radius:10px;background:#fff}
.psb-suggestions>span{font-size:10px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--psb-muted);margin-right:1px}
.psb-suggestion-chip,.psb-cat{appearance:none;border:1px solid #d5d9df;border-radius:999px;background:#fff;padding:6px 10px;font:inherit;font-size:11px;line-height:1.1;cursor:pointer;transition:.16s ease}
.psb-suggestion-chip:hover,.psb-suggestion-chip:focus-visible,.psb-cat:hover,.psb-cat.is-active{border-color:#111827;background:#111827;color:#fff}
.psb-categories{display:flex;gap:6px;flex-wrap:wrap}

/* Compact toolbar: search stays visible, detailed filters collapse */
.psb-toolbar{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.psb-toolbar-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.psb-search{display:block;min-width:0}
.psb-search input{width:100%;min-height:40px;margin:0;padding:8px 12px;border:1px solid #d0d5dd;border-radius:9px;background:#fff;font:inherit;font-size:13px}
.psb-filter-toggle{min-height:40px!important;margin:0!important;padding:7px 12px!important;border-radius:9px!important;white-space:nowrap}
.psb-filter-icon{font-size:11px;margin-right:3px}
.psb-filter-row{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;align-items:end;padding:10px;border:1px solid var(--psb-border);border-radius:10px;background:var(--psb-soft)}
.psb-filter-row[hidden]{display:none!important}
.psb-filter-row label{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:10px;font-weight:600;color:var(--psb-muted)}
.psb-filter-row select,.psb-filter-row input{width:100%;min-height:34px;margin:0;border:1px solid #d0d5dd;border-radius:7px;background:#fff;padding:5px 7px;color:#111827;font:inherit;font-size:12px}
.psb-stock-filter{flex-direction:row!important;align-items:center!important;gap:6px!important;padding-bottom:7px}
.psb-stock-filter input{width:auto!important;min-height:auto!important}

.psb-stepper{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:7px;margin:0 0 11px}
.psb-step-button{display:flex;gap:7px;align-items:center;text-align:left;border:1px solid var(--psb-border);border-radius:9px;background:#fff;padding:8px;cursor:pointer}
.psb-step-button>span{display:grid;place-items:center;width:23px;height:23px;border-radius:50%;background:#f0f2f4;font-size:11px;font-weight:700}
.psb-step-button strong{font-size:11px}.psb-step-button.is-active{border-color:#111827;box-shadow:0 0 0 1px #111827 inset}.psb-step-button.is-active>span{background:#111827;color:#fff}

/* Main workspace follows current bundle-builder patterns: dense grid + live sticky summary. */
.psb-workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:16px;align-items:start}
.psb-catalog{min-width:0}
.psb-catalog-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:0 0 8px}
.psb-catalog-head>div{display:flex;align-items:baseline;gap:8px;min-width:0}
.psb-catalog-head strong{font-size:13px}.psb-catalog-head span,.psb-catalog-head small{font-size:10px;color:var(--psb-muted)}
.psb-product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.psb-loading,.psb-no-products{grid-column:1/-1;padding:28px 16px;text-align:center;border:1px dashed #ccd1d8;border-radius:10px;color:var(--psb-muted);background:#fff;font-size:13px}

.psb-product-card{position:relative;min-width:0;border:1px solid var(--psb-border);border-radius:10px;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.03);transition:border-color .16s,box-shadow .16s,transform .16s;cursor:grab}
.psb-product-card:hover,.psb-product-card:focus-within{border-color:#b7bec8;box-shadow:0 5px 16px rgba(16,24,40,.08);transform:translateY(-1px)}
.psb-product-card.is-dragging{opacity:.55;transform:scale(.985)}
.psb-card-image{position:relative;height:132px;background:#fafafa;overflow:hidden}
.psb-card-image img{width:100%;height:100%;display:block;object-fit:contain;padding:6px}
.psb-stock-badge{position:absolute;left:6px;bottom:6px;padding:3px 6px;border-radius:999px;background:rgba(255,255,255,.94);font-size:9px;font-weight:700;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.psb-stock-badge.is-out{opacity:.72}
.psb-card-body{padding:8px 9px 9px}
.psb-card-body h4{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0 0 3px;min-height:32px;font-size:12px;line-height:1.32}
.psb-sku{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px;font-size:9px;color:var(--psb-muted)}
.psb-card-price{margin:3px 0 6px;font-size:12px;font-weight:700;line-height:1.25}
.psb-item-discount{display:inline-block;margin-bottom:6px;padding:2px 5px;border-radius:5px;background:#f1f3f5;font-size:9px;font-weight:700}
.psb-discount-exempt{display:flex;align-items:flex-start;gap:4px;margin:0 0 6px;padding:4px 6px;border:1px solid #efd8b2;border-radius:6px;background:#fff9ef;color:#7b4a00;font-size:9px;font-weight:600;line-height:1.25}
.psb-discount-exempt::before{content:'ⓘ';flex:0 0 auto;font-size:10px;line-height:1.1}
.psb-selected-exempt{display:flex;align-items:flex-start;gap:3px;margin-top:3px;color:#7b4a00;font-size:8px;font-weight:600;line-height:1.25}
.psb-selected-exempt::before{content:'ⓘ';flex:0 0 auto;font-size:8px;line-height:1.15}
.psb-modal-exempt-note{display:flex;align-items:flex-start;gap:5px;margin:7px 0 10px;padding:6px 8px;border:1px solid #efd8b2;border-radius:7px;background:#fff9ef;color:#7b4a00;font-size:11px;font-weight:600;line-height:1.3}
.psb-modal-exempt-note::before{content:'ⓘ';flex:0 0 auto;font-size:12px;line-height:1.1}
.psb-card-actions{display:grid;grid-template-columns:1fr 1.2fr;gap:5px}
.psb-card-actions .button{width:100%;min-height:31px;margin:0!important;padding:4px 5px!important;font-size:9.5px!important;line-height:1.15!important;white-space:normal}
.psb-load-more{margin-top:10px!important;min-height:34px}
.psb-step-nav{display:flex;justify-content:space-between;gap:8px;margin-top:10px}

/* Sticky live summary */
.psb-tray-wrap{position:sticky;top:82px}
.psb-tray-card{border:1px solid #d8dde4;border-radius:13px;background:#fff;padding:12px;box-shadow:0 6px 20px rgba(16,24,40,.07)}
.psb-tray-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.psb-tray-head h3{margin:0;font-size:17px;line-height:1.18}
.psb-step-label{display:block;margin-bottom:2px;font-size:9px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--psb-muted)}
.psb-count{white-space:nowrap;font-size:12px}
/* Reward ladder: compact milestone progress for configured tier discounts. */
.psb-reward-progress{margin:9px 0 5px;padding:7px 8px 8px;border:1px solid #e6e9ed;border-radius:9px;background:#fafbfc}
.psb-reward-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:15px}
.psb-reward-head>span{font-size:8.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--psb-muted);white-space:nowrap}
.psb-reward-head>strong{font-size:9px;line-height:1.25;text-align:right;color:var(--psb-text)}
.psb-progress{position:relative;height:4px;margin:10px 4px 28px;background:#e5e9ee;border-radius:999px;overflow:visible}
.psb-progress>#psb-progress-bar{position:absolute;left:0;top:0;display:block;width:0;height:100%;border-radius:inherit;background:currentColor;transition:width .22s ease}
.psb-tier-markers{position:absolute;inset:0;pointer-events:none}
.psb-tier-marker{position:absolute;top:50%;display:block;width:0;height:0;transform:translate(-50%,-50%)}
.psb-tier-dot{position:absolute;left:0;top:0;display:grid;place-items:center;width:12px;height:12px;transform:translate(-50%,-50%);border:2px solid #c7cdd5;border-radius:50%;background:#fff;color:#fff;font-size:7px;font-weight:800;line-height:1;transition:.18s ease}
.psb-tier-marker.is-achieved .psb-tier-dot{border-color:var(--psb-success);background:var(--psb-success);color:#fff;box-shadow:0 0 0 2px #fff,0 0 0 3px rgba(22,138,80,.14)}
.psb-tier-marker-label{position:absolute;top:8px;left:0;display:block;width:54px;transform:translateX(-50%);text-align:center;white-space:nowrap;color:var(--psb-muted)}
.psb-tier-marker-label strong,.psb-tier-marker-label small{display:block;font-weight:600;line-height:1.12}
.psb-tier-marker-label strong{font-size:7.5px}.psb-tier-marker-label small{margin-top:1px;font-size:8px}
.psb-tier-marker.is-achieved .psb-tier-marker-label{color:var(--psb-text)}
.psb-tier-marker.is-last .psb-tier-marker-label{transform:translateX(-100%);text-align:right}
.psb-tier-marker.is-first[style*="left:0%"] .psb-tier-marker-label{transform:none;text-align:left}
.psb-reward-progress.no-tiers{padding:0;border:0;background:transparent}
.psb-reward-progress.no-tiers .psb-reward-head{display:none}
.psb-reward-progress.no-tiers .psb-progress{margin:9px 0 5px;overflow:hidden}
.psb-reward-progress.no-tiers .psb-tier-markers{display:none}
.psb-progress-copy{margin:0 0 7px;font-size:10px;line-height:1.35;color:var(--psb-muted)}
.psb-category-status{display:flex;flex-direction:column;gap:2px;margin-bottom:5px;font-size:10px}

.psb-dropzone{min-height:116px;padding:6px;border:1.25px dashed #cbd1d9;border-radius:10px;background:#fbfcfd;transition:.16s ease}
.psb-dropzone.is-over{border-color:#111827;background:#f5f6f7;transform:scale(1.003)}
.psb-empty{min-height:90px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:2px;color:var(--psb-muted);font-size:11px}
.psb-drop-icon{font-size:20px;line-height:1}.psb-empty small{font-size:9px}
.psb-empty-slot,.psb-additional-slot{width:100%;min-height:48px;display:grid;grid-template-columns:27px minmax(0,1fr);grid-template-rows:auto auto;column-gap:8px;align-items:center;text-align:left;padding:7px 8px;margin:0 0 5px;border:1.25px dashed #cbd1d9;border-radius:8px;background:#fff;color:var(--psb-muted);cursor:pointer}
.psb-empty-slot>span,.psb-additional-slot>span{grid-row:1/3;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#f0f2f4;color:#111827;font-size:16px;font-weight:500}
.psb-empty-slot strong,.psb-additional-slot strong{font-size:10.5px;line-height:1.15;color:var(--psb-text)}
.psb-empty-slot small,.psb-additional-slot small{font-size:8.5px;line-height:1.15}
.psb-empty-slot:hover,.psb-additional-slot:hover{border-color:#111827;background:#fafafa}
.psb-additional-slot{border-style:solid;background:var(--psb-soft)}

.psb-selected-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto 18px;gap:6px;align-items:center;padding:6px 0;border-bottom:1px solid #edf0f2}
.psb-selected-item:last-child{border-bottom:0}
.psb-selected-item img{width:34px;height:34px;object-fit:contain;border-radius:6px;background:#fff}
.psb-drag-handle{display:none}
.psb-selected-info{min-width:0}.psb-selected-info strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10.5px;line-height:1.25}.psb-selected-info span{font-size:10px;font-weight:700}
.psb-qty{display:flex;align-items:center;border:1px solid #d1d5db;border-radius:7px;overflow:hidden;background:#fff}
.psb-qty button{appearance:none;width:22px;height:24px;padding:0;border:0;background:#fff;cursor:pointer;font-size:12px}.psb-qty button:hover{background:#f3f4f6}.psb-qty span{min-width:17px;text-align:center;font-size:10px}
.psb-remove{appearance:none;border:0;background:transparent;font-size:17px;line-height:1;color:#667085;cursor:pointer;padding:0}.psb-remove:hover{color:#111827}
.psb-reset{display:block;margin:6px auto 0!important;padding:2px 4px!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#667085!important;font-size:9.5px!important;text-decoration:underline;text-underline-offset:2px}

.psb-summary{margin-top:8px;padding-top:7px;border-top:1px solid #edf0f2}
.psb-summary>div{display:flex;justify-content:space-between;gap:12px;padding:2px 0;font-size:11px}
.psb-summary .psb-total{margin-top:4px;padding-top:7px;border-top:1px solid #edf0f2;font-size:14px}
.psb-summary [hidden]{display:none!important}
.psb-tier-badge{display:inline-flex;margin-top:6px;padding:4px 7px;border-radius:999px;background:#f3f4f6;font-size:10px;font-weight:700}
.psb-tray-cta{width:100%!important;min-height:38px!important;margin:9px 0 0!important;font-size:11px!important}
.psb-cart-form>.psb-add-bundle{display:none}
.psb-mobile-bar{display:none}
.psb-included-price{font-size:11px;font-weight:600;color:#667085}.psb-child-prefix{opacity:.55}.psb-edit-link,.psb-cart-bundle-ref{display:block;margin-top:3px;font-size:10px;font-weight:400}.psb-cart-bundle-ref{color:#667085}

/* Modal remains intentionally larger than cards for inspecting variations/details. */
.psb-modal-backdrop{position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(17,24,39,.56)}
.psb-modal{position:relative;width:min(650px,100%);max-height:84vh;overflow:auto;padding:18px;border-radius:14px;background:#fff;box-shadow:0 24px 70px rgba(0,0,0,.25)}
.psb-modal-close{position:absolute;top:7px;right:10px;z-index:2;appearance:none;border:0;background:transparent;font-size:26px;line-height:1;cursor:pointer}
.psb-modal-grid{display:grid;grid-template-columns:190px minmax(0,1fr);gap:18px}.psb-modal-image{aspect-ratio:1/1;border-radius:10px;background:#fafafa;overflow:hidden}.psb-modal-image img{width:100%;height:100%;object-fit:contain}.psb-modal-content h3{margin:0 30px 6px 0}.psb-modal-price{font-weight:700;margin-bottom:7px}.psb-modal-desc{font-size:12px;color:#4b5563}.psb-choose-label{font-weight:700}.psb-var-option{display:flex;width:100%;justify-content:space-between;gap:12px;text-align:left;border:1px solid #d1d5db;border-radius:8px;background:#fff;padding:8px;margin:0 0 6px;cursor:pointer}.psb-var-option:hover{border-color:#111827}.psb-modal-add{margin-top:7px}

.psb-builder button:focus-visible,.psb-builder input:focus-visible,.psb-builder select:focus-visible,.psb-modal button:focus-visible{outline:2px solid currentColor;outline-offset:2px}

@media(max-width:1180px){
  .psb-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .psb-workspace{grid-template-columns:minmax(0,1fr) 300px}
  .psb-filter-row{grid-template-columns:repeat(3,minmax(120px,1fr))}
}
@media(max-width:900px){
  .psb-workspace{grid-template-columns:1fr}.psb-tray-wrap{position:static}.psb-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .psb-mobile-bar{position:sticky;bottom:0;z-index:99;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px -4px 0;padding:8px 10px;border:1px solid #d9dde3;border-radius:10px;background:#fff;box-shadow:0 -5px 18px rgba(17,24,39,.08)}.psb-mobile-bar strong,.psb-mobile-bar span{display:block}.psb-mobile-bar span{font-size:10px;color:var(--psb-muted)}
}
@media(max-width:680px){
  .psb-heading h2{font-size:23px}.psb-heading p{font-size:13px}.psb-toolbar-main{grid-template-columns:1fr auto}.psb-filter-row{grid-template-columns:1fr 1fr}
  .psb-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.psb-card-image{height:120px}.psb-card-body{padding:7px}.psb-card-actions{grid-template-columns:1fr}.psb-catalog-head>div span{display:none}
  .psb-suggestions,.psb-categories{flex-wrap:nowrap;overflow:auto;padding-bottom:5px}.psb-suggestions>span,.psb-suggestion-chip,.psb-cat{flex:0 0 auto}
  .psb-modal{padding:15px}.psb-modal-grid{grid-template-columns:1fr}.psb-modal-image{max-height:220px}
}
@media(max-width:430px){
  .psb-builder{margin-top:14px}.psb-toolbar-main{grid-template-columns:1fr}.psb-filter-toggle{width:100%}.psb-filter-row{grid-template-columns:1fr}.psb-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.psb-card-image{height:105px}.psb-card-body h4{font-size:11px;min-height:30px}.psb-card-actions .button{min-height:30px}.psb-tray-card{padding:11px}
}


/* v2.5 reward visibility: keep the incentive readable inside the compact tray. */
.psb-reward-progress.has-tiers{display:block!important;border-color:#d7dde5;background:#fbfcfe}
.psb-reward-progress.has-tiers .psb-progress{margin-top:11px}
.psb-reward-progress.has-tiers .psb-reward-head>strong{font-weight:700}
#psb-saving-row:not([hidden]) strong{font-weight:800}
