/* ── Layout: Premium container card + balanced two columns ── */
.itswb-pb-wrap {
	display: grid;
	grid-template-columns: 1.7fr 1fr;
	gap: 28px;
	align-items: start;
	max-width: 1080px;
	margin: 20px auto;
	padding: 32px;
	background: #ffffff;
	border: 1px solid #eaeef3;
	border-radius: 24px;
	box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05), 0 0 1px rgba(0, 0, 0, 0.1);
}
.itswb-pb-main { min-width: 0; }

.itswb-pb-heading {
	font-size: 24px;
	font-weight: 600;
	color: #1f2937;
	margin: 0 0 8px;
	line-height: 1.2;
}
.itswb-pb-heading:last-child {
	margin-bottom: 24px;
}
.itswb-pb-note {
	font-size: 14px;
	color: #6b7280;
	margin: 0 0 24px;
	line-height: 1.5;
}

/* ── Tier progress bar ── */
.itswb-pb-progress {
	margin: 0 0 18px;
	padding: 14px 16px;
	background: var(--itswb-secondary-tint, rgba(224,168,46,.1));
	border: 1px solid rgba(224,168,46,.18);
	border-radius: 12px;
}
.itswb-pb-progress-unlocked {
	font-size: 13px;
	font-weight: 600;
	color: var(--itswb-secondary-dark, #a06f12);
	margin-bottom: 8px;
}
.itswb-pb-progress-text {
	font-size: 13px;
	font-weight: 500;
	color: #4b5563;
	margin-bottom: 10px;
	line-height: 1.4;
}
.itswb-pb-progress-track {
	height: 8px;
	background: rgba(255,255,255,.7);
	border-radius: 999px;
	overflow: hidden;
	border: 1px solid rgba(224,168,46,.12);
}
.itswb-pb-progress-fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--itswb-secondary, #E0A82E), var(--itswb-primary, #4F46B8));
	border-radius: 999px;
	transition: width .25s ease;
}

