/* ============================================================
   AGM — Shop frontend: stili responsivi
   Portato dal child theme gallomacellerie-child/css/fe-responsive.css
   Applicato sulle pagine WooCommerce quando shop_custom_layout è attivo.
   ============================================================ */

/* ============================================================
   Sidebar iniettata dal plugin (tutti i breakpoint)
   Usata quando il tema non fornisce il proprio #sidebar_container.
   ============================================================ */

/* Blocca lo scroll della pagina quando la sidebar è aperta */
html.let-it-fixed {
	overflow: hidden;
}

/* Sidebar AGM: fixed su tutti i breakpoint, slide-in da destra */
.agm-sidebar-injected {
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	width: min(380px, 100vw) !important;
	height: 100% !important;
	overflow-y: auto !important;
	background: rgba(255, 255, 255, 0.97) !important;
	padding-top: 0 !important;
	padding-bottom: 50px !important;
	z-index: 1060;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.14);
	-webkit-transition: all 600ms ease-in-out;
	-moz-transition: all 600ms ease-in-out;
	transition: all 600ms ease-in-out;
}
.agm-sidebar-injected.mobile-right {
	right: -100% !important;
}

/* Pulsante "Chiudi" in cima alla sidebar */
#sidebarCloser {
	border-bottom: 1px solid #dee2e6;
	border-radius: 0;
}

/* Pulsante "Rimuovi" nel mini cart */
.custom-cart-container a.remove.remove_from_cart_button {
    font-family: sans-serif;
    font-size: 1.2em;
    letter-spacing: .03em;
    width: auto;
    text-align: left;
    flex-grow: 0;
    display: inline-block !important;
    margin-left: 10px;
	opacity: .7;
    float: right !important;
    padding-top: 5px !important;
}

.woocommerce-mini-cart li.woocommerce-mini-cart-item.pr-1.mini_cart_item {
    padding: 7px 0px !important;
}

.woocommerce-mini-cart li.woocommerce-mini-cart-item.pr-1.mini_cart_item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.woocommerce-mini-cart li.woocommerce-mini-cart-item.pr-1.mini_cart_item:last-child {
    margin-bottom: 15px !important;
}

.woocommerce-mini-cart dl.variation dd p,
.woocommerce-mini-cart dl.variation dd p:last-child {
    padding: 0px !important;
}

.woocommerce-mini-cart dl.variation dd {
    margin-bottom: 0px !important;
    padding-bottom: 0px;
    padding-left: 5px !important;
    height: auto;
    line-height: 1.5em;
	clear: none !important;
	float: none !important;
}

.woocommerce-mini-cart dl.variation dt {
    height: auto;
    line-height: 1.5em;
	clear: none !important;
	float: none !important;
}

.woocommerce-mini-cart dl.variation dt:not(:first-child) {
    margin-left: 10px !important;
}

.custom-cart-container a.remove.remove_from_cart_button:hover {
    background: transparent;
    color: var(--wc-red) !important;
	opacity: 1;
}

/* Pulsante "Vedi Carrello" — visibile su tutti i breakpoint quando la sidebar è del plugin */
.agm-mobile-cart-btn {
	display: block !important;
	background: #E8A743;
	z-index: 1050;
}
.agm-mobile-cart-btn .btn {
	background: #E8A743;
	border-radius: 0;
	border: 0;
	text-transform: uppercase;
	font-weight: bold;
	letter-spacing: 0.03em;
	font-size: 17px;
	color: #fff;
}

/* Overlay AJAX — spinner centrato */
.fe-overlay {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.7);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Alert container — posizionato in alto a sinistra */
.custom-alert-container {
	top: 80px;
	z-index: 9998;
}

/* Etichetta variante bundle nel mini-cart (es. "Al sangue") */
.agm-bundle-variation {
	display: block;
	font-size: 0.85em;
	opacity: 0.75;
}

/* ============================================================
   SMALL DEVICES (< 576px)
   ============================================================ */
