:root {
	--f-brand: #2271b1;
	--f-brand-soft: #f0f6fb;
	--f-primary: #1e1e1e;
	--f-secondary: #646970;
	--f-success: #00a32a;
	--f-border: #dcdcde;
	--f-bg-main: #f0f0f1;
	--f-bg-card: #ffffff;
	--f-text: #1d2327;
	--f-text-muted: #8c8f94;
	--f-radius: 16px;
	--f-radius-sm: 8px;
	--f-transition: all 0.25s ease;
}

.foodord-layout-settings {
	margin: 24px 20px 60px 0;
}

.foodord-layout-settings .description {
	margin-bottom: 20px;
}

.foodord-layout-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
	gap: 32px;
	margin: 32px 0;
}

.foodord-layout-card {
	background: var(--f-bg-card);
	border: 1px solid var(--f-border);
	border-radius: var(--f-radius);
	padding: 0;
	transition: var(--f-transition);
	cursor: pointer;
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.foodord-layout-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
	pointer-events: none;
	opacity: 0;
	transition: var(--f-transition);
}

.foodord-layout-card:hover {
	transform: translateY(-8px);
	border-color: var(--f-text-muted);
}

.foodord-layout-card:active {
	transform: translateY(-4px) scale(0.98);
}

.foodord-layout-card:hover::before {
	opacity: 1;
}

.foodord-layout-card.is-active {
	border-color: var(--f-brand);
	border-width: 2px;
}

.foodord-layout-card__header {
	padding: 24px 28px;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	background: #ffffff;
	border-bottom: 1px solid var(--f-border);
}

.foodord-layout-card__info {
	flex: 1;
	padding-right: 20px;
}

.foodord-layout-card__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--f-primary);
	display: flex;
	align-items: center;
	gap: 8px;
}

.foodord-layout-card.is-active .foodord-layout-card__title::after {
	content: 'Selected';
	font-size: 10px;
	text-transform: uppercase;
	background: var(--f-brand);
	color: #fff;
	padding: 2px 8px;
	border-radius: 10px;
	letter-spacing: 0.05em;
}

.foodord-layout-card__description {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--f-secondary);
	line-height: 1.5;
}

.foodord-layout-card__choice {
	padding-top: 4px;
}

.wp-admin .foodord-layout-settings .foodord-layout-card__choice input[type="radio"] {
	appearance: none;
	background: #fff;
	border: 2px solid var(--f-border);
	border-radius: 50%;
	cursor: pointer;
	height: 24px;
	width: 24px;
	margin: 0;
	position: relative;
	transition: var(--f-transition);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.wp-admin .foodord-layout-settings .foodord-layout-card.is-active .foodord-layout-card__choice input[type="radio"] {
	border-color: var(--f-brand);
	background: var(--f-brand);
}

.wp-admin .foodord-layout-settings .foodord-layout-card__choice input[type="radio"]::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0);
	width: 8px;
	height: 8px;
	background: #fff;
	border-radius: 50%;
	transition: var(--f-transition);
}

.wp-admin .foodord-layout-settings .foodord-layout-card__choice input[type="radio"]:checked::after {
	transform: translate(-50%, -50%) scale(1);
}

.foodord-layout-card__preview {
	padding: 40px;
	background: var(--f-bg-main);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	position: relative;
	overflow: hidden;
}

/* Subtle background pattern for preview */
.foodord-layout-card__preview::after {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(var(--f-border) 1px, transparent 1px);
	background-size: 20px 20px;
	opacity: 0.4;
	pointer-events: none;
}

.foodord-layout-card__preview .foodord-products-shortcode {
	width: 100%;
	display: flex;
	justify-content: center;
	position: relative;
	z-index: 1;
}

.foodord-layout-card__preview .foodord-products-shortcode .foodord-product-card {
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	pointer-events: none;
}

/* Override shortcode styles for cleaner preview */
.foodord-layout-card__preview .foodord-product-card .product-title {
	font-size: 16px;
	font-weight: 700;
}

.foodord-layout-card__preview .foodord-product-card .product-description-text {
	font-size: 13px;
	line-height: 1.4;
	color: var(--f-secondary);
}

.foodord-layout-card[data-foodord-layout-card="classic"] .foodord-layout-card__preview .foodord-product-card .product-actions,
.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions {
	top: 0;
	right: 0;
	align-self: flex-end;
	margin-left: auto;
}

.foodord-layout-card__preview .foodord-product-card .product-actions .button,
.foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button {
	appearance: none;
	background: #ffffff;
	border: 1px solid rgba(148, 163, 184, 0.45);
	border-radius: 50%;
	box-shadow: none;
	box-sizing: border-box;
	color: #1d2327;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	min-width: 36px;
	height: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	position: relative;
	text-indent: -9999px;
	overflow: hidden;
	transform: none;
}

.foodord-layout-card__preview .foodord-product-card .product-actions .button::before,
.foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button::before,
.foodord-layout-card__preview .foodord-product-card .product-actions .button::after,
.foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	display: block;
	background: currentColor;
	border-radius: 2px;
	transform: translate(-50%, -50%);
}

.foodord-layout-card__preview .foodord-product-card .product-actions .button::before,
.foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button::before {
	width: 16px;
	height: 2px;
}

.foodord-layout-card__preview .foodord-product-card .product-actions .button::after,
.foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button::after {
	width: 2px;
	height: 16px;
}

.foodord-layout-card__preview .foodord-product-card .product-actions .button:hover,
.foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button:hover {
	background: #f8fafc;
	border-color: rgba(100, 116, 139, 0.55);
	color: #1d2327;
	transform: none;
}

.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions .button,
.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button {
	background: #ea004b;
	border: none;
	border-radius: 8px;
	color: #ffffff;
	width: 32px;
	min-width: 32px;
	height: 32px;
	min-height: 32px;
}

.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions .button::before,
.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button::before,
.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions .button::after,
.foodord-layout-card[data-foodord-layout-card="grid"] .foodord-layout-card__preview .foodord-product-card .product-actions .add_to_cart_button::after {
	background: #ffffff;
}

.foodord-layout-settings .submit {
	margin-top: 32px;
	padding-top: 0;
}

@media (max-width: 1100px) {
	.foodord-layout-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 782px) {
	.foodord-layout-grid {
		gap: 20px;
		margin: 20px 0;
	}

	.foodord-layout-card__preview {
		padding: 24px;
	}
}
