/* ============================================================
   MOBILE — revisione telefono (15/09/2026)
   Caricato per ultimo (inc/enqueue.php). Correzioni per schermi piccoli e
   contrasto del footer (colori del footer su tutte le larghezze).
   Il contrasto dell'oro nei testi sta in style.css: --sofyia-gold-text.
   ============================================================ */

/* --- Select2: la <select> originale nascosta era larga quanto lo schermo
   e allargava la pagina (stili select2/WooCommerce disattivati dal tema; la
   regola "select 100%" del checkout vinceva: serve la stessa specificità). */
.select2-hidden-accessible,
form.checkout .form-row select.select2-hidden-accessible,
form.checkout .woocommerce-input-wrapper select.select2-hidden-accessible {
	border: 0 !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	height: 1px !important;
	min-height: 0 !important;
	width: 1px !important;
	margin: -1px !important;
	overflow: hidden !important;
	padding: 0 !important;
	position: absolute !important;
	white-space: nowrap !important;
}

/* --- Mini-carrello e menu laterale chiusi: parcheggiati appena fuori dallo
   schermo, l'ombra del mini-carrello entrava nella pagina (fascia grigia sul
   bordo destro di ogni pagina). Da chiusi: invisibili, senza ombra e fuori
   dall'ordine di tabulazione; spariscono solo a fine animazione. */