/* SMALL DEVICES (< 576px) */
@media only screen and (max-width: 576px) {

	h3.grid-product-title {
		font-size: 17px;
		letter-spacing: 0.03em;
		text-transform: none;
		font-weight: 700;
		margin: 10px 0;
	}

	.product-price-container {
		font-size: 15px;
		line-height: 19px;
	}

	/* Sidebar mini-cart: posizionamento fisso fuori schermo su mobile */
	.mobile-right {
		position: fixed !important;
		right: -100%;
		top: 0;
	}

	#sidebar_container {
		position: fixed !important;
		background: rgba(255, 255, 255, 0.95);
		height: 100%;
		overflow-y: auto;
		top: 0;
		padding-bottom: 50px;
		padding-top: 90px;
		-webkit-transition: all 600ms ease-in-out;
		-moz-transition: all 600ms ease-in-out;
		-ms-transition: all 600ms ease-in-out;
		-o-transition: all 600ms ease-in-out;
		transition: all 600ms ease-in-out;
	}

	/* Pulsante mostra carrello su mobile */
	#mobileCartShow {
		background: #E8A743;
		border-radius: 0;
		border: 0;
		text-transform: uppercase;
		font-weight: bold;
		letter-spacing: 0.03em;
		font-size: 17px;
	}

	/* Altezza massima lista prodotti nel mini-cart */
	ul.woocommerce-mini-cart.cart_list.product_list_widget {
		max-height: 33vh;
	}

	.custom-form-row {
		width: 100%;
	}

	/* Input datepicker a larghezza piena */
	input#wc-local-pickup-plus-datepicker-0 {
		width: 100%;
		max-width: none;
	}

	/* Privacy policy testo più piccolo */
	.woocommerce-privacy-policy-text p {
		text-align: left;
		font-size: 13px !important;
		line-height: 15px;
	}

	.back-btn {
		width: 100%;
	}
}

/* ============================================================
   AGM — Utility frontend isolate (prefisso agm-)
   Sostituiscono le classi Bootstrap sulle pagine shop/categoria.
   Non dipendono da Bootstrap: zero conflitti con tema e checkout.
   ============================================================ */

/* ---- Grid: contenitore ---- */
.agm-container {
	width: 100%;
	padding-right: 15px;
	padding-left: 15px;
	margin-right: auto;
	margin-left: auto;
}
@media (min-width: 576px)  { .agm-container { max-width: 540px; } }
@media (min-width: 768px)  { .agm-container { max-width: 720px; } }
@media (min-width: 992px)  { .agm-container { max-width: 960px; } }
@media (min-width: 1200px) { .agm-container { max-width: 1140px; } }

/* ---- Grid: riga ---- */
.agm-row {
	display: flex;
	flex-wrap: wrap;
	margin-right: -15px;
	margin-left: -15px;
}

.agm-row.product, .agm-row.product .agm-row {
	margin-right: 0px;
	margin-left: 0px;
	width: 100%;
}

.custom-add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Grid: colonne — base (mobile-first, 100%) ---- */
[class*="agm-col-"] {
	box-sizing: border-box;
	position: relative;
	width: 100%;
	padding-right: 15px;
	padding-left: 15px;
}
.agm-col-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.agm-col-6  { flex: 0 0 50%;        max-width: 50%; }
.agm-col-12 { flex: 0 0 100%;       max-width: 100%; }

