/* Checkout form — v2 (modern card, bento grid, soft controls — distinct from v1) */

.checkout-form--v2 {
	--cf-v2-brand: var(--primary-brand-color, #8b5a3c);
	--cf-v2-brand-2: var(--secondary-brand-color, var(--cf-v2-brand));
	--cf-v2-radius: clamp(18px, 2vw, 24px);
	--cf-v2-radius-sm: 14px;
	--cf-v2-ink: var(--primary-title-color, #1a1410);
	--cf-v2-muted: color-mix(in srgb, var(--primary-text-color, #4a4540) 88%, transparent);
	--cf-v2-surface: color-mix(in srgb, var(--secondary-background-color, #f5f0eb) 55%, var(--primary-background-color, #fff));
	--cf-v2-field: color-mix(in srgb, var(--primary-background-color, #fff) 92%, var(--cf-v2-brand) 5%);
}

.cf-v2 {
	width: 100%;
}

/* Header — split: icon stack + copy (replaces badge stack) */
.cf-v2__header {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: clamp(1rem, 3vw, 1.5rem);
	margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
	padding: clamp(1rem, 2.5vw, 1.35rem);
	border-radius: var(--cf-v2-radius-sm);
	background: linear-gradient(
		135deg,
		color-mix(in srgb, var(--primary-background-color, #fff) 100%, transparent),
		color-mix(in srgb, var(--cf-v2-brand) 7%, var(--primary-background-color, #fff))
	);
	border: 1px solid var(--sc-checkout-form-v2-cf-v2-header-border, color-mix(in srgb, var(--cf-v2-brand) 14%, transparent));
	box-shadow: 0 12px 32px rgba(15, 12, 10, 0.05);
}

[dir="rtl"] .cf-v2__header {
	flex-direction: row-reverse;
}

.cf-v2__header-visual {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	flex-shrink: 0;
	padding: 0.15rem 0;
}

.cf-v2__header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(52px, 12vw, 68px);
	height: clamp(52px, 12vw, 68px);
	border-radius: 18px;
	color: var(--sc-checkout-form-v2-cf-v2-header-icon-text, #fff);
	font-size: clamp(1.25rem, 3vw, 1.5rem);
	background: linear-gradient(145deg, var(--cf-v2-brand), var(--cf-v2-brand-2));
	box-shadow:
		0 10px 24px color-mix(in srgb, var(--cf-v2-brand) 35%, transparent),
		inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
}

.cf-v2__header-step {
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-align: center;
	color: var(--sc-checkout-form-v2-cf-v2-header-step-text, var(--cf-v2-brand));
	max-width: 7rem;
	line-height: 1.25;
}

.cf-v2__header-copy {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.15rem 0;
	padding-inline-start: clamp(0.85rem, 2vw, 1.15rem);
}

.cf-v2__header-copy::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.2rem;
	bottom: 0.2rem;
	width: 3px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--cf-v2-brand), var(--cf-v2-brand-2));
}

.cf-v2__title {
	margin: 0;
	font-size: clamp(1.45rem, 2.8vw, 1.85rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.2;
	color: var(--sc-checkout-form-v2-cf-v2-title-text, var(--cf-v2-ink));
}

.cf-v2__header-lead {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--sc-checkout-form-v2-cf-v2-header-lead-text, color-mix(in srgb, var(--cf-v2-brand) 92%, var(--cf-v2-ink)));
}

.cf-v2__subtitle {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.45;
	color: var(--sc-checkout-form-v2-cf-v2-subtitle-text, var(--cf-v2-muted));
	max-width: 38ch;
}

@media (max-width: 479px) {
	.cf-v2__header,
	[dir="rtl"] .cf-v2__header {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.cf-v2__header-visual {
		flex-direction: row;
		justify-content: center;
		gap: 0.75rem;
	}

	.cf-v2__header-step {
		text-align: start;
		max-width: none;
		align-self: center;
	}

	.cf-v2__header-copy {
		padding-inline: 0;
		text-align: center;
		align-items: center;
	}

	.cf-v2__header-copy::before {
		display: none;
	}

	.cf-v2__subtitle {
		max-width: none;
	}
}

/* Panel — elevated card with gradient rim */
.cf-v2__panel {
	position: relative;
	border-radius: var(--cf-v2-radius);
	padding: 2px;
	background: linear-gradient(135deg, var(--cf-v2-brand), var(--cf-v2-brand-2), color-mix(in srgb, var(--cf-v2-brand) 40%, #fff));
	box-shadow:
		0 24px 56px rgba(15, 12, 10, 0.09),
		0 0 0 1px color-mix(in srgb, var(--cf-v2-brand) 12%, transparent);
}

.cf-v2__panel-inner {
	border-radius: calc(var(--cf-v2-radius) - 2px);
	background: linear-gradient(
		165deg,
		color-mix(in srgb, var(--primary-background-color, #fff) 100%, transparent),
		var(--cf-v2-surface)
	);
	padding: clamp(1.35rem, 3.5vw, 1.85rem);
}

/* Bento grid */
.cf-v2__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(1.1rem, 2.5vw, 1.35rem);
}

@media (min-width: 640px) {
	.cf-v2__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cf-v2__field--full {
		grid-column: 1 / -1;
	}
}

.cf-v2__field {
	min-width: 0;
}

.cf-v2__label {
	display: block;
	margin-bottom: 0.45rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--sc-checkout-form-v2-cf-v2-label-text, color-mix(in srgb, var(--cf-v2-ink) 75%, var(--cf-v2-brand)));
}

/* Text / tel inputs */
.cf-v2__control:not(.cf-v2__control--select) {
	width: 100%;
	padding: 0.85rem 1rem;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--sc-checkout-form-v2-cf-v2-control-text, var(--cf-v2-ink));
	background: var(--cf-v2-field);
	border: 1px solid var(--sc-checkout-form-v2-cf-v2-control-border, color-mix(in srgb, var(--cf-v2-brand) 14%, transparent));
	border-radius: var(--cf-v2-radius-sm);
	box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease;
}

.cf-v2__control:not(.cf-v2__control--select):hover {
	border-color: var(--sc-checkout-form-v2-cf-v2-control-hover-border, color-mix(in srgb, var(--cf-v2-brand) 28%, transparent));
}

.cf-v2__control:not(.cf-v2__control--select):focus {
	outline: none;
	border-color: var(--sc-checkout-form-v2-cf-v2-control-focus-border, var(--cf-v2-brand));
	box-shadow:
		0 0 0 3px color-mix(in srgb, var(--cf-v2-brand) 22%, transparent),
		inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent);
}

/* Native select */
.cf-v2__select-wrap {
	position: relative;
}

.cf-v2__control--select {
	width: 100%;
	padding: 0.85rem 2.5rem 0.85rem 1rem;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--sc-checkout-form-v2-cf-v2-control-select-text, var(--cf-v2-ink));
	background: var(--cf-v2-field);
	border: 1px solid var(--sc-checkout-form-v2-cf-v2-control-select-border, color-mix(in srgb, var(--cf-v2-brand) 14%, transparent));
	border-radius: var(--cf-v2-radius-sm);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.cf-v2__select-wrap::after {
	content: "";
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid var(--cf-v2-brand);
	pointer-events: none;
	opacity: 0.75;
}

[dir="rtl"] .cf-v2__select-wrap::after {
	right: auto;
	left: 1rem;
}

[dir="rtl"] .cf-v2__control--select {
	padding-left: 2.5rem;
	padding-right: 1rem;
}

.cf-v2__control--select:hover,
.cf-v2__control--select:focus {
	border-color: var(--sc-checkout-form-v2-cf-v2-control-select-hover-border, color-mix(in srgb, var(--cf-v2-brand) 35%, transparent));
	outline: none;
}

.cf-v2__control--select:focus {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-v2-brand) 22%, transparent);
}

/* Delivery estimate */
.checkout-form--v2 .delivery-time-info,
.cf-v2__delivery-hint {
	margin-top: 0.65rem;
	padding: 0.5rem 0.75rem;
	display: none;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--sc-checkout-form-v2-delivery-time-info-text, color-mix(in srgb, var(--cf-v2-ink) 78%, var(--cf-v2-brand)));
	background: var(--sc-checkout-form-v2-delivery-time-info-bg, color-mix(in srgb, var(--cf-v2-brand) 9%, var(--primary-background-color, #fff)));
	border-radius: 10px;
	border: 1px solid var(--sc-checkout-form-v2-delivery-time-info-border, color-mix(in srgb, var(--cf-v2-brand) 12%, transparent));
}

.checkout-form--v2 .delivery-time-info i,
.cf-v2__delivery-hint i {
	margin-inline-end: 0.35rem;
	color: var(--sc-checkout-form-v2-delivery-time-info-icon-text, var(--cf-v2-brand));
	opacity: 0.9;
}

/* Searchable city — pill trigger, floating dropdown */
.checkout-form--v2 .cf-v2__searchable.searchable-select {
	position: relative;
	width: 100%;
}

.checkout-form--v2 .searchable-select-input {
	position: relative;
	cursor: pointer;
}

.checkout-form--v2 .searchable-select-input input {
	width: 100%;
	padding: 0.85rem 2.75rem 0.85rem 1.1rem;
	font-size: 1rem !important;
	line-height: 1.4;
	color: var(--sc-checkout-form-v2-searchable-select-input-input-text, var(--cf-v2-ink));
	background: var(--cf-v2-field);
	border: 1px solid var(--sc-checkout-form-v2-searchable-select-input-input-border, color-mix(in srgb, var(--cf-v2-brand) 14%, transparent));
	border-radius: 999px;
	cursor: pointer;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
	box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
}

.checkout-form--v2 .searchable-select-input input:focus {
	outline: none;
	border-color: var(--sc-checkout-form-v2-searchable-select-input-input-focus-border, var(--cf-v2-brand));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-v2-brand) 20%, transparent);
}

.checkout-form--v2 .searchable-select-input.selected input {
	border-color: var(--sc-checkout-form-v2-searchable-select-input-input-selected-border, color-mix(in srgb, var(--cf-v2-brand) 32%, transparent));
	background: var(--sc-checkout-form-v2-searchable-select-input-input-selected-bg, color-mix(in srgb, var(--cf-v2-field) 100%, transparent));
}

.checkout-form--v2 .searchable-select-input i {
	position: absolute;
	right: 1.1rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sc-checkout-form-v2-searchable-select-input-icon-text, var(--cf-v2-brand));
	pointer-events: none;
	font-size: 0.85rem;
	opacity: 0.85;
	transition: transform 0.25s ease;
}

.checkout-form--v2 .searchable-select-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: var(--sc-checkout-form-v2-searchable-select-dropdown-bg, color-mix(in srgb, var(--primary-background-color, #fff) 98%, transparent));
	border: 1px solid var(--sc-checkout-form-v2-searchable-select-dropdown-border, color-mix(in srgb, var(--cf-v2-brand) 16%, transparent));
	border-radius: var(--cf-v2-radius-sm);
	box-shadow:
		0 20px 50px rgba(15, 12, 10, 0.12),
		0 0 0 1px color-mix(in srgb, var(--cf-v2-brand) 8%, transparent);
	z-index: 1000;
	max-height: 300px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#city-dropdown {
	display: none;
}

.checkout-form--v2 .searchable-select-search {
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid var(--sc-checkout-form-v2-searchable-select-search-border-bottom, color-mix(in srgb, var(--cf-v2-brand) 12%, transparent));
	background: var(--sc-checkout-form-v2-searchable-select-search-bg, color-mix(in srgb, var(--cf-v2-surface) 80%, transparent));
}

.checkout-form--v2 .searchable-select-search input {
	width: 100%;
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--sc-checkout-form-v2-searchable-select-search-input-border, color-mix(in srgb, var(--cf-v2-brand) 14%, transparent));
	border-radius: 999px;
	font-size: 16px !important;
	background: var(--sc-checkout-form-v2-searchable-select-search-input-bg, var(--primary-background-color, #fff));
}

.checkout-form--v2 .searchable-select-search input:focus {
	outline: none;
	border-color: var(--sc-checkout-form-v2-searchable-select-search-input-focus-border, var(--cf-v2-brand));
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--cf-v2-brand) 18%, transparent);
}

.checkout-form--v2 .searchable-select-options {
	max-height: 250px;
	overflow-y: auto;
	padding: 0.4rem 0;
}

.checkout-form--v2 .searchable-select-option {
	padding: 0.65rem 1rem;
	cursor: pointer;
	transition: background 0.15s ease;
	color: var(--sc-checkout-form-v2-searchable-select-option-text, var(--cf-v2-ink));
	border-radius: 8px;
	margin: 0 0.35rem;
}

.checkout-form--v2 .searchable-select-option:hover {
	background: var(--sc-checkout-form-v2-searchable-select-option-hover-bg, color-mix(in srgb, var(--cf-v2-brand) 10%, transparent));
}

.checkout-form--v2 .searchable-select-no-results {
	padding: 1rem;
	text-align: center;
	color: var(--sc-checkout-form-v2-searchable-select-no-results-text, var(--cf-v2-muted));
	font-size: 0.9rem;
}

.checkout-form--v2 .searchable-select-options::-webkit-scrollbar {
	width: 7px;
}

.checkout-form--v2 .searchable-select-options::-webkit-scrollbar-track {
	background: var(--sc-checkout-form-v2-searchable-select-options-bg, transparent);
}

.checkout-form--v2 .searchable-select-options::-webkit-scrollbar-thumb {
	background: var(--sc-checkout-form-v2-searchable-select-options-bg-2, color-mix(in srgb, var(--cf-v2-brand) 35%, transparent));
	border-radius: 4px;
}

@media screen and (max-width: 768px) {
	.checkout-form--v2 .searchable-select-input input,
	.checkout-form--v2 .searchable-select-search input {
		font-size: 16px !important;
		-webkit-text-size-adjust: 100%;
	}
}

[dir="rtl"] .checkout-form--v2 .searchable-select-input i {
	right: auto;
	left: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
	.cf-v2__control,
	.checkout-form--v2 .searchable-select-input input {
		transition: none;
	}
}
