/**
 * Frontend Bundle Styles
 *
 * Styles for displaying bundle products on the frontend.
 * Uses CSS custom properties for easy theme integration.
 *
 * @package WooBundles_KatsarovDesign
 * @since 1.0.0
 */

/* CSS Custom Properties (Theming)
-----------------------------------------*/
:root {
	--wkbd-primary: var(--wc-primary, #0073aa);
	--wkbd-primary-strong: #0b5f85;
	--wkbd-success: var(--wc-green, #7ad03a);
	--wkbd-success-soft: #eaf7df;
	--wkbd-text: #333;
	--wkbd-text-muted: #666;
	--wkbd-text-light: #999;
	--wkbd-bg: #fff;
	--wkbd-bg-alt: #f7f7f7;
	--wkbd-bg-soft: #fcfcfb;
	--wkbd-border: #e5e5e5;
	--wkbd-border-strong: #d5d9df;
	--wkbd-radius: 10px;
	--wkbd-radius-sm: 6px;
	--wkbd-spacing: 1em;
	--wkbd-spacing-lg: 1.5em;
	--wkbd-font-sm: 0.75em;
	--wkbd-font-base: 0.9em;
	--wkbd-font-md: 1em;
	--wkbd-font-lg: 1.1em;
	--wkbd-font-xl: 1.2em;
	--wkbd-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

/* Bundle Items Wrapper
-----------------------------------------*/
.wkbd-bundle-items-wrapper {
	margin: 2em 0;
	padding: calc(var(--wkbd-spacing-lg) + 0.25em);
	background: linear-gradient(135deg, #fbfbf9 0%, #f7f8fb 100%);
	border: 1px solid var(--wkbd-border-strong);
	border-radius: var(--wkbd-radius);
	box-shadow: var(--wkbd-shadow);
}

.wkbd-bundle-title {
	margin: 0 0 var(--wkbd-spacing);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--wkbd-text);
}

/* Bundle Items List
-----------------------------------------*/
.wkbd-bundle-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wkbd-bundle-item {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	margin-bottom: var(--wkbd-spacing);
	padding: 1rem;
	background: var(--wkbd-bg-soft);
	border: 1px solid var(--wkbd-border);
	border-radius: var(--wkbd-radius-sm);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wkbd-bundle-item:last-child {
	margin-bottom: 0;
}

.wkbd-bundle-item:hover {
	border-color: #c7d9e3;
	box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
	transform: translateY(-1px);
}

/* Bundle Item Thumbnail
-----------------------------------------*/
.wkbd-bundle-item-thumbnail {
	flex: 0 0 88px;
	width: 88px;
	height: 88px;
	margin-right: 0.9rem;
	overflow: hidden;
	border: 1px solid var(--wkbd-border);
	border-radius: var(--wkbd-radius-sm);
	background: #fff;
}

.wkbd-bundle-item-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Bundle Item Details
-----------------------------------------*/
.wkbd-bundle-item-details {
	flex: 1;
	min-width: 0;
}

.wkbd-bundle-item-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45em;
	margin-bottom: 0.35em;
}

.wkbd-bundle-item-name {
	margin: 0;
	font-size: 1.08rem;
	line-height: 1.35;
	font-weight: 700;
}

.wkbd-bundle-item-name a {
	color: var(--wkbd-text);
	text-decoration: none;
}

.wkbd-bundle-item-name a:hover {
	color: var(--wkbd-primary);
}

.wkbd-bundle-item-quantity {
	display: inline-flex;
	align-items: center;
	padding: 0.18em 0.55em;
	background: #f0f6fa;
	border: 1px solid #d5e6ef;
	border-radius: 999px;
	color: #2f4d5e;
	font-size: 0.78rem;
	font-weight: 600;
}

.wkbd-bundle-item-quantity.wkbd-bundle-item-optional {
	background: #fff1db;
	border-color: #f1d49c;
	color: #7d5a1a;
}

/* Bundle Item Pricing
-----------------------------------------*/
.wkbd-bundle-item-pricing {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-bottom: 0.25em;
}

.wkbd-bundle-item-price {
	font-weight: 700;
	font-size: 1.02rem;
}

.wkbd-bundle-item-price.wkbd-has-discount {
	color: var(--wkbd-success);
}

.wkbd-bundle-item-price del {
	margin-right: 0.25em;
	color: var(--wkbd-text-light);
	font-size: 0.92rem;
}

.wkbd-bundle-item-price ins {
	text-decoration: none;
}

.wkbd-bundle-item-discount {
	display: inline-block;
	padding: 0.2em 0.55em;
	background: var(--wkbd-success-soft);
	color: #38620f;
	font-size: 0.74rem;
	font-weight: 600;
	border-radius: 999px;
	border: 1px solid #c8e5b0;
}

.saving {
	display: inline-block;
	padding: 3px 6px;
	background: #fff2c9;
	border: 1px solid #eed486;
	border-radius: 6px;
	color: #5f4a10;
	font-size: 1.17rem;
	font-weight: 700;
	line-height: 1.25;
}

/* Bundle Savings
-----------------------------------------*/
.wkbd-bundle-savings {
	margin: 1rem 0;
	padding: 0.8em 0.95em;
	background: #e7f5e9;
	border: 1px solid #b8e994;
	border-radius: var(--wkbd-radius-sm);
	color: #2e7d32;
	font-weight: 500;
}

.wkbd-savings-label {
	margin-right: 0.5em;
}

.wkbd-savings-amount {
	font-weight: 700;
}

.wkbd-savings-percent {
	opacity: 0.8;
}

/* Bundle Totals
-----------------------------------------*/
.wkbd-bundle-totals {
	margin-top: var(--wkbd-spacing-lg);
	padding: 0.95rem 1rem;
	border: 1px solid var(--wkbd-border);
	border-radius: var(--wkbd-radius-sm);
	background: #fff;
}

.wkbd-bundle-total-regular,
.wkbd-bundle-total-price {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.45em;
}

.wkbd-bundle-total-price {
	font-size: 1.28rem;
	font-weight: 700;
	color: var(--wkbd-primary-strong);
}

.wkbd-total-label {
	color: var(--wkbd-text-muted);
}

.wkbd-bundle-total-price .wkbd-total-label {
	color: inherit;
}

/* Bundle Badge (Shop/Archive)
-----------------------------------------*/
.wkbd-bundle-badge {
	display: inline-block;
	margin: 0.5em 0;
	padding: 0.25em 0.75em;
	background: var(--wkbd-primary);
	color: #fff;
	font-size: var(--wkbd-font-sm);
	font-weight: 600;
	border-radius: calc(var(--wkbd-radius) - 1px);
	text-transform: uppercase;
}

/* Body Classes
-----------------------------------------*/
body.wkbd-bundle-product .product {
	/* Additional styling for bundle product pages */
}

/* Responsive Styles
-----------------------------------------*/
@media screen and (max-width: 768px) {
	.wkbd-bundle-items-wrapper {
		padding: 1rem;
	}

	.wkbd-bundle-item {
		flex-direction: column;
		padding: 0.85rem;
	}

	.wkbd-bundle-item-thumbnail {
		flex: 0 0 auto;
		width: 96px;
		height: 96px;
		margin-right: 0;
		margin-bottom: var(--wkbd-spacing);
	}

	.wkbd-bundle-item-details {
		min-width: 100%;
	}

	.wkbd-bundle-item-header {
		flex-direction: column;
	}

	.wkbd-bundle-item-quantity {
		margin-left: 0;
		margin-top: 0;
	}

	.wkbd-bundle-total-price {
		font-size: 1.15rem;
	}
}

/* Cart Item Styles
-----------------------------------------*/
.wkbd-savings {
	display: block;
	margin-top: 0.25em;
	color: var(--wkbd-success);
	font-size: 0.85em;
}
