/**
 * Dynamic Category Bundle — frontend styles (v1.1 card layout).
 *
 * Transparent by design: no background, border, or padding on the section —
 * control the container background from Elementor. All rules scoped under
 * .dcb-fbt. Override the accent via:
 *
 *   .dcb-fbt { --dcb-accent: #9c8e63; }
 */

.dcb-fbt {
	--dcb-accent: #5D5E3B;      /* checkbox + button color */
	--dcb-text: inherit;
	--dcb-muted: #8a8a8a;
	--dcb-sale: #d0021b;        /* "(X% Off)" color */
	--dcb-card-width: 300px;

	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.dcb-fbt__title {
	margin: 0 0 28px;
}

/* ---- Layout: cards left, summary right -------------------------------- */

.dcb-fbt__inner {
	display: flex;
	align-items: center;
	gap: 40px;
	flex-wrap: wrap;
}

.dcb-fbt__cards {
	display: flex;
	align-items: flex-start;
	gap: 22px;
	flex: 1 1 640px;
	min-width: 0;
	flex-wrap: wrap;
}

/* ---- Product card ------------------------------------------------------ */

.dcb-fbt__card {
	flex: 1 1 0;
	min-width: 200px;
	max-width: var(--dcb-card-width);
	transition: opacity 0.2s ease;
}

.dcb-fbt__card--off {
	opacity: 0.4;
}

.dcb-fbt__media {
	position: relative;
	margin-bottom: 16px;
}

.dcb-fbt__thumb {
	display: block;
	overflow: hidden;
}

.dcb-fbt__thumb img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---- Checkbox overlaid on the image ------------------------------------ */

.dcb-fbt__check {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: block;
	width: 26px;
	height: 26px;
	cursor: pointer;
}

/* Current product: always in the bundle, checkbox hidden (input stays for the total). */
.dcb-fbt__check--locked {
	display: none;
}

.dcb-fbt__checkbox {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.dcb-fbt__checkmark {
	position: absolute;
	inset: 0;
	background: var(--dcb-accent);
	border-radius: 4px;
	transition: background 0.15s ease;
}

/* Tick, drawn only when checked. */
.dcb-fbt__checkbox:checked + .dcb-fbt__checkmark::after {
	content: "";
	position: absolute;
	left: 9px;
	top: 4px;
	width: 6px;
	height: 12px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

.dcb-fbt__checkbox:not(:checked) + .dcb-fbt__checkmark {
	background: #fff;
	box-shadow: inset 0 0 0 2px var(--dcb-accent);
}

.dcb-fbt__checkbox:focus-visible + .dcb-fbt__checkmark {
	outline: 2px solid var(--dcb-accent);
	outline-offset: 2px;
}

/* ---- Plus separator ----------------------------------------------------- */

.dcb-fbt__plus {
	align-self: center;
	flex: 0 0 auto;
	font-size: 34px;
	font-weight: 300;
	line-height: 1;
	color: var(--dcb-text);
	/* Optically align with the image area, not the full card height. */
	margin-top: -70px;
}

/* ---- Title + price ------------------------------------------------------ */

.dcb-fbt__name {
	display: block;
	margin-bottom: 10px;
	color: var(--dcb-text);
	text-decoration: none;
	line-height: 1.45;
}

.dcb-fbt__name:hover {
	text-decoration: underline;
}

.dcb-fbt__price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 1.05em;
}

.dcb-fbt__price-current {
	font-weight: 700;
}

.dcb-fbt__price-regular {
	color: var(--dcb-muted);
	font-weight: 400;
}

.dcb-fbt__price-off {
	color: var(--dcb-sale);
	font-weight: 600;
}

/* ---- Summary column: total + button ------------------------------------- */

.dcb-fbt__summary {
	flex: 0 0 auto;
	min-width: 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	text-align: center;
}

.dcb-fbt__total {
	font-size: 1.3em;
}

.dcb-fbt__total-label {
	font-weight: 700;
	margin-right: 8px;
}

.dcb-fbt__total-amount {
	font-weight: 700;
}

.dcb-fbt__add {
	width: 100%;
	padding: 16px 32px;
	background: var(--dcb-accent);
	color: #fff;
	border: 0;
	border-radius: 0;
	font-size: 1.05em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.dcb-fbt__add:hover {
	color: #ffffff;
	background-color: #000000;
}

.dcb-fbt__add.dcb-loading {
	opacity: 0.6;
	pointer-events: none;
}

.dcb-fbt__message {
	font-size: 0.9em;
	color: #2e7d32;
	min-height: 1.2em;
}

.dcb-fbt__message--error {
	color: #c62828;
}

/* ---- Elementor editor placeholder ---------------------------------------- */

.dcb-editor-placeholder {
	padding: 24px;
	border: 2px dashed #c9c4ff;
	border-radius: 10px;
	background: #f6f5ff;
	text-align: center;
	color: #5a54c9;
	font-size: 0.95em;
}

/* ---- Responsive ------------------------------------------------------------ */

@media (max-width: 1024px) {
	.dcb-fbt__inner {
		flex-direction: column;
		align-items: stretch;
	}

	.dcb-fbt__summary {
		min-width: 0;
		width: 100%;
		max-width: 420px;
		margin: 0 auto;
	}
}

@media (max-width: 640px) {
	.dcb-fbt__cards {
		gap: 14px;
	}

	.dcb-fbt__card {
		min-width: 130px;
	}

	.dcb-fbt__plus {
		font-size: 24px;
		margin-top: -40px;
	}

	.dcb-fbt__check {
		top: 8px;
		left: 8px;
		width: 22px;
		height: 22px;
	}

	.dcb-fbt__checkbox:checked + .dcb-fbt__checkmark::after {
		left: 7px;
		top: 3px;
		width: 5px;
		height: 10px;
	}
}
