/* Cassa e conferma ordine */

.page-header--checkout .page-header__content {
	text-align: center;
	padding: 28px 0 8px;
}

.page-header--checkout .page-header__title {
	font-size: clamp(1.5rem, 4vw, 2.2rem);
	font-weight: 700;
	margin: 0;
	color: #1d2128;
}

.ph-checkout {
	padding: 8px 0 48px;
}

.ph-checkout__flash,
.ph-checkout__errors {
	margin: 0 0 18px;
	padding: 12px 14px;
	border-radius: 8px;
	background: #fdecec;
	border: 1px solid #f3c1c1;
	color: #8a1f1f;
}

.ph-checkout__flash ul,
.ph-checkout__errors ul {
	margin: 0;
	padding-left: 1.1rem;
}

.ph-checkout__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
	gap: 32px;
	align-items: start;
}

@media (max-width: 991px) {
	.ph-checkout__layout {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.ph-checkout__summary {
		order: -1;
	}

	.ph-checkout__summary-card {
		position: static;
		padding: 14px 16px;
	}

	.ph-checkout {
		padding: 4px 0 110px;
	}

	.page-header--checkout .page-header__content {
		padding: 16px 0 4px;
	}
}

.ph-checkout__section {
	margin-bottom: 24px;
	padding: 16px;
	border: 1px solid #e8ecf1;
	border-radius: 10px;
	background: #fff;
}

@media (max-width: 991px) {
	.ph-checkout__section {
		margin-bottom: 14px;
		padding: 12px;
	}
}

.ph-checkout__section-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 14px;
	color: #1d2128;
}

.ph-checkout__guest-note {
	margin: 8px 0 0;
	color: #7c818b;
	font-size: 0.9rem;
}

.ph-field {
	display: block;
	margin-bottom: 12px;
}

.ph-field__label {
	display: block;
	font-size: 0.82rem;
	color: #7c818b;
	margin-bottom: 5px;
}

.ph-field input,
.ph-field select,
.ph-checkout__notes textarea {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	border: 1px solid #d5d9de;
	border-radius: 8px;
	padding: 10px 12px;
	font: inherit;
	font-size: 16px; /* prevents iOS zoom */
	color: #1d2128;
	background: #fff;
	box-shadow: none;
	box-sizing: border-box;
}

.ph-field input:focus,
.ph-field select:focus,
.ph-checkout__notes textarea:focus {
	outline: none;
	border-color: #1d2128;
}

.ph-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 560px) {
	.ph-field-row {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.ph-checkout__address2 {
	display: none;
}

.ph-checkout__add-line {
	display: inline-block;
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	background: none;
	color: #3449ca;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.ph-payment-option {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border: 1px solid #1d2128;
	border-radius: 8px;
	padding: 12px;
	cursor: pointer;
	margin-bottom: 14px;
}

.ph-payment-option input {
	margin-top: 3px;
	flex-shrink: 0;
}

.ph-payment-option__title {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.ph-payment-option__desc {
	display: block;
	color: #7c818b;
	font-size: 0.88rem;
	line-height: 1.4;
}

.ph-checkout__note-toggle {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 12px;
	cursor: pointer;
}

.ph-checkout__notes textarea {
	min-height: 96px;
	resize: vertical;
}

.ph-checkout__legal {
	margin: 14px 0;
	font-size: 0.82rem;
	color: #7c818b;
	line-height: 1.45;
}

.ph-checkout__legal a {
	color: #1d2128;
	text-decoration: underline;
}

.ph-checkout__submit {
	display: block;
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: 8px;
	background: #1d2128;
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

.ph-checkout__submit:hover,
.ph-checkout__submit:focus-visible {
	background: #11151b;
}

.ph-checkout__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.ph-checkout__submit--desktop {
	display: block;
}

.ph-checkout__mobile-bar {
	display: none;
}

@media (max-width: 991px) {
	.ph-checkout__submit--desktop {
		display: none;
	}

	.ph-checkout__mobile-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-top: 1px solid #e6eaef;
		box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
	}

	.ph-checkout__mobile-bar-total {
		display: flex;
		flex-direction: column;
		min-width: 0;
	}

	.ph-checkout__mobile-bar-label {
		font-size: 0.75rem;
		color: #7c818b;
	}

	.ph-checkout__mobile-bar-amount {
		font-size: 1.05rem;
		font-weight: 700;
		color: #1d2128;
	}

	.ph-checkout__mobile-bar .ph-checkout__submit {
		width: auto;
		flex: 0 0 auto;
		min-width: 148px;
		padding: 0 16px;
		min-height: 46px;
	}

	/* Keep WhatsApp above content but clear of the bar */
	body.woocommerce-checkout .ph-whatsapp-button {
		bottom: 78px;
	}

	/* The theme's global bottom nav sits at z-index 999 and otherwise covers the order bar */
	body.woocommerce-checkout #motta-mobile-navigation-bar {
		display: none !important;
	}
}

.ph-checkout__summary-card {
	border: 1px solid #e6eaef;
	border-radius: 10px;
	padding: 18px;
	background: #fff;
	position: sticky;
	top: 24px;
}

.ph-checkout__summary-title {
	font-size: 1.1rem;
	margin: 0 0 14px;
}

.ph-checkout__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ph-checkout__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: start;
	margin-bottom: 14px;
}

.ph-checkout__item-thumb {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: 6px;
	overflow: visible;
	background: #f5f6f8;
}

.ph-checkout__item-thumb img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.ph-checkout__item-qty {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #1d2128;
	color: #fff;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ph-checkout__item-name {
	margin: 0 0 4px;
	font-size: 0.9rem;
	line-height: 1.35;
}

.ph-checkout__item-price {
	margin: 0;
	font-size: 0.82rem;
	color: #7c818b;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.ph-checkout__item-price del {
	opacity: 0.7;
}

.ph-checkout__save {
	display: inline-block;
	background: #eceff3;
	color: #1d2128;
	border-radius: 999px;
	padding: 2px 8px;
	font-size: 0.75rem;
}

.ph-checkout__item-total {
	font-weight: 600;
	white-space: nowrap;
	font-size: 0.92rem;
}

.ph-checkout__totals {
	display: grid;
	gap: 8px;
	border-top: 1px solid #ecf0f4;
	padding-top: 12px;
	margin-top: 4px;
}

.ph-checkout__total-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.92rem;
}

