/**
 * ff-checkout.css — layout Figma "Rela Ortofrutta" (node 536-5258)
 * Percorso: wp-content/themes/TUO-TEMA-CHILD/assets/css/ff-checkout.css
 *
 * Carica DOPO ff-minicart.css: riusa le variabili --rela-*.
 * Se lo carichi da solo, scommenta il blocco :root qui sotto.
 *
 * Layout a griglia: riga notice full-width in cima, poi due colonne
 * (form a sinistra, riepilogo ordine sticky a destra).
 * Quantità nel riepilogo in sola lettura ("× N").
 */

/*
:root {
	--rela-verde: #005f46;
	--rela-verde-scuro: #003a2b;
	--rela-verde-chiaro: #8bc34a;
	--rela-verde-50: #cfe6b5;
	--rela-black-text: #3b3b3b;
	--rela-gray-accessible: #6f6f6f;
	--rela-gray-stroke: #d9d9d9;
	--rela-text-dark: #1a1a18;
	--rela-font-display: 'Fraunces', Georgia, serif;
	--rela-font-body: 'Urbanist', -apple-system, sans-serif;
}
*/

/* ============================================================
   LAYOUT — GRID: notice full-width + due colonne
   ============================================================ */

.woocommerce-info{
    display: none;
}

.ff-checkout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 505px;
	grid-template-areas:
		"notice notice"
		"form   side";
	column-gap: 40px;
	align-items: start;
	max-width: 1240px;
	margin: 0 auto;
	padding: 32px 0px 64px 0px;
	font-family: var(--rela-font-body);
	color: var(--rela-black-text);
}

.ff-checkout__form {
	grid-area: form;
	min-width: 0;
	max-width: 608px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ff-checkout__side {
	grid-area: side;
	min-width: 0;
}

/* Elementi tecnici nascosti: fuori dal grid flow */
.ff-checkout > input[type="hidden"],
.ff-checkout > wc-order-attribution-inputs {
	display: none;
}

/* ============================================================
   NOTICE DI ERRORE (in cima, full-width)
   ============================================================ */

.ff-checkout > .woocommerce-NoticeGroup {
	grid-area: notice;
	width: 100%;
	margin: 0 0 24px;
}

/* Spegni l'icona-font unica del contenitore WooCommerce */
.ff-checkout .woocommerce-error::before {
	content: none !important;
	display: none !important;
}

.ff-checkout .woocommerce-error {
	list-style: none !important;
	margin: 0 !important;
	padding: 16px 20px !important;
	background: #fdecea;
	border: 1px solid #f5c6c2;
	border-left: 4px solid #c0392b;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ff-checkout .woocommerce-error li {
	position: relative;
	margin: 0 !important;
	padding: 2px 0 2px 32px !important;
	list-style: none !important;
	font-family: var(--rela-font-body);
	font-size: 15px;
	line-height: 1.5;
	font-weight: 500;
	color: #7a271f;
}

.ff-checkout .woocommerce-error li::before {
	content: "!" !important;
	position: absolute !important;
	left: 0 !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 20px !important;
	height: 20px !important;
	border-radius: 50% !important;
	background: #c0392b !important;
	color: #fff !important;
	font: 700 13px/20px var(--rela-font-body) !important;
	text-align: center !important;
	display: block !important;
}

.ff-checkout .woocommerce-error li a {
	color: #7a271f;
	text-decoration: underline;
}

.ff-checkout .woocommerce-error li strong {
	font-weight: 600;
}

/* Errori inline sotto ai campi */
.ff-checkout .checkout-inline-error-message {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: #c0392b;
}

/* Messaggi info (es. "nessun metodo di pagamento") */
.ff-checkout .woocommerce-info,
.ff-checkout .woocommerce-message {
	position: relative;
	font-family: var(--rela-font-body);
	font-size: 15px;
	line-height: 1.45;
	color: var(--rela-black-text);
	background: #f4f7f0;
	border: 1px solid var(--rela-verde-50);
	border-left: 4px solid var(--rela-verde-chiaro);
	border-radius: 8px;
	padding: 14px 20px;
	list-style: none;
}

/* Spegni anche qui l'icona-font WooCommerce */
.ff-checkout .woocommerce-info::before,
.ff-checkout .woocommerce-message::before {
	content: none !important;
	display: none !important;
}

.ff-checkout .woocommerce-info a,
.ff-checkout .woocommerce-message a {
	color: var(--rela-verde);
	text-decoration: underline;
}

/* ============================================================
   COLONNA SINISTRA — FORM
   ============================================================ */

.ff-checkout__h {
	margin: 0;
	font-family: var(--rela-font-body);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--rela-black-text);
}

.ff-checkout__h--data {
	margin-top: 24px;
}