/* ---- Grid: colonne — breakpoint md (≥768px) ---- */
@media (min-width: 768px) {
	.agm-col-md-3 { flex: 0 0 25%;        max-width: 25%; }
	.agm-col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
	.agm-col-md-6 { flex: 0 0 50%;        max-width: 50%; }
	.agm-col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

/* ---- Display ---- */
.agm-d-none  { display: none  !important; }
.agm-d-block { display: block !important; }
@media (min-width: 768px) {
	.agm-d-md-none  { display: none  !important; }
	.agm-d-md-block { display: block !important; }
}

/* ---- Flexbox ---- */
.agm-align-items-center { align-items: center !important; }

/* ---- Spaziatura — margini ---- */
.agm-m-0  { margin: 0 !important; }
.agm-mt-1 { margin-top: 0.25rem !important; }
.agm-mr-3 { margin-right: 1rem !important; }
@media (min-width: 768px) {
	.agm-mt-md-5 { margin-top: 3rem !important; }
}

/* ---- Spaziatura — padding ---- */
.agm-p-0  { padding: 0 !important; }
.agm-px-0 { padding-right: 0 !important; padding-left: 0 !important; }
.agm-px-3 { padding-right: 1rem !important; padding-left: 1rem !important; }
.agm-py-3 { padding-top: 1rem   !important; padding-bottom: 1rem   !important; }
.agm-py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.agm-py-5 { padding-top: 3rem   !important; padding-bottom: 3rem   !important; }
.agm-pt-0 { padding-top: 0 !important; }
.agm-pt-3 { padding-top: 1rem !important; }
.agm-pb-4 { padding-bottom: 1.5rem !important; }
.agm-pb-5 { padding-bottom: 3rem !important; }
.agm-pl-3 { padding-left: 1rem !important; }
@media (min-width: 768px) {
	.agm-pt-md-5 { padding-top: 3rem !important; }
}

/* ---- Posizionamento ---- */
.agm-position-fixed { position: fixed !important; }
.agm-fixed-bottom {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1030;
}

/* ---- Tipografia ---- */
.agm-text-center  { text-align: center !important; }
.agm-text-dark    { color: #343a40 !important; }
.agm-text-success { color: #155724 !important; }
.agm-text-danger  { color: #721c24 !important; }
.agm-lead {
	font-size: 1.1rem;
	font-weight: 300;
	margin-bottom: 0;
}

/* ---- Bordi ---- */
.agm-border-bottom { border-bottom: 1px solid #dee2e6 !important; }

/* ---- Immagini ---- */
.agm-img-fluid { max-width: 100%; height: auto; }

/* ---- Form ---- */
.agm-form-control {
	display: block;
	width: 100%;
	padding: 0.375rem 0.75rem;
	font-size: 1rem;
	line-height: 1.5;
	color: #495057;
	background-color: #fff;
	border: 1px solid #ced4da;
	border-radius: 0.25rem;
	box-sizing: border-box;
}
.agm-form-control:focus {
	border-color: #80bdff;
	outline: 0;
	box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ---- Bottoni ---- */
.agm-btn {
	display: inline-block;
	font-weight: 400;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	user-select: none;
	background-color: transparent;
	border: 1px solid transparent;
	padding: 0.375rem 0.75rem;
	font-size: 1rem;
	line-height: 1.5;
	border-radius: 2px;
	text-decoration: none;
	transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
	box-sizing: border-box;
}
.agm-btn:hover { text-decoration: none; }
.agm-btn:focus { outline: 0; }
.agm-btn.disabled,
.agm-btn[disabled] { opacity: 0.65; pointer-events: none; }

.agm-btn-primary       { color: #fff; background-color: #444444; border-color: #444444; }
.agm-btn-primary:hover { color: #fff; background-color: #2f2d2d; border-color: #2f2d2d; }
.agm-btn-success       { color: #fff; background-color: #74a57f; border-color: #74a57f; }
.agm-btn-success:hover { color: #fff; background-color: #679371; border-color: #679371; }
.agm-btn-block         { display: block; width: 100%; }
.agm-btn-lg            { padding: 0.5rem 1rem; font-size: 1.25rem; }

/* ---- Alert (generati dall'AJAX carrello) ---- */
.agm-alert {
	padding: 0.75rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 0.25rem;
	margin-bottom: 0;
}
.agm-alert-success     { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.agm-alert-danger      { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.agm-alert-warning     { color: #856404; background-color: #fff3cd; border-color: #ffc107; }
.agm-alert-dismissible { padding-right: 4rem; position: relative; }
.agm-close {
	position: absolute;
	top: 0;
	right: 0;
	padding: 0.75rem 1.25rem;
	cursor: pointer;
	background: transparent;
	border: 0;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	color: inherit;
	opacity: 0.5;
}
.agm-close:hover { opacity: 1; }

/* ---- WooCommerce Product Add-Ons ----
   Il box totale live e i messaggi di validazione di WC Product Add-Ons
   (#product-addons-total, #required_addons_validation_message) sono pensati
   per la scheda-prodotto singola. Nella griglia shop restano div vuoti che,
   senza il CSS nativo, rendono come barre scure. Il prezzo custom viene
   calcolato server-side all'aggiunta al carrello e gli errori sono mostrati
   dal nostro banner, quindi qui li nascondiamo. Il selettore per attributo
   copre anche gli eventuali id duplicati emessi dal plugin. */
[id="product-addons-total"],
[id="required_addons_validation_message"] {
	display: none !important;
}
