/**
 * Optimized Product Bundle - Frontend Styles
 * Layouts: list, grid, table, compact, cards. Boxed / plain.
 */
.opb-bundle-wrapper {
	--opb-cols: 3;
	--opb-img: 80px;
	margin: 1.25rem 0;
}
.opb-box-boxed {
	padding: 1.25rem;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #f7f7f7;
}
.opb-box-plain {
	padding: 0;
	border: 0;
	background: transparent;
}
.opb-bundle-title {
	margin: 0 0 0.75rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid #eee;
	font-size: 1.15em;
	font-weight: 600;
}
.opb-box-plain .opb-bundle-title {
	border-bottom-color: #e5e5e5;
}
.opb-bundle-note {
	margin: 0 0 1rem;
	font-size: 0.95em;
	line-height: 1.6;
	color: #50575e;
}
.opb-bundle-items {
	margin: 0.75rem 0 0;
}
.opb-bundle-item-image img {
	display: block;
	width: var(--opb-img);
	height: var(--opb-img);
	object-fit: cover;
	border-radius: 4px;
}
.opb-bundle-item-title {
	margin: 0 0 4px;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.4;
}
.opb-bundle-item-name {
	text-decoration: none;
}
.opb-excerpt {
	margin: 0 0 6px;
	font-size: 0.85em;
	line-height: 1.5;
	color: #646970;
	font-weight: 400;
}
.opb-bundle-item-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}
.opb-bundle-item-price {
	color: #3c7a32;
	font-weight: 600;
}
.opb-bundle-item-price del {
	opacity: 0.7;
	margin-inline-end: 4px;
	font-weight: 400;
	color: #8c8f94;
}
.opb-bundle-item-price ins {
	text-decoration: none;
}
.opb-bundle-item-quantity {
	font-weight: 500;
	color: #50575e;
}
.opb-optional-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
	cursor: pointer;
}
.opb-stock {
	font-size: 0.8em;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 999px;
	background: #f0f0f1;
	color: #50575e;
}
.opb-stock.in-stock {
	background: #edfaef;
	color: #1e6e2d;
}
.opb-stock.out-of-stock,
.opb-stock.unavailable {
	background: #fcf0f1;
	color: #b32d2e;
}
.opb-stock.available-on-backorder {
	background: #fcf9e8;
	color: #826200;
}
.opb-required {
	font-size: 0.85em;
	color: #8c8f94;
}
.opb-savings-badge {
	display: inline-block;
	margin-inline-start: 4px;
	padding: 2px 9px;
	border-radius: 999px;
	background: #edfaef;
	color: #1e6e2d;
	font-size: 0.75em;
	font-weight: 700;
	vertical-align: middle;
}
.opb-bundle-total {
	margin: 1rem 0 0;
	padding-top: 0.9rem;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-weight: 600;
}
.opb-bundle-total-price {
	font-size: 1.15em;
	color: #1d2327;
}

/* List — Woo Product Bundles / WPC default row */
.opb-layout-list .opb-bundle-items {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.opb-layout-list .opb-bundle-item,
.opb-layout-grid .opb-bundle-item,
.opb-layout-cards .opb-bundle-item,
.opb-layout-compact .opb-bundle-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
}
.opb-layout-list .opb-bundle-item-image {
	flex: 0 0 var(--opb-img);
}
.opb-layout-list .opb-bundle-item-details {
	flex: 1;
	min-width: 0;
}

/* Grid — multi-column cards */
.opb-layout-grid .opb-bundle-items {
	display: grid;
	grid-template-columns: repeat(var(--opb-cols), minmax(0, 1fr));
	gap: 12px;
}
.opb-layout-grid .opb-bundle-item {
	flex-direction: column;
	align-items: stretch;
	text-align: center;
	padding: 14px 12px;
	height: 100%;
}
.opb-layout-grid .opb-bundle-item-image {
	margin: 0 auto 8px;
}
.opb-layout-grid .opb-bundle-item-image img {
	width: calc(var(--opb-img) + 20px);
	height: calc(var(--opb-img) + 20px);
	margin-inline: auto;
}
.opb-layout-grid .opb-bundle-item-meta {
	justify-content: center;
}

