/* ==========================================================================
   Bundle Shop Cards — 3-column Goli-style grid
   Loaded only on shop / product-category / product-tag archives.
   NOTE: Nutritix wraps content in .site-main (no .woocommerce class).
         All critical layout rules use !important to beat theme legacy CSS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   3-column grid — override the theme's float-based loop layout.
   The Nutritix wrapper is <main class="site-main">; there is no .woocommerce
   ancestor, so we target the <ul> element directly.
   -------------------------------------------------------------------------- */
/* Also add explicit stretch so all rows are equal height */
ul.products.columns-3 {
	display: grid !important;
	grid-template-columns: repeat( 3, 1fr ) !important;
	gap: 24px !important;
	align-items: stretch !important;
	float: none !important;
	width: 100% !important;
	margin: 0 0 40px 0 !important;
	padding: 0 !important;
	list-style: none !important;
	box-sizing: border-box !important;
}

/* Every <li> inside the 3-col grid must fill its grid track */
ul.products.columns-3 > li.product,
ul.products.columns-3 > li.bundle-shop-card-item {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	clear: none !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	list-style: none !important;
	/* flex column so height:100% on .bundle-shop-card works reliably */
	display: flex !important;
	flex-direction: column !important;
}

/* --------------------------------------------------------------------------
   Card wrapper — full-width inside grid track
   -------------------------------------------------------------------------- */
