/* WinC Product Bundles - frontend styles
   Defensive: themes often force red/pill styling onto <button> and <a>.
   We reset every interactive element inside the form, then style ours. */

.wpb-bundle-form {
	margin-top: 8px;
	display: block !important;
	width: 100%;
	max-width: 640px;
}

/* Neutralize theme layouts that turn form.cart into a horizontal flex/grid. */
.wpb-bundle-form,
.wpb-bundle-form > * {
	float: none !important;
}

.wpb-bundle-form .wpb-strip,
.wpb-bundle-form .wpb-summary,
.wpb-bundle-form .wpb-total,
.wpb-bundle-form .wpb-actions {
	display: block;
	width: 100%;
	clear: both;
}

/* ---- Reset so the theme's button/link styles don't bleed in ----
   Strip card, edit, and close are now <div>/<span role="button">, which
   themes don't paint. We still neutralize any inherited styling. */
.wpb-bundle-form .wpb-strip-card,
.wpb-bundle-form .wpb-edit,
.wpb-bundle-form .wpb-chooser-close {
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font: inherit !important;
	width: auto !important;
	min-height: 0 !important;
	margin: 0;
	padding: 0;
	cursor: pointer;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.wpb-bundle-form .wpb-strip-card:focus-visible,
.wpb-bundle-form .wpb-edit:focus-visible,
.wpb-bundle-form .wpb-chooser-close:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.wpb-bundle-form a.wpb-summary-name {
	background: none !important;
	background-color: transparent !important;
	color: inherit !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	display: inline !important;
	width: auto !important;
	text-transform: none !important;
	font-weight: 500;
}

/* ---------- Selected products strip ---------- */

.wpb-strip {
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 24px !important;
	padding: 0;
	list-style: none;
	width: 100% !important;
}

.wpb-strip-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 148px;
	transition: opacity 0.2s ease;
}

.wpb-size-small .wpb-strip-item { width: 112px; }
.wpb-size-large .wpb-strip-item { width: 184px; }

.wpb-strip-item.wpb-item-off {
	opacity: 0.4;
}

.wpb-strip-card {
	position: relative;
	display: block !important;
	width: 100% !important;
	border-radius: 10px !important;
	overflow: hidden;
	line-height: 0 !important;
}

.wpb-strip-card:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.wpb-strip-img {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f3f4f6;
	border-radius: 10px;
	overflow: hidden;
}

.wpb-strip-img img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	border-radius: 10px;
	display: block;
	margin: 0 !important;
	transition: filter 0.2s ease, transform 0.2s ease;
}

/* "View" overlay on hover/focus */
.wpb-view-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1em;
	letter-spacing: 0.02em;
	color: #fff;
	background: rgba(17, 24, 39, 0.35);
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.wpb-strip-card:hover .wpb-strip-img img,
.wpb-strip-card:focus-visible .wpb-strip-img img {
	filter: blur(2px) brightness(0.85);
	transform: scale(1.03);
}

.wpb-strip-card:hover .wpb-view-overlay,
.wpb-strip-card:focus-visible .wpb-view-overlay {
	opacity: 1;
}