.ff-checkout__pickup-head {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 16px;
}

.ff-checkout__sub {
	margin: 0;
	font-size: 16px;
	line-height: 1.41;
	color: var(--rela-gray-accessible);
}

.ff-checkout__link {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.61;
	color: var(--rela-black-text);
	text-decoration: underline;
}

/* Chip giorni (Lun…Sab) */
.ff-daychips {
	display: flex;
	gap: 20px;
}

.ff-daychip {
	flex: 1 1 0;
	cursor: pointer;
}

.ff-daychip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ff-daychip span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	border: 1px solid var(--rela-gray-stroke);
	border-radius: 12px;
	font-size: 16px;
	line-height: 1.45;
	color: var(--rela-black-text);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.ff-daychip:hover span {
	border-color: var(--rela-verde-chiaro);
}

.ff-daychip input:checked + span {
	border-color: var(--rela-verde);
	background: var(--rela-verde-50);
	font-weight: 600;
}

.ff-daychip input:focus-visible + span {
	outline: 2px solid var(--rela-verde);
	outline-offset: 2px;
}

/* ---------- Campi form: nascondiamo titoli/sezioni native ---------- */

.ff-checkout .woocommerce-billing-fields > h3,
.ff-checkout .woocommerce-additional-fields > h3,
.ff-checkout .woocommerce-shipping-fields,
.ff-checkout #ship-to-different-address {
	display: none;
}

.ff-checkout .form-row {
	margin: 0 0 16px;
	padding: 0;
}

/* Nome e telefono affiancati */
.ff-checkout .form-row-first,
.ff-checkout .form-row-last {
	display: inline-block;
	width: calc(50% - 10px);
	vertical-align: top;
}

.ff-checkout .form-row-first {
	margin-right: 20px;
}

.ff-checkout label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--rela-black-text);
}

.ff-checkout label .required {
	color: #dd0000;
	text-decoration: none;
	border: 0;
}

.ff-checkout label .optional {
	color: var(--rela-gray-accessible);
}

.ff-checkout .woocommerce-input-wrapper {
	width: 100%;
}

.ff-checkout input.input-text,
.ff-checkout textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--rela-gray-stroke);
	border-radius: 6px;
	font-family: var(--rela-font-body);
	font-size: 14px;
	line-height: 1.4;
	color: var(--rela-black-text);
	background: #fff;
	box-shadow: none;
}

.ff-checkout input.input-text::placeholder,
.ff-checkout textarea::placeholder {
	color: var(--rela-gray-accessible);
}

.ff-checkout input.input-text:focus,
.ff-checkout textarea:focus {
	border-color: var(--rela-verde);
	outline: none;
}

.ff-checkout textarea {
	min-height: 64px;
	resize: vertical;
}

/* Campi non validi in rosso */
.ff-checkout .woocommerce-invalid input.input-text {
	border-color: #c0392b;
}

.ff-checkout .woocommerce-invalid label {
	color: #c0392b;
}

/* Nota banco a tutta larghezza */
.ff-checkout .ff-field--note {
	width: 100%;
	display: block;
}

/* ---------- Metodi di pagamento ---------- */

.ff-checkout__paytitle {
	margin: 8px 0 0;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--rela-black-text);
}

.ff-checkout__payment ul.payment_methods {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ff-checkout__payment li.wc_payment_method {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ff-checkout__payment li.wc_payment_method > input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ff-checkout__payment li.wc_payment_method > label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 18px;
	line-height: 1.45;
	color: var(--rela-black-text);
	cursor: pointer;
}

.ff-checkout__payment li.wc_payment_method > label::before {
	content: "";
	width: 17px;
	height: 17px;
	border: 1px solid var(--rela-gray-stroke);
	border-radius: 50%;
	flex-shrink: 0;
	transition: border-color 0.15s ease;
}

.ff-checkout__payment li.wc_payment_method > input[type="radio"]:checked + label::before {
	border-color: var(--rela-verde-chiaro);
	background: radial-gradient(circle, var(--rela-verde-chiaro) 0 6.5px, transparent 7px);
}

.ff-checkout__payment li.wc_payment_method > input[type="radio"]:focus-visible + label::before {
	outline: 2px solid var(--rela-verde);
	outline-offset: 2px;
}

.ff-checkout__payment .payment_box {
	flex: 0 0 100%;
	margin: 4px 0 0;
	padding: 12px 0 0;
	background: none;
	font-size: 14px;
	color: var(--rela-gray-accessible);
}

.ff-checkout__payment .payment_box::before {
	display: none;
}

/* Il place-order (bottone viola) e privacy nativa dentro #payment:
   nascosti perché il vero bottone è nel riepilogo a destra */
.ff-checkout__form #payment .place-order {
	display: none;
}