.bundle-shop-card {
	display: flex !important;
	flex-direction: column !important;
	gap: 14px !important;
	width: 100% !important;
	max-width: 100% !important;
	height: 100% !important;
	box-sizing: border-box !important;
	background: #fff9f6 !important;
	border: 1px solid var( --border, #e8e8e8 ) !important;
	border-radius: 16px !important;
	padding: 20px !important;
	overflow: visible !important;
	box-shadow: 0 2px 16px rgba( 0, 0, 0, 0.06 ) !important;
	transition: box-shadow 0.2s ease !important;
}

.bundle-shop-card:hover {
	box-shadow: 0 6px 28px rgba( 0, 0, 0, 0.11 ) !important;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.bsc-header {
	text-align: center;
}

.bsc-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 4px;
	line-height: 1.3;
}

.bsc-title a {
	color: var( --primary, #f65000 );
	text-decoration: none;
}

.bsc-title a:hover {
	text-decoration: underline;
}

.bsc-subtitle {
	font-size: 12px;
	color: #888;
	margin: 0;
	line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Body — image centred on top, pricing options stacked full-width below
   -------------------------------------------------------------------------- */
.bsc-body {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 12px !important;
	width: 100% !important;
	box-sizing: border-box !important;
}

/* Image wrapper: shrink-fit so % badge anchors to image edge */
.bsc-media {
	position: relative !important;
	width: -webkit-fit-content !important;
	width: fit-content !important;
	margin: 0 auto !important;
	padding-bottom: 14px !important; /* space for badge overlapping below */
}

.bsc-product-image {
	width: 130px !important;
	height: 130px !important;
	object-fit: cover !important;
	border-radius: 12px !important;
	display: block !important;
	transition: opacity 0.3s ease !important;
}

/* % OFF badge — dark circle at bottom-left of image */
.bsc-badge {
	position: absolute !important;
	bottom: 0 !important;
	left: -8px !important;
	width: 44px !important;
	height: 44px !important;
	border-radius: 50% !important;
	background: var( --accent, #151515 ) !important;
	color: #fff !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	pointer-events: none !important;
	z-index: 2 !important;
}

.bsc-badge-number {
	font-size: 12px;
	font-weight: 800;
	display: block;
}

.bsc-badge-text {
	font-size: 8px;
	font-weight: 700;
	display: block;
	letter-spacing: 0.04em;
}

/* Pricing options column — full card width */
.bsc-pricing {
	display: flex !important;
	flex-direction: column !important;
	gap: 6px !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
}

/* Each option tile — min-height keeps tiles stable regardless of content */
.bsc-option {
	position: relative !important;
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	gap: 8px !important;
	width: 100% !important;
	min-height: 58px !important;
	box-sizing: border-box !important;
	padding: 8px 10px !important;
	border: 2px solid var( --border, #e8e8e8 ) !important;
	border-radius: 10px !important;
	background: #fff !important;
	cursor: pointer !important;
	user-select: none !important;
	transition: border-color 0.2s, background 0.2s, color 0.2s !important;
}

.bsc-option:hover {
	border-color: var( --primary, #f65000 ) !important;
}

.bsc-option.active {
	border-color: var( --primary, #f65000 ) !important;
	background: var( --primary, #f65000 ) !important;
}

/* Subscribe badge pill */
.bsc-badge-pill {
	position: absolute;
	top: -10px;
	right: 8px;
	background: var( --accent, #151515 );
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 20px;
	white-space: nowrap;
	letter-spacing: 0.03em;
	pointer-events: none;
}

/* Subscribe option needs top gap to accommodate the overflowing pill */
.subscribe-option {
	margin-top: 14px;
}

.bsc-option-inner {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	overflow: visible !important;
	word-break: normal !important;
	overflow-wrap: break-word !important;
}

.bsc-option-label {
	font-size: 11px;
	font-weight: 700;
	color: var( --accent, #151515 );
	margin-bottom: 3px;
	white-space: normal;
	word-break: normal;
}

.bsc-option.active .bsc-option-label {
	color: #fff !important;
}

.bsc-option-prices {
	font-size: 11px;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 3px;
	color: #888;
}

.bsc-price-each {
	font-size: 11px;
}

.bsc-price-value {
	font-size: 14px;
	font-weight: 800;
	color: var( --accent, #151515 );
}

/* WooCommerce wraps price in <bdi> — make currency symbol superscript */
.bsc-price-value .woocommerce-Price-currencySymbol {
	font-size: 10px;
	vertical-align: super;
}

.bsc-option.active .bsc-price-value,
.bsc-option.active .bsc-price-each {
	color: #fff !important;
}

.bsc-price-total-wrap {
	font-size: 10px;
}

.bsc-price-total {
	font-weight: 700;
}

.bsc-option.active .bsc-price-total-wrap,
.bsc-option.active .bsc-price-total {
	color: rgba( 255, 255, 255, 0.9 ) !important;
}

.bsc-price-original {
	font-size: 10px;
	text-decoration: line-through;
	color: #bbb;
}

.bsc-option.active .bsc-price-original {
	color: rgba( 255, 255, 255, 0.55 ) !important;
}

/* Checkmark circle icon */
.bsc-checkmark {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	color: #ccc;
	transition: color 0.2s;
}

.bsc-option:hover .bsc-checkmark {
	color: var( --primary, #f65000 );
}

.bsc-option.active .bsc-checkmark {
	color: #fff !important;
}

/* --------------------------------------------------------------------------
   Pack selector pills
   -------------------------------------------------------------------------- */
.bsc-packs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.bsc-pack-btn {
	flex: 1 1 auto;
	min-width: 56px;
	padding: 7px 10px;
	background: #fff;
	color: var( --accent, #151515 );
	border: 2px solid var( --border, #e0e0e0 );
	border-radius: 30px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	cursor: pointer;
	transition: background 0.18s, border-color 0.18s, color 0.18s;
	outline: none;
	user-select: none;
}

.bsc-pack-btn:hover {
	border-color: var( --primary, #f65000 );
	color: var( --primary, #f65000 );
}

.bsc-pack-btn.active {
	background: var( --primary, #f65000 );
	border-color: var( --primary, #f65000 );
	color: #fff;
}

/* --------------------------------------------------------------------------
   CTA button (div — avoids theme button::after conflict)
   -------------------------------------------------------------------------- */
.bsc-cta {
	margin-top: auto;
}

.bsc-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 16px;
	background: var( --accent, #151515 );
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border-radius: 40px;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
	outline: none;
	user-select: none;
	box-sizing: border-box;
	text-align: center;
}

.bsc-add-to-cart:hover {
	background: var( --primary, #f65000 );
	transform: translateY( -1px );
}

.bsc-add-to-cart:active {
	transform: translateY( 0 );
	background: #c94000;
}

/* Loading state */
.bsc-btn-loading {
	display: none;
}

.bsc-add-to-cart.is-loading .bsc-btn-text {
	opacity: 0.6;
}

.bsc-add-to-cart.is-loading .bsc-btn-loading {
	display: flex;
}

@keyframes nutritix-bsc-spin {
	to { transform: rotate( 360deg ); }
}

.bsc-spinner {
	width: 16px;
	height: 16px;
	animation: nutritix-bsc-spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   Notice / error banner
   -------------------------------------------------------------------------- */
.bsc-notice {
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 12px;
}

.bsc-notice.is-error {
	background: #fff0f0;
	border: 1px solid #f5c2c7;
	color: #842029;
}

/* --------------------------------------------------------------------------
   Responsive breakpoints
   -------------------------------------------------------------------------- */
@media ( max-width: 1024px ) {
	ul.products.columns-3 {
		grid-template-columns: repeat( 2, 1fr ) !important;
	}
}

@media ( max-width: 640px ) {
	ul.products.columns-3 {
		grid-template-columns: 1fr !important;
	}

	.bundle-shop-card {
		padding: 16px !important;
	}

	.bsc-product-image {
		width: 110px !important;
		height: 110px !important;
	}
}

/* --------------------------------------------------------------------------
   Shop page — hide breadcrumb/banner section and sort/results toolbar
   .woocommerce-shop is the body class WordPress adds on the main shop archive.
   -------------------------------------------------------------------------- */
.woocommerce-shop .breadcrumb-wrap {
	display: none !important;
}

.woocommerce-shop .nutritix-sorting {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Free Shipping badge inside bundle shop cards
   -------------------------------------------------------------------------- */
.bsc-free-shipping {
	display: inline-flex !important;
	align-items: center !important;
	gap: 5px !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	color: #1a9a30 !important;
	background: #edfaf0 !important;
	border: 1px solid #a8e6b5 !important;
	border-radius: 20px !important;
	padding: 3px 10px !important;
	margin: 5px 0 0 !important;
	line-height: 1.4 !important;
	letter-spacing: 0.01em !important;
}
