/* Custom Boxes Home Section V1 — builder / pick-and-mix showcase */

.cbx-v1 {
	position: relative;
	padding: clamp(3rem, 6vw, 5rem) 0;
	overflow: hidden;
	background:
		radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--primary-brand-color) 18%, transparent), transparent 70%),
		var(--secondary-background-color, var(--primary-background-color));
}

.cbx-v1__pattern {
	position: absolute;
	inset: 0;
	opacity: 0.35;
	background-image:
		linear-gradient(color-mix(in srgb, var(--primary-brand-color) 12%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in srgb, var(--primary-brand-color) 12%, transparent) 1px, transparent 1px);
	background-size: 28px 28px;
	mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
	pointer-events: none;
}

.cbx-v1__container {
	position: relative;
	z-index: 1;
}

/* Header */
.cbx-v1__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem 2rem;
	margin-bottom: clamp(2rem, 4vw, 3rem);
	flex-wrap: wrap;
}

.cbx-v1__header-copy {
	max-width: 36rem;
}

.cbx-v1__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.85rem;
	margin-bottom: 0.85rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--sc-custom-boxes-v1-cbx-v1-eyebrow-text, var(--primary-brand-color));
	background: var(--sc-custom-boxes-v1-cbx-v1-eyebrow-bg, color-mix(in srgb, var(--primary-brand-color) 14%, var(--primary-background-color)));
	border: 1px solid var(--sc-custom-boxes-v1-cbx-v1-eyebrow-border, color-mix(in srgb, var(--primary-brand-color) 28%, transparent));
}

.cbx-v1__header h2 {
	margin: 0 0 0.65rem;
	font-size: clamp(1.75rem, 3.5vw, 2.35rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--sc-custom-boxes-v1-cbx-v1-header-heading-text, var(--primary-title-color));
	letter-spacing: -0.02em;
}

.cbx-v1__header p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.65;
	color: var(--sc-custom-boxes-v1-cbx-v1-header-paragraph-text, var(--secondary-text-color));
}

.cbx-v1__browse {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.75rem 1.35rem;
	border-radius: 12px;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--sc-custom-boxes-v1-cbx-v1-browse-text, var(--primary-button-text-color));
	background: var(--sc-custom-boxes-v1-cbx-v1-browse-bg, var(--primary-brand-color));
	border: 2px solid transparent;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
	white-space: nowrap;
}

.cbx-v1__browse:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px color-mix(in srgb, var(--primary-brand-color) 35%, transparent);
	color: var(--sc-custom-boxes-v1-cbx-v1-browse-hover-text, var(--primary-button-text-color));
}

.cbx-v1__browse--desktop {
	flex-shrink: 0;
}

.cbx-v1__footer-mobile {
	display: none;
	margin-top: 1.75rem;
	text-align: center;
}

/* Grid */
.cbx-v1__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 1.25rem;
}

/* Card */
.cbx-v1-card {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.65s ease var(--cbx-delay, 0s), transform 0.65s ease var(--cbx-delay, 0s);
}

.cbx-v1-card.animate-in {
	opacity: 1;
	transform: translateY(0);
}

.cbx-v1-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	border-radius: 20px;
	overflow: hidden;
	background: var(--sc-custom-boxes-v1-cbx-v1-card-link-bg, var(--primary-background-color));
	border: 1px solid var(--sc-custom-boxes-v1-cbx-v1-card-link-border, color-mix(in srgb, var(--primary-brand-color) 16%, transparent));
	box-shadow:
		0 1px 0 color-mix(in srgb, var(--primary-brand-color) 8%, transparent) inset,
		0 16px 40px color-mix(in srgb, var(--charcoal-black, #111) 8%, transparent);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.cbx-v1-card__link:hover {
	transform: translateY(-6px);
	border-color: var(--sc-custom-boxes-v1-cbx-v1-card-link-hover-border, color-mix(in srgb, var(--primary-brand-color) 45%, transparent));
	box-shadow:
		0 1px 0 color-mix(in srgb, var(--primary-brand-color) 12%, transparent) inset,
		0 24px 48px color-mix(in srgb, var(--primary-brand-color) 18%, transparent);
}

/* Visual / image area */
.cbx-v1-card__visual {
	position: relative;
	padding: 1rem 1rem 0;
}

.cbx-v1-card__frame {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background:
		linear-gradient(145deg, color-mix(in srgb, var(--primary-brand-color) 8%, var(--tertiary-background-color)), var(--tertiary-background-color));
	border: 2px dashed var(--sc-custom-boxes-v1-cbx-v1-card-frame-border, color-mix(in srgb, var(--primary-brand-color) 30%, transparent));
}

.cbx-v1-card__frame::before,
.cbx-v1-card__frame::after {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid var(--sc-custom-boxes-v1-cbx-v1-card-frame-before-border, var(--primary-brand-color));
	opacity: 0.55;
	z-index: 2;
	pointer-events: none;
}

.cbx-v1-card__frame::before {
	top: 10px;
	left: 10px;
	border-right: none;
	border-bottom: none;
	border-radius: 4px 0 0 0;
}

.cbx-v1-card__frame::after {
	bottom: 10px;
	right: 10px;
	border-left: none;
	border-top: none;
	border-radius: 0 0 4px 0;
}

.cbx-v1-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.cbx-v1-card__link:hover .cbx-v1-card__image {
	transform: scale(1.06);
}

.cbx-v1-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 2.5rem;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-placeholder-text, color-mix(in srgb, var(--primary-brand-color) 50%, var(--secondary-text-color)));
}