.sofyia-minicart:not(.is-open),
.sofyia-mobile-drawer:not(.is-open) {
	visibility: hidden;
	box-shadow: none;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.35s, box-shadow 0s linear 0.35s;
}
.sofyia-minicart.is-open,
.sofyia-mobile-drawer.is-open {
	visibility: visible;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Colonne a una sola traccia: minmax(0,1fr) invece di 1fr, altrimenti la
   colonna cresce fino al contenuto più largo (tendina varianti, tabelle). */
@media (max-width: 992px) {
	body.woocommerce-cart .woocommerce,
	form.checkout.woocommerce-checkout {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}
@media (max-width: 767px) {
	.sofyia-sp-layout {
		grid-template-columns: minmax(0, 1fr);
	}
	.sofyia-sp-gallery,
	.sofyia-sp-info {
		min-width: 0;
	}
	.sofyia-single-product table.variations {
		table-layout: fixed;
	}
	.sofyia-single-product .variations select {
		max-width: 100%;
		text-overflow: ellipsis;
	}
}

/* ============================================================
   CARRELLO — su telefono ogni riga diventa una scheda
   (foto a sinistra; nome, prezzo, quantità e subtotale a destra)
   ============================================================ */
@media (max-width: 768px) {
	body.woocommerce-cart table.shop_table.cart {
		display: block;
		width: 100%;
		padding: 0 !important;
	}
	body.woocommerce-cart table.shop_table.cart thead {
		display: none;
	}
	body.woocommerce-cart table.shop_table.cart tbody {
		display: block;
	}
	body.woocommerce-cart table.shop_table.cart tr.cart_item {
		display: grid;
		grid-template-columns: 76px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb name remove"
			"thumb price price"
			"thumb qty subtotal";
		column-gap: 14px;
		row-gap: 6px;
		align-items: center;
		padding: 16px;
		border-bottom: 1px solid #e8e3da;
	}
	body.woocommerce-cart table.shop_table.cart tr.cart_item td {
		display: block;
		padding: 0 !important;
		border: 0 !important;
		width: auto !important;
		min-width: 0 !important;
		text-align: left;
	}
	body.woocommerce-cart table.shop_table.cart td.product-thumbnail {
		grid-area: thumb;
		align-self: start;
	}
	body.woocommerce-cart table.shop_table.cart .product-thumbnail a,
	body.woocommerce-cart table.shop_table.cart .product-thumbnail img {
		width: 76px !important;
		height: 76px !important;
		min-width: 76px !important;
		max-width: 76px !important;
	}
	body.woocommerce-cart table.shop_table.cart td.product-name {
		grid-area: name;
		align-self: start;
	}
	body.woocommerce-cart table.shop_table.cart td.product-name a {
		font-size: 1.1rem;
		line-height: 1.25;
	}
	body.woocommerce-cart table.shop_table.cart td.product-name .variation {
		margin: 4px 0 0;
		font-size: 13px;
	}
	body.woocommerce-cart table.shop_table.cart td.product-remove {
		grid-area: remove;
		align-self: start;
	}
	body.woocommerce-cart table.shop_table.cart td.product-remove a.remove {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		margin: -8px -8px 0 0;
	}
	body.woocommerce-cart table.shop_table.cart td.product-price {
		grid-area: price;
		font-size: 14px;
		color: #6b6b6b;
	}
	body.woocommerce-cart table.shop_table.cart td.product-quantity {
		grid-area: qty;
	}
	body.woocommerce-cart table.shop_table.cart td.product-quantity .qty {
		width: 64px;
	}
	body.woocommerce-cart table.shop_table.cart td.product-subtotal {
		grid-area: subtotal;
		text-align: right;
		font-weight: 600;
	}
	/* Riga azioni (codice promozionale + aggiorna carrello) */
	body.woocommerce-cart table.shop_table.cart tr:not(.cart_item) {
		display: block;
	}
	body.woocommerce-cart table.shop_table.cart td.actions {
		display: block;
		padding: 16px !important;
	}
	body.woocommerce-cart .coupon {
		padding: 16px !important;
	}
	body.woocommerce-cart .coupon .input-text,
	body.woocommerce-cart .coupon button.button,
	body.woocommerce-cart button[name="update_cart"] {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}
	body.woocommerce-cart button[name="update_cart"] {
		margin-top: 12px;
	}
	/* Totali */
	body.woocommerce-cart .cart-collaterals .cart_totals {
		padding: 22px 16px;
	}
	body.woocommerce-cart .cart_totals table.shop_table {
		width: 100%;
	}
}

/* ============================================================
   CHECKOUT — margini laterali (il contenitore ha già il suo) e
   riepilogo ordine che sta nello schermo
   ============================================================ */
@media (max-width: 767px) {
	form.checkout.woocommerce-checkout {
		padding: 0 !important;
		gap: 28px !important;
	}
	form.checkout #order_review {
		padding: 20px 14px;
		position: static;
	}
	.woocommerce-checkout #order_review table.shop_table {
		width: 100%;
		table-layout: auto;
	}
	.woocommerce-checkout #order_review table.shop_table th,
	.woocommerce-checkout #order_review table.shop_table td {
		padding-left: 8px !important;
		padding-right: 8px !important;
	}
	form.checkout #customer_details h3,
	form.checkout #order_review_heading {
		font-size: 1.7rem;
	}

	/* Totali (carrello e riepilogo checkout): la riga "Spedizione" è un blocco
	   dentro una tabella e finiva nella sola prima colonna, con le card delle
	   spedizioni strette a sinistra. Righe flessibili a tutta larghezza. */
	.cart_totals table.shop_table,
	#order_review table.shop_table {
		display: block;
		width: 100%;
	}
	.cart_totals table.shop_table > tbody,
	#order_review table.shop_table > thead,
	#order_review table.shop_table > tbody,
	#order_review table.shop_table > tfoot {
		display: block;
	}
	.cart_totals table.shop_table tr,
	#order_review table.shop_table tr {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
	}
	.cart_totals table.shop_table tr > th,
	#order_review table.shop_table tr > th,
	#order_review table.shop_table tr > td.product-name {
		display: block;
		flex: 1 1 auto;
		text-align: left !important;
	}
	.cart_totals table.shop_table tr > td,
	#order_review table.shop_table tr > td {
		display: block;
		text-align: right !important;
	}
	#order_review table.shop_table tr > td.product-name {
		text-align: left !important;
	}
	#order_review table.shop_table thead th.product-total {
		flex: 0 0 auto;
		text-align: right !important;
	}
	.cart_totals table.shop_table tr.shipping,
	#order_review table.shop_table tr.shipping,
	.cart_totals table.shop_table tr.woocommerce-shipping-totals,
	#order_review table.shop_table tr.woocommerce-shipping-totals {
		display: block;
	}
	.cart_totals tr.shipping td,
	#order_review tr.shipping td,
	.woocommerce-shipping-totals td {
		text-align: left !important;
	}
}

/* Occhio "mostra password" anche nel checkout (creazione account obbligatoria):
   fuori da Il mio account era una barretta di 16×6 px. */