.ff-checkout__form #payment {
	background: none;
	border-radius: 0;
}

.ff-checkout__form #payment .woocommerce-terms-and-conditions-wrapper,
.ff-checkout__form #payment .woocommerce-privacy-policy-text {
	display: none;
}

.ff-checkout__privacy {
	margin: 4px 0 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--rela-gray-accessible);
}

/* ============================================================
   COLONNA DESTRA — RIEPILOGO ORDINE (sticky)
   ============================================================ */

.ff-checkout__review {
	position: sticky;
	top: 24px;
	border: 1px solid var(--rela-gray-stroke);
	border-radius: 10px;
	padding: 16px;
	background: #fff;
}

.ff-checkout__review-title {
	margin: 0 0 28px;
	font-family: var(--rela-font-display);
	font-optical-sizing: auto;
	font-variation-settings: 'SOFT' 0, 'WONK' 1;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.96px;
	color: var(--rela-verde);
}

.ff-order__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ff-order__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 0;
	border-bottom: 0.5px solid var(--rela-gray-stroke);
}

.ff-order__thumb {
	flex: 0 0 75px;
}

.ff-order__thumb img {
	width: 75px;
	height: 75px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.ff-order__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ff-order__nameline {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ff-order__name {
	font-size: 24px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--rela-text-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ff-order__unit {
	font-size: 16px;
	color: var(--rela-gray-accessible);
	flex-shrink: 0;
}

/* Quantità in sola lettura (× N) */
.ff-order__count {
	font-family: var(--rela-font-body);
	font-size: 18px;
	font-weight: 600;
	color: var(--rela-gray-accessible);
}

.ff-order__side {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
	flex-shrink: 0;
}

.ff-order__price {
	font-size: 24px;
	font-weight: 500;
	line-height: 1.33;
	color: var(--rela-black-text);
	white-space: nowrap;
}

/* ---------- Totale + bottone ---------- */

.ff-order__foot {
	margin-top: 28px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ff-order__total {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
}

.ff-order__total-label {
	font-size: 24px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--rela-black-text);
}

.ff-order__total-amount {
	font-size: 32px;
	font-weight: 600;
	color: var(--rela-verde);
}

.ff-order__total-amount strong,
.ff-order__total-amount .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

.ff-order__tax-note {
	margin: -4px 0 0;
	font-size: 12px;
	line-height: 1.48;
	color: var(--rela-gray-accessible);
}

/* Bottone verde — forzato sopra lo stile .button.alt del tema */
.ff-checkout .ff-order__submit.button,
.ff-checkout .ff-order__submit.button.alt,
.ff-checkout button.ff-order__submit {
	width: 100%;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--rela-verde-chiaro);
	background-image: none;
	color: var(--rela-verde-scuro);
	font-family: var(--rela-font-body);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.45;
	border: 0;
	border-radius: 10px;
	padding: 8px 16px;
	cursor: pointer;
	text-shadow: none;
	transition: background 0.15s ease;
}

.ff-checkout .ff-order__submit.button:hover,
.ff-checkout .ff-order__submit.button.alt:hover {
	background: #7db23f;
	color: var(--rela-verde-scuro);
}

/* Privacy nativa duplicata dentro il riepilogo: nascosta */
.ff-checkout__side .ff-order__foot .woocommerce-terms-and-conditions-wrapper {
	display: none;
}


.woocommerce form .form-row .input-text, .woocommerce form .form-row select{
    border: 1px solid #D9D9D9 !important;
}
/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
	.ff-checkout {
		grid-template-columns: 1fr;
		grid-template-areas:
			"notice"
			"form"
			"side";
		column-gap: 0;
		row-gap: 32px;
	}

	.ff-checkout__form,
	.ff-checkout__side {
		max-width: none;
	}

	.ff-checkout__review {
		position: static;
	}
}

@media (max-width: 560px) {
	.ff-daychips {
		gap: 8px;
	}
	
	/* Nome prodotto: leggibile per intero, va a capo invece di troncarsi */
.ff-checkout .ff-order__name {
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}
	.ff-checkout .ff-order__nameline {
		flex-wrap: wrap;
		row-gap: 2px;
	}

	.ff-checkout .form-row-first,
	.ff-checkout .form-row-last {
		display: block;
		width: 100%;
		margin-right: 0;
	}

	.ff-order__name {
		font-size: 18px;
	}

	.ff-order__price {
		font-size: 18px;
		font-weight: 600;
	}

	.ff-checkout__review-title {
		font-size: 18px;
		letter-spacing: -0.54px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ff-daychip span,
	.ff-checkout .ff-order__submit.button {
		transition: none;
	}
}