.cbx-v1-card__label {
	position: absolute;
	top: 1.5rem;
	left: 1.5rem;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.65rem;
	border-radius: 8px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-label-text, var(--primary-button-text-color));
	background: var(--sc-custom-boxes-v1-cbx-v1-card-label-bg, var(--primary-brand-color));
	box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-brand-color) 40%, transparent);
}

[dir='rtl'] .cbx-v1-card__label {
	left: auto;
	right: 1.5rem;
}

.cbx-v1-card__deal {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	padding: 0.3rem 0.6rem;
	border-radius: 8px;
	font-size: 0.75rem;
	font-weight: 800;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-deal-text, var(--discount_badge_text_color, var(--primary-button-text-color)));
	background: var(--discount_badge_background_color, #e53935);
}

[dir='rtl'] .cbx-v1-card__deal {
	right: auto;
	left: 1.5rem;
}

/* Body / builder preview */
.cbx-v1-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.15rem 1.25rem 1.25rem;
	gap: 0.85rem;
}

.cbx-v1-card__title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-title-text, var(--primary-title-color));
}

.cbx-v1-card__metrics {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	font-size: 0.8125rem;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-metrics-text, var(--secondary-text-color));
}

.cbx-v1-card__metric strong {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-metric-text-text, var(--primary-brand-color));
	margin-inline-end: 0.2rem;
}

.cbx-v1-card__metric-divider {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--sc-custom-boxes-v1-cbx-v1-card-metric-divider-bg, color-mix(in srgb, var(--secondary-text-color) 50%, transparent));
}

.cbx-v1-card__steps {
	list-style: none;
	margin: 0;
	padding: 0.75rem;
	border-radius: 12px;
	background: var(--sc-custom-boxes-v1-cbx-v1-card-steps-bg, color-mix(in srgb, var(--primary-brand-color) 6%, var(--tertiary-background-color)));
	border: 1px solid var(--sc-custom-boxes-v1-cbx-v1-card-steps-border, color-mix(in srgb, var(--primary-brand-color) 12%, transparent));
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.cbx-v1-card__step {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-step-text, var(--primary-text-color, var(--primary-title-color)));
}

.cbx-v1-card__step-num {
	flex-shrink: 0;
	width: 1.35rem;
	height: 1.35rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	font-size: 0.6875rem;
	font-weight: 800;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-step-num-text, var(--primary-brand-color));
	background: var(--sc-custom-boxes-v1-cbx-v1-card-step-num-bg, var(--primary-background-color));
	border: 1px solid var(--sc-custom-boxes-v1-cbx-v1-card-step-num-border, color-mix(in srgb, var(--primary-brand-color) 35%, transparent));
}

.cbx-v1-card__step--more .cbx-v1-card__step-num {
	font-size: 0.75rem;
}

.cbx-v1-card__step-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.cbx-v1-card__step-text em {
	font-style: normal;
	font-size: 0.75rem;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-step-text-em-text, var(--secondary-text-color));
}

/* Footer — div (not <footer>) so global footer-v1 styles do not bleed in */
.cbx-v1-card__footer {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 0 0;
	border-top: 1px dashed var(--sc-custom-boxes-v1-cbx-v1-card-footer-border-top, color-mix(in srgb, var(--primary-brand-color) 22%, transparent));
	background: transparent;
	color: inherit;
}

.cbx-v1-card__price {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.cbx-v1-card__price-old {
	font-size: 0.75rem;
	text-decoration: line-through;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-price-old-text, var(--secondary-text-color));
	opacity: 0.75;
}

.cbx-v1-card__price-current {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-price-current-text, var(--primary-title-color));
	line-height: 1.2;
}

.cbx-v1-card__price-note {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-price-note-text, var(--secondary-text-color));
}

.cbx-v1-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.55rem 0.95rem;
	border-radius: 10px;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--sc-custom-boxes-v1-cbx-v1-card-cta-text, var(--primary-brand-color));
	background: var(--sc-custom-boxes-v1-cbx-v1-card-cta-bg, color-mix(in srgb, var(--primary-brand-color) 12%, transparent));
	border: 1px solid var(--sc-custom-boxes-v1-cbx-v1-card-cta-border, color-mix(in srgb, var(--primary-brand-color) 28%, transparent));
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
	white-space: nowrap;
}

.cbx-v1-card__link:hover .cbx-v1-card__cta {
	background: var(--sc-custom-boxes-v1-cbx-v1-card-cta-hover-bg, var(--primary-brand-color));
	color: var(--sc-custom-boxes-v1-cbx-v1-card-cta-hover-text, var(--primary-button-text-color));
	transform: translateX(3px);
}

[dir='rtl'] .cbx-v1-card__link:hover .cbx-v1-card__cta {
	transform: translateX(-3px);
}

/* Responsive */
@media (min-width: 768px) {
	.cbx-v1__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem;
	}
}

@media (min-width: 1100px) {
	.cbx-v1__grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.cbx-v1-card__link {
		min-height: 100%;
	}
}

@media (max-width: 767px) {
	.cbx-v1__browse--desktop {
		display: none;
	}

	.cbx-v1__footer-mobile {
		display: block;
	}

	.cbx-v1__header {
		margin-bottom: 1.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cbx-v1-card,
	.cbx-v1-card__link,
	.cbx-v1-card__image,
	.cbx-v1-card__cta,
	.cbx-v1__browse {
		transition: none;
	}

	.cbx-v1-card {
		opacity: 1;
		transform: none;
	}
}