.ph-checkout__total-row--grand {
	font-weight: 700;
	font-size: 1.05rem;
	margin-top: 2px;
}

/* Order received */
/* .ph-order-received {
	padding: 8px 0 64px;
	max-width: 920px;
} */

.ph-order-received__thanks {
	font-size: 1.35rem;
	font-weight: 600;
	margin: 0 0 28px;
	text-align: center;
}

.ph-order-received__overview {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	list-style: none;
	margin: 0 0 28px;
	padding: 20px 0;
	border-top: 1px solid #ecf0f4;
	border-bottom: 1px solid #ecf0f4;
}

@media (max-width: 767px) {
	.ph-order-received__overview {
		grid-template-columns: 1fr 1fr;
	}
}

.ph-order-received__label {
	display: block;
	color: #7c818b;
	font-size: 0.85rem;
	margin-bottom: 4px;
}

.ph-order-received__instructions {
	margin-bottom: 32px;
	line-height: 1.55;
	color: #3a3f48;
}

.ph-bank-message p {
	margin: 0 0 12px;
}

.ph-bank-message p:last-child {
	margin-bottom: 0;
}

.ph-bank-details {
	display: grid;
	gap: 12px;
	margin: 16px 0 20px;
	padding: 16px 18px;
	border: 1px solid #ecf0f4;
	border-radius: 8px;
	background: #f8f9fb;
}

.ph-bank-details div {
	margin: 0;
}

.ph-bank-details dt {
	margin: 0;
	color: #7c818b;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ph-bank-details dd {
	margin: 2px 0 0;
	font-weight: 600;
}

.ph-bank-details__value {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0.03em;
	word-break: break-all;
}

.ph-order-received__details h2,
.ph-order-received__address h2 {
	font-size: 1.4rem;
	margin: 0 0 16px;
}

.ph-order-received__details .shop_table {
	width: 100%;
	border-collapse: collapse;
}

.ph-order-received__details .shop_table th,
.ph-order-received__details .shop_table td {
	padding: 12px 0;
	border-bottom: 1px solid #ecf0f4;
	text-align: left;
	vertical-align: top;
}

.ph-order-received__details .shop_table .product-total,
.ph-order-received__details .shop_table tfoot td {
	text-align: right;
}

.ph-order-received__invoice {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 18px;
	background: #3449ca;
	color: #fff !important;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none !important;
}

.ph-order-received__address {
	margin-top: 36px;
}

.ph-order-received__address address {
	font-style: normal;
	line-height: 1.6;
}