.wpb-strip-name {
	position: absolute;
	left: 50%;
	bottom: 8px;
	transform: translateX(-50%);
	max-width: calc(100% - 12px);
	background: rgba(255, 255, 255, 0.92);
	color: #111 !important;
	font-size: 0.78em;
	font-weight: 700;
	line-height: 1.25 !important;
	padding: 4px 10px;
	border-radius: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.wpb-strip-price {
	margin-top: 8px;
	font-size: 0.95em;
	color: #374151;
	text-align: center;
}

.wpb-plus {
	align-self: center;
	color: #111;
	margin: 0 4px;
	transform: translateY(-14px);
	display: inline-flex;
}

/* ---------- Summary rows ---------- */

.wpb-summary {
	border-bottom: 1px solid #e5e7eb;
	margin: 0 0 16px !important;
	width: 100% !important;
}

.wpb-summary-row {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	gap: 16px;
	padding: 14px 4px;
	border-top: 1px solid #e5e7eb;
	transition: opacity 0.2s ease;
	width: 100%;
}

.wpb-summary-row.wpb-row-off {
	opacity: 0.45;
}

.wpb-summary-main {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.wpb-summary-name {
	text-decoration: underline;
	text-underline-offset: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpb-edit {
	flex-shrink: 0;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 30px !important;
	height: 30px;
	border-radius: 6px !important;
	color: #374151 !important;
}

.wpb-edit:hover {
	background: #f3f4f6 !important;
	color: #111 !important;
}

.wpb-edit svg { display: block; }

.wpb-summary-qty {
	flex: 0 0 auto;
	min-width: 40px;
	text-align: center;
}

.wpb-qty-fixed {
	display: inline-block;
	font-size: 1em;
	color: #374151;
	font-variant-numeric: tabular-nums;
}

.wpb-line-price {
	min-width: 90px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.wpb-include-wrap input {
	margin: 0;
}

/* ---------- Popup modal chooser ---------- */

.wpb-chooser {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.55);
}

.wpb-chooser[hidden] {
	display: none;
}

.wpb-chooser-dialog {
	background: #fff;
	border-radius: 14px;
	width: 100%;
	max-width: 720px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 22px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.wpb-chooser-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.wpb-chooser-title {
	margin: 0;
	font-size: 1.15em;
}

.wpb-chooser-close {
	font-size: 1.6em !important;
	color: #6b7280 !important;
	padding: 0 6px !important;
	line-height: 1 !important;
}

.wpb-chooser-close:hover {
	color: #111 !important;
}

.wpb-badge {
	display: inline-block;
	font-size: 0.68em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 8px;
	border-radius: 999px;
	background: #eef2ff;
	color: #3730a3;
	vertical-align: middle;
	margin-left: 6px;
}

.wpb-badge-gift {
	background: #ecfdf5;
	color: #047857;
}

.wpb-item-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

.wpb-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	padding: 12px 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpb-product-card:hover {
	border-color: #b9b9b9;
}

.wpb-product-card.is-selected {
	border-color: #2563eb;
	box-shadow: 0 0 0 1px #2563eb;
}

.wpb-product-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.wpb-thumb img {
	max-width: 88px !important;
	height: auto;
	border-radius: 6px;
	display: block;
	margin: 0 auto !important;
}

.wpb-size-small .wpb-thumb img { max-width: 60px !important; }
.wpb-size-large .wpb-thumb img { max-width: 120px !important; }

.wpb-name {
	font-weight: 600;
	font-size: 0.9em;
	line-height: 1.3;
}

.wpb-price {
	font-size: 0.9em;
}

.wpb-price ins {
	text-decoration: none;
	font-weight: 700;
}

.wpb-price del {
	color: #9ca3af;
	margin-right: 4px;
}

.wpb-stock,
.wpb-desc {
	font-size: 0.78em;
	color: #6b7280;
}

/* ---------- Total box ---------- */

.wpb-total {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: space-between;
	background: #f3f4f6;
	border-radius: 12px;
	padding: 20px 24px;
	margin: 0 0 20px !important;
	font-size: 1.15em;
	gap: 12px;
	width: 100% !important;
}

.wpb-total-label,
.wpb-total-amount {
	font-weight: 700;
}

/* ---------- Actions ---------- */

.wpb-actions {
	display: flex !important;
	flex-direction: row !important;
	align-items: stretch;
	gap: 14px;
	width: 100% !important;
}

.wpb-bundle-qty-wrap {
	flex: 0 0 auto;
}

.wpb-bundle-qty-wrap .qty {
	width: 68px;
	min-height: 52px;
	height: 100%;
	text-align: center;
	border: 1px solid #d1d5db;
	border-radius: 8px;
}

.wpb-bundle-form .wpb-add-btn {
	flex: 1 1 auto;
	background: #c8102e !important;
	background-color: #c8102e !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 16px 24px !important;
	font-size: 1.05em;
	font-weight: 600;
	cursor: pointer;
	width: auto !important;
	max-width: none !important;
	transition: background 0.15s ease;
}

.wpb-bundle-form .wpb-add-btn:hover {
	background: #a50d26 !important;
	background-color: #a50d26 !important;
}

/* Cart child indent */
.wpb-child-indent {
	color: #9ca3af;
	margin-right: 2px;
}

@media (max-width: 782px) {
	.wpb-bundle-form {
		max-width: 100%;
	}
}

@media (max-width: 600px) {
	.wpb-strip {
		justify-content: center;
		gap: 4px;
	}
	.wpb-strip-item {
		width: 30%;
		min-width: 92px;
	}
	.wpb-plus {
		transform: translateY(-22px);
		margin: 0 2px;
	}
	.wpb-summary-row {
		flex-wrap: wrap;
		gap: 8px 12px;
	}
	.wpb-summary-main {
		flex: 1 1 100%;
	}
	.wpb-line-price {
		min-width: 0;
		margin-left: auto;
	}
	.wpb-total {
		padding: 16px 18px;
	}
	.wpb-actions {
		flex-wrap: wrap;
	}
	.wpb-bundle-qty-wrap .qty {
		min-height: 48px;
	}
	.wpb-bundle-form .wpb-add-btn {
		flex: 1 1 100%;
	}
	.wpb-item-products {
		grid-template-columns: repeat(2, 1fr);
	}
	.wpb-chooser-dialog {
		padding: 16px;
		max-height: 90vh;
	}
}

@media (max-width: 380px) {
	.wpb-strip-item {
		width: 46%;
	}
}