.woocommerce-checkout .password-input {
	position: relative;
	display: block;
}
.woocommerce-checkout .password-input input {
	padding-right: 46px !important;
}
.woocommerce-checkout .password-input .show-password-input {
	position: absolute;
	top: 0;
	right: 0;
	width: 46px;
	height: 100%;
	margin: 0;
	padding: 0;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.woocommerce-checkout .password-input .show-password-input::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 20px;
	height: 20px;
	opacity: 0.55;
	background: center / contain no-repeat
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.woocommerce-checkout .password-input .show-password-input.display-password::after {
	opacity: 0.9;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A87A50' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6a3 3 0 0 0 4.2 4.2'/%3E%3Cpath d='M9.4 5.2A10 10 0 0 1 12 5c6.5 0 10 7 10 7a18 18 0 0 1-2.4 3.4M6.5 6.5A18 18 0 0 0 2 12s3.5 7 10 7a10 10 0 0 0 2.6-.3'/%3E%3C/svg%3E");
}

/* ============================================================
   TESTI E BOTTONI TROPPO PICCOLI SU TELEFONO
   ============================================================ */
@media (max-width: 768px) {
	.btn-sofyia,
	.sofyia-btn {
		font-size: 12px;
	}
	.sofyia-ticker-content {
		font-size: 12px !important;
	}
	.sofyia-minicart__close {
		width: 44px;
		height: 44px;
		justify-content: center;
	}
	/* Bottone delle schede prodotto nelle griglie (era 9,5-10 px) */
	.woocommerce ul.products li.product .button {
		font-size: 11px !important;
		letter-spacing: 0.6px !important;
		line-height: 1.3 !important;
		min-height: 40px;
		white-space: normal;
		display: flex !important;
		align-items: center;
		justify-content: center;
	}
	.sofyia-footer__payments-label {
		font-size: 12px;
	}
	/* Pallini dello slider categorie: restano da 8px ma si toccano su 28×32 px */
	.sofyia-slider-dots {
		gap: 20px !important;
	}
	.sofyia-slider-dots > button {
		position: relative;
	}
	.sofyia-slider-dots > button::before {
		content: "";
		position: absolute;
		inset: -12px -10px;
	}
}

/* ============================================================
   FOOTER — contrasto leggibile (era bianco su azzurro 1,7:1).
   Testi scuri 8,4:1, titoli bronzo 5:1 (famiglia oro Sofyia).
   ============================================================ */
.sofyia-footer-main {
	color: #2C2C2C;
}
.sofyia-footer-main__brand-name,
.sofyia-footer-main__payoff {
	color: #2C2C2C !important; /* style.css lo forza bianco con !important */
}
.sofyia-footer-main__brand-text {
	color: #2C2C2C;
}
.sofyia-footer-main__social-link {
	border-color: rgba(44, 44, 44, 0.55);
	color: #2C2C2C;
}
.sofyia-footer-main__social-link:hover {
	background: #6B4526;
	border-color: #6B4526;
	color: #ffffff;
}
.sofyia-footer-main__col-title {
	color: #6B4526 !important;
	border-bottom-color: rgba(107, 69, 38, 0.35);
}
.sofyia-footer-main__col-icon,
.sofyia-footer-main__contact-item svg {
	color: #6B4526;
}
.sofyia-footer-main__menu a,
.sofyia-footer-main__contact-item,
.sofyia-footer-main__contact-item a {
	color: #2C2C2C;
}
.sofyia-footer-main__menu a:hover,
.sofyia-footer-main__contact-item a:hover {
	color: #6B4526;
	text-decoration: underline;
}
.sofyia-footer-main__logo.is-filter-white .sofyia-footer-main__logo-img {
	filter: brightness(0) opacity(0.85);
}
@media (max-width: 768px) {
	.sofyia-footer-main__col--brand,
	details.sofyia-footer-main__col {
		border-bottom-color: rgba(44, 44, 44, 0.18);
	}
	/* L'ultima riga del footer non finisce sotto il bottone WhatsApp */
	.gaw-footer-legal {
		padding-bottom: 86px !important;
	}
}

/* Titolo H2 della home su telefono (21,6px): in grassetto conta come testo
   grande, così l'oro del brand (3,8:1) basta senza scurirlo. */
@media (max-width: 600px) {
	body.home h2.wp-block-heading,
	body.page-id-65 h2.wp-block-heading {
		font-weight: 700 !important;
	}
}