/* ── Toolbar: search + category tabs ── */
.itswb-pb-toolbar {
	display: grid;
	gap: 12px;
	margin-bottom: 16px;
}
.itswb-pb-search-wrap {
	width: 100%;
}
.itswb-pb-search {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	font-size: 14px;
	background: #fff;
	color: #111827;
}
.itswb-pb-search:focus {
	outline: none;
	border-color: var(--itswb-primary, #4F46B8);
	box-shadow: 0 0 0 3px var(--itswb-primary-tint, rgba(79,70,184,.12));
}
.itswb-pb-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.itswb-pb-tab {
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #4b5563;
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all .15s ease;
}
.itswb-pb-tab:hover {
	border-color: var(--itswb-primary, #4F46B8);
	color: var(--itswb-primary, #4F46B8);
}
.itswb-pb-tab.is-active {
	background: var(--itswb-primary, #4F46B8);
	border-color: var(--itswb-primary, #4F46B8);
	color: var(--itswb-on-primary, #fff);
}

/* ── Selected products strip ── */
.itswb-pb-selected-strip {
	margin-bottom: 16px;
	padding: 12px;
	background: #f9fafb;
	border: 1px solid #eef2f6;
	border-radius: 12px;
}
.itswb-pb-selected-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: #6b7280;
	margin-bottom: 10px;
}
.itswb-pb-selected-items {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 2px;
}
.itswb-pb-selected-item {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 6px 10px 6px 6px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	max-width: 220px;
}
.itswb-pb-selected-item img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}
.itswb-pb-selected-name {
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 120px;
}
.itswb-pb-selected-remove {
	font-size: 16px;
	line-height: 1;
	color: #9ca3af;
}

.itswb-pb-filter-empty {
	text-align: center;
	color: #9ca3af;
	padding: 24px 0 8px;
	margin: 0;
}
.itswb-pb-restore-notice {
	margin: 0 0 16px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 500;
	color: #047857;
	background: rgba(16, 185, 129, 0.08);
	border: 1px solid rgba(16, 185, 129, 0.15);
	border-radius: 10px;
}
.itswb-pb-restore-notice[hidden] {
	display: none !important;
}

/* ── Tier overview table ── */
.itswb-pb-tier-table-wrap {
	margin: 0 0 18px;
	padding: 14px 16px;
	background: #f9fafb;
	border: 1px solid #eef2f6;
	border-radius: 12px;
}
.itswb-pb-tier-table-title {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: #6b7280;
	margin-bottom: 10px;
}
.itswb-pb-tier-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.itswb-pb-tier-table th,
.itswb-pb-tier-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
}
.itswb-pb-tier-table th {
	color: #6b7280;
	font-weight: 600;
}
.itswb-pb-tier-table td:last-child {
	font-weight: 600;
	color: var(--itswb-secondary-dark, #a06f12);
}
.itswb-pb-tier-table tr:last-child td {
	border-bottom: none;
}

/* ── Qty badge + controls ── */
.itswb-pb-qty-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--itswb-primary, #4F46B8);
	color: var(--itswb-on-primary, #fff);
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 6;
	box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.itswb-pb-qty-badge[hidden] {
	display: none !important;
}
.itswb-pb-card-qty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 8px;
}
.itswb-pb-card-qty[hidden] {
	display: none !important;
}
.itswb-pb-qty-minus,
.itswb-pb-qty-plus {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #374151;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.itswb-pb-qty-minus:hover,
.itswb-pb-qty-plus:hover {
	border-color: var(--itswb-primary, #4F46B8);
	color: var(--itswb-primary, #4F46B8);
}
.itswb-pb-qty-val {
	min-width: 18px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
}
.itswb-pb-card.is-variable {
	cursor: pointer;
}
.itswb-pb-card.is-variable .itswb-pb-card-check {
	display: none;
}

/* ── Load more ── */
.itswb-pb-load-more-wrap {
	margin-top: 14px;
	text-align: center;
}
.itswb-pb-load-more-wrap[hidden] {
	display: none !important;
}
.itswb-pb-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 180px;
	padding: 10px 18px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #374151;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.itswb-pb-load-more:hover {
	border-color: var(--itswb-primary, #4F46B8);
	color: var(--itswb-primary, #4F46B8);
}
.itswb-pb-load-more:disabled {
	opacity: .6;
	cursor: wait;
}

/* ── Quick View variations ── */
.itswb-pb-qv-variations {
	margin-bottom: 16px;
}
.itswb-pb-qv-variations label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #374151;
}
.itswb-pb-variation-select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
}

/* ── Product grid: admin-controlled columns + optional scroll ── */
.itswb-pb-grid {
	display: grid;
	grid-template-columns: repeat(var(--itswb-pb-cols-desktop, 4), minmax(0, 1fr));
	gap: 16px;
}
.itswb-pb-grid.is-scrollable.is-height-max {
	max-height: var(--itswb-pb-grid-height, 480px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
	padding-right: 4px;
}
.itswb-pb-grid.is-scrollable.is-height-fixed {
	height: var(--itswb-pb-grid-height, 480px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
	padding-right: 4px;
}
.itswb-pb-grid.is-scrollable::-webkit-scrollbar {
	width: 6px;
}
.itswb-pb-grid.is-scrollable::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 999px;
}
.itswb-pb-grid.is-scrollable::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}
.itswb-pb-card {
	position: relative;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	cursor: pointer;
	transition: transform .18s cubic-bezier(0.16, 1, 0.3, 1), border-color .18s ease, box-shadow .18s ease;
}
.itswb-pb-card:hover {
	transform: translateY(-4px);
	border-color: var(--itswb-primary, #4F46B8);
	box-shadow: 0 8px 24px rgba(79, 70, 184, 0.08);
}
.itswb-pb-card.is-selected {
	border-color: var(--itswb-primary, #4F46B8);
	background: var(--itswb-primary-tint, rgba(79, 70, 184, 0.06));
	box-shadow: 0 0 0 1px var(--itswb-primary, #4F46B8) inset, 0 4px 12px rgba(79, 70, 184, 0.04);
}

/* square, uniform images */
.itswb-pb-card-img {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f9fafb;
	border-radius: 11px 11px 0 0;
}
.itswb-pb-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.itswb-pb-card-info {
	padding: 10px 12px;
}
.itswb-pb-card-title {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	color: #374151;
	height: 36px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	margin-bottom: 4px;
}
.itswb-pb-card-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--itswb-primary, #4F46B8);
	margin-top: 2px;
}
.itswb-pb-card.is-selected .itswb-pb-card-price {
	filter: brightness(.85);
}

/* check badge — clear when selected */
.itswb-pb-card-check {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--itswb-secondary, #E0A82E);
	color: var(--itswb-on-secondary, #1a1a1a);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	line-height: 1;
	opacity: 0;
	transform: scale(.5);
	transition: opacity .18s cubic-bezier(0.16, 1, 0.3, 1), transform .18s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	z-index: 5;
}
.itswb-pb-card.is-selected .itswb-pb-card-check {
	opacity: 1;
	transform: scale(1);
}

/* ── Summary: compact, sticky, strong hierarchy ── */
.itswb-pb-summary {
	position: sticky;
	top: 24px;
	background: #f9fafb;
	border: 1px solid #eef2f6;
	border-radius: 16px;
	padding: 22px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.01);
}
.itswb-pb-summary-title {
	font-size: 16px;
	font-weight: 600;
	color: #111827;
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 12px;
	margin-bottom: 16px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.itswb-pb-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
	padding: 8px 0;
	color: #4b5563;
}
.itswb-pb-summary-row .itswb-pb-count,
.itswb-pb-summary-row .itswb-pb-subtotal {
	color: #111827;
	font-weight: 600;
}

.itswb-pb-discount-row {
	border-top: 1px dashed #e5e7eb;
	color: var(--itswb-secondary-dark, #a06f12);
	font-weight: 600;
	padding-top: 10px;
	margin-top: 4px;
}
.itswb-pb-discount-row .itswb-pb-discount {
	color: var(--itswb-secondary-dark, #a06f12);
	font-weight: 600;
}

.itswb-pb-total-row {
	border-top: 1px solid #e5e7eb;
	margin-top: 8px;
	padding-top: 14px;
}
.itswb-pb-total-row > span:first-child {
	font-size: 15px;
	font-weight: 600;
	color: #111827;
}
.itswb-pb-total {
	font-size: 24px;
	font-weight: 700;
	color: var(--itswb-primary, #4F46B8);
}

/* tier hint — visible */
.itswb-pb-tier-info {
	display: none;
	font-size: 13px;
	color: var(--itswb-secondary-dark, #a06f12);
	background: var(--itswb-secondary-tint, rgba(224,168,46,.12));
	border-radius: 8px;
	padding: 10px 14px;
	margin: 14px 0 0;
	line-height: 1.4;
	border: 1px solid rgba(224,168,46,.15);
}
.itswb-pb-tier-info.is-visible {
	display: block;
}

/* add button — brand, contrast-safe */
.itswb-pb-add-btn {
	width: 100%;
	margin-top: 16px;
	background: var(--itswb-primary, #4F46B8);
	color: var(--itswb-on-primary, #fff);
	border: none;
	border-radius: 10px;
	padding: 14px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease, transform 0.1s ease;
	box-shadow: 0 4px 12px var(--itswb-primary-tint, rgba(79, 70, 184, 0.15));
}
.itswb-pb-add-btn:hover:not(:disabled) {
	background: var(--itswb-primary-hover, #413a9a);
}
.itswb-pb-add-btn:active:not(:disabled) {
	transform: scale(0.98);
}
.itswb-pb-add-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
	box-shadow: none;
}
.itswb-pb-summary .itswb-pb-summary-add {
	display: block;
}
.itswb-pb-add-btn.is-loading {
	opacity: .7;
	pointer-events: none;
}

.itswb-pb-preview-note {
	display: block;
	text-align: center;
	font-size: 10px;
	color: #9ca3af;
	opacity: 0.85;
	line-height: 1.4;
	margin-top: 16px;
	font-weight: 400;
}

.itswb-pb-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #9ca3af;
	padding: 30px 0;
}

/* ── Responsive ── */
@media (max-width: 960px) {
	.itswb-pb-grid {
		grid-template-columns: repeat(var(--itswb-pb-cols-tablet, 3), minmax(0, 1fr));
	}
}
@media (max-width: 600px) {
	.itswb-pb-grid {
		grid-template-columns: repeat(var(--itswb-pb-cols-mobile, 2), minmax(0, 1fr));
	}
}
@media (max-width: 782px) {
	.itswb-pb-wrap {
		grid-template-columns: 1fr;
		padding: 20px;
		gap: 24px;
	}
	.itswb-pb-wrap.has-mobile-bar {
		padding-bottom: 96px;
	}
	.itswb-pb-summary {
		position: static;
	}
	.itswb-pb-summary .itswb-pb-summary-add {
		display: none;
	}
	.itswb-pb-mobile-bar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99990;
		align-items: center;
		gap: 12px;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		background: rgba(255,255,255,.96);
		border-top: 1px solid #e5e7eb;
		box-shadow: 0 -8px 24px rgba(0,0,0,.08);
		backdrop-filter: blur(8px);
	}
	.itswb-pb-mobile-bar[aria-hidden="true"] {
		display: none;
	}
	.itswb-pb-mobile-meta {
		display: flex;
		flex-direction: column;
		min-width: 42px;
	}
	.itswb-pb-mobile-count {
		font-size: 18px;
		font-weight: 700;
		color: var(--itswb-primary, #4F46B8);
		line-height: 1;
	}
	.itswb-pb-mobile-label {
		font-size: 11px;
		color: #6b7280;
		text-transform: uppercase;
	}
	.itswb-pb-mobile-total-wrap {
		flex: 1;
		min-width: 0;
	}
	.itswb-pb-mobile-total-label {
		display: block;
		font-size: 11px;
		color: #6b7280;
		text-transform: uppercase;
	}
	.itswb-pb-mobile-total {
		font-size: 18px;
		font-weight: 700;
		color: #111827;
	}
	.itswb-pb-mobile-add {
		width: auto;
		min-width: 132px;
		margin: 0;
		padding: 12px 16px;
		white-space: nowrap;
	}
}
@media (min-width: 783px) {
	.itswb-pb-mobile-bar {
		display: none !important;
	}
}

/* ── Quick View Button Trigger ── */
.itswb-pb-card-img {
	position: relative;
}
.itswb-pb-qv-trigger {
	position: absolute;
	bottom: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	box-shadow: 0 4px 10px rgba(0,0,0,0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 13px;
	opacity: 0.9;
	transition: all 0.2s ease;
	z-index: 6;
	padding: 0;
}
.itswb-pb-card:hover .itswb-pb-qv-trigger {
	opacity: 1;
	transform: scale(1.08);
}
.itswb-pb-qv-trigger:hover {
	background: var(--itswb-primary, #4F46B8);
	color: #ffffff;
	border-color: var(--itswb-primary, #4F46B8);
	box-shadow: 0 4px 12px rgba(79,70,184,0.25);
}

/* ── Quick View Modal Shell ── */
.itswb-pb-qv-modal {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.itswb-pb-qv-modal[hidden] {
	display: none !important;
}
.itswb-pb-qv-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(4px);
}
.itswb-pb-qv-panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 820px;
	max-height: 90vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
	padding: 36px 32px;
	border: 1px solid #eef2f6;
}
.itswb-pb-qv-close {
	position: absolute;
	top: 16px;
	right: 18px;
	border: none;
	background: transparent;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	color: #9ca3af;
	transition: color 0.15s ease;
}
.itswb-pb-qv-close:hover {
	color: #1f2937;
}

/* Modal Inner Content Layout */
.itswb-pb-qv-product {
	display: grid;
	grid-template-columns: 1fr 1.1fr;
	gap: 32px;
	align-items: start;
}
.itswb-pb-qv-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid #f1f5f9;
}
.itswb-pb-qv-title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.3;
}
.itswb-pb-qv-price {
	margin-bottom: 16px;
	font-size: 20px;
	font-weight: 700;
	color: var(--itswb-primary, #4F46B8);
}
.itswb-pb-qv-price del {
	color: #9ca3af;
	font-weight: 400;
	font-size: 15px;
	margin-right: 6px;
}
.itswb-pb-qv-price ins {
	text-decoration: none;
}
.itswb-pb-qv-excerpt {
	margin-bottom: 24px;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.6;
}
.itswb-pb-qv-excerpt p {
	margin-bottom: 0;
}
.itswb-pb-qv-actions {
	margin-bottom: 16px;
}
.itswb-pb-qv-select-btn {
	width: auto;
	min-width: 180px;
	padding: 12px 24px;
	margin: 0;
}
.itswb-pb-qv-select-btn.is-active-selected {
	background: #10b981;
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.itswb-pb-qv-select-btn.is-active-selected:hover {
	background: #059669;
}
.itswb-pb-qv-link {
	margin-top: 16px;
	font-size: 13px;
}
.itswb-pb-qv-link a {
	color: var(--itswb-primary, #4F46B8);
	text-decoration: none;
	font-weight: 500;
}
.itswb-pb-qv-link a:hover {
	text-decoration: underline;
}
.itswb-pb-qv-loading {
	text-align: center;
	padding: 60px 0;
	font-size: 15px;
	color: #6b7280;
	font-weight: 500;
}
.itswb-pb-qv-error {
	text-align: center;
	padding: 40px 0;
	color: #dc2626;
	font-weight: 500;
}
body.itswb-pb-qv-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.itswb-pb-qv-product {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.itswb-pb-qv-panel {
		padding: 24px 20px;
	}
}