/* Cards — large image on top */
.opb-layout-cards .opb-bundle-items {
	display: grid;
	grid-template-columns: repeat(var(--opb-cols), minmax(0, 1fr));
	gap: 16px;
}
.opb-layout-cards .opb-bundle-item {
	flex-direction: column;
	align-items: stretch;
	padding: 0;
	overflow: hidden;
	height: 100%;
}
.opb-layout-cards .opb-bundle-item-image {
	width: 100%;
	margin: 0;
}
.opb-layout-cards .opb-bundle-item-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	border-radius: 0;
}
.opb-layout-cards .opb-bundle-item-details {
	padding: 12px 14px 14px;
}
.opb-layout-cards .opb-bundle-item-meta {
	justify-content: flex-start;
}

/* Compact — dense rows */
.opb-layout-compact .opb-bundle-items {
	display: flex;
	flex-direction: column;
	gap: 0;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	overflow: hidden;
}
.opb-layout-compact .opb-bundle-item {
	padding: 8px 10px;
	gap: 10px;
	border: 0;
	border-bottom: 1px solid #eee;
	border-radius: 0;
	background: transparent;
}
.opb-layout-compact .opb-bundle-item:last-child {
	border-bottom: 0;
}
.opb-layout-compact .opb-bundle-item-image,
.opb-layout-compact .opb-bundle-item-image img {
	width: 44px;
	height: 44px;
	flex-basis: 44px;
}
.opb-layout-compact .opb-bundle-item-title {
	font-size: 0.92em;
	margin: 0;
}
.opb-layout-compact .opb-excerpt {
	display: none;
}
.opb-layout-compact .opb-bundle-item-details {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
}
.opb-layout-compact .opb-bundle-item-meta {
	margin-inline-start: auto;
}

/* Table */
.opb-table-wrap {
	overflow-x: auto;
	margin-top: 0.5rem;
}
.opb-bundle-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}
.opb-box-boxed .opb-bundle-table {
	border: 1px solid #e2e4e7;
	border-radius: 6px;
}
.opb-bundle-table th,
.opb-bundle-table td {
	padding: 10px 8px;
	vertical-align: middle;
	border-bottom: 1px solid #eee;
	text-align: start;
}
.opb-bundle-table thead th {
	font-size: 12px;
	font-weight: 600;
	color: #646970;
	background: #f6f7f7;
}
.opb-bundle-table tbody tr:last-child td {
	border-bottom: 0;
}
.opb-bundle-table .opb-col-image {
	width: calc(var(--opb-img) + 16px);
}
.opb-bundle-table .opb-col-qty,
.opb-bundle-table .opb-col-price,
.opb-bundle-table .opb-col-stock,
.opb-bundle-table .opb-col-opt {
	white-space: nowrap;
}

/* Plain: no outer chrome */
.opb-box-plain.opb-layout-list .opb-bundle-item,
.opb-box-plain.opb-layout-grid .opb-bundle-item {
	background: transparent;
	border-color: #eee;
	box-shadow: none;
}
.opb-box-plain.opb-layout-list .opb-bundle-item {
	border: 0;
	border-bottom: 1px solid #eee;
	border-radius: 0;
	padding-inline: 0;
}
.opb-box-plain.opb-layout-compact .opb-bundle-items {
	border: 0;
	background: transparent;
}
.opb-box-plain.opb-layout-cards .opb-bundle-item {
	border-color: #eee;
	background: #fff;
}

@media (max-width: 782px) {
	.opb-layout-grid .opb-bundle-items,
	.opb-layout-cards .opb-bundle-items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.opb-layout-compact .opb-bundle-item-details {
		display: block;
	}
	.opb-layout-compact .opb-bundle-item-meta {
		margin-inline-start: 0;
	}
}
@media (max-width: 520px) {
	.opb-layout-grid .opb-bundle-items,
	.opb-layout-cards .opb-bundle-items {
		grid-template-columns: 1fr;
	}
	.opb-layout-list .opb-bundle-item {
		flex-wrap: wrap;
	}
}
