/* =========================================================================
   BNK17 — Card prodotto: flow uniforme su TUTTE le griglie/caroselli
   (home, /negozio/ "Tutti i prodotti", categorie, ricerca, correlati).
   Stessa altezza, immagine a rapporto fisso, titolo con ingombro costante
   (2 righe), prezzo centrato e bottone ancorato al fondo → titoli lunghi o
   bottoni diversi ("Aggiungi" vs "Scegli...") non disallineano i livelli.
   ========================================================================= */

.wc-block-product-template.is-product-collection-layout-carousel {
	align-items: stretch; /* card tutte alte uguali (override verticalAlignment:top) */
}
.wp-block-woocommerce-product-collection .wc-block-product,
.wp-block-woocommerce-product-template .wc-block-product {
	box-sizing: border-box; /* padding/bordo dentro il min-width: niente overflow nei caroselli */
	display: flex;
	flex-direction: column;
	align-items: stretch;
	text-align: center;
}
/* immagine: quadrata, stessa base per tutte le card */
.wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-image,
.wp-block-woocommerce-product-template .wc-block-product .wc-block-components-product-image {
	margin: 0 0 12px;
}
.wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-image img,
.wp-block-woocommerce-product-template .wc-block-product .wc-block-components-product-image img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
/* titolo: sempre l'ingombro di 2 righe (line-height 1.4), clamp se più lungo, centrato */
.wp-block-woocommerce-product-collection .wc-block-product .wp-block-post-title,
.wp-block-woocommerce-product-template .wc-block-product .wp-block-post-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.8em;
	text-align: center;
	margin-top: 0;
	margin-bottom: 0.5rem;
}
/* prezzo: centrato, spazio costante prima del bottone */
.wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price,
.wp-block-woocommerce-product-collection .wc-block-product .wp-block-woocommerce-product-price,
.wp-block-woocommerce-product-template .wc-block-product .wc-block-components-product-price,
.wp-block-woocommerce-product-template .wc-block-product .wp-block-woocommerce-product-price {
	display: block;
	text-align: center;
	margin-bottom: 0.75rem;
}
/* bottone: spinto al fondo della card, larghezza piena, testo centrato */
.wp-block-woocommerce-product-collection .wc-block-product .wp-block-woocommerce-product-button,
.wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button,
.wp-block-woocommerce-product-template .wc-block-product .wp-block-woocommerce-product-button,
.wp-block-woocommerce-product-template .wc-block-product .wc-block-components-product-button {
	margin-top: auto;
	width: 100%;
	align-items: stretch;
}
.wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button .add_to_cart_button,
.wp-block-woocommerce-product-collection .wc-block-product .wp-block-woocommerce-product-button .wp-block-button__link,
.wp-block-woocommerce-product-template .wc-block-product .wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-template .wc-block-product .wc-block-components-product-button .add_to_cart_button,
.wp-block-woocommerce-product-template .wc-block-product .wp-block-woocommerce-product-button .wp-block-button__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	text-align: center;
	white-space: normal;
}

/* =========================================================================
   Glass button — adattato da "CSS Glassmorphism Button Hover Effects"
   (codehim.com, MIT). Wrapper = .wc-block-components-product-button,
   anchor = .wp-block-button__link. Glow nel rosso brand (accent #be1623).
   ========================================================================= */

/* wrapper: contesto per le "pillole" glow sopra/sotto il bottone */
.wc-block-product .wc-block-components-product-button,
.bnk17-glass-btn,
.wp-block-button:not(.is-style-outline) {
	position: relative;
}
/* Il box del wrapper deve coincidere ESATTAMENTE con l'anchor: senza flex la
   baseline dell'anchor inline lascia qualche px sotto e le pillole risultano
   verticalmente asimmetriche (quella in basso più staccata di quella in alto). */
.bnk17-glass-btn,
.wp-block-buttons > .wp-block-button:not(.is-style-outline),
.wc-block-product .wc-block-components-product-button {
	display: flex;
}

/* anchor: vetro (blur, bordi orizzontali sottili, pill) */
.wc-block-product .wc-block-components-product-button .wp-block-button__link,
.bnk17-glass-btn .wp-block-button__link,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
	position: relative;
	margin: 0 !important; /* Woo mette margin-bottom 1em sull'anchor (il suo CSS
	              carica dopo il nostro): renderebbe il wrapper più alto sotto
	              → pillole verticalmente asimmetriche */
	background: rgba(255, 255, 255, 0.05);
	border: none;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 30px;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
	color: var(--wp--preset--color--contrast, #f0ede6);
	letter-spacing: 1px;
	overflow: hidden;
	z-index: 1;
	-webkit-backdrop-filter: blur(15px);
	backdrop-filter: blur(15px);
	transition: 0.35s;
}
.wc-block-product .wc-block-components-product-button:hover .wp-block-button__link,
.bnk17-glass-btn:hover .wp-block-button__link,
.wp-block-button:not(.is-style-outline):hover .wp-block-button__link {
	letter-spacing: 2px;
	color: var(--wp--preset--color--contrast, #f0ede6);
	background: rgba(255, 255, 255, 0.05);
}

/* riflesso obliquo che scivola via all'hover */
.wc-block-product .wc-block-components-product-button .wp-block-button__link::before,
.bnk17-glass-btn .wp-block-button__link::before,
.wp-block-button:not(.is-style-outline) .wp-block-button__link::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 50%;
	height: 100%;
	background: linear-gradient(to left, rgba(255, 255, 255, 0.15), transparent);
	/* a riposo fuori dal bottone (a sinistra): niente "cucitura" diagonale statica */
	transform: skewX(45deg) translateX(-200%);
	transition: 0.35s;
	pointer-events: none;
}
.wc-block-product .wc-block-components-product-button:hover .wp-block-button__link::before,
.bnk17-glass-btn:hover .wp-block-button__link::before,
.wp-block-button:not(.is-style-outline):hover .wp-block-button__link::before {
	transform: skewX(45deg) translateX(250%);
}

/* pillole glow rosse sopra/sotto che all'hover si espandono a riempire il bottone */
.wc-block-product .wc-block-components-product-button::before,
.wc-block-product .wc-block-components-product-button::after,
.bnk17-glass-btn::before,
.bnk17-glass-btn::after,
.wp-block-button:not(.is-style-outline)::before,
.wp-block-button:not(.is-style-outline)::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 30px;
	height: 10px;
	background: var(--wp--preset--color--accent, #be1623);
	box-shadow: 0 0 5px var(--wp--preset--color--accent, #be1623),
		0 0 15px var(--wp--preset--color--accent, #be1623),
		0 0 30px var(--wp--preset--color--accent, #be1623),
		0 0 60px var(--wp--preset--color--accent, #be1623);
	border-radius: 10px;
	transition: 0.35s;
	transition-delay: 0s;
	pointer-events: none;
}
.wc-block-product .wc-block-components-product-button::before,
.bnk17-glass-btn::before,
.wp-block-button:not(.is-style-outline)::before { bottom: -5px; }
.wc-block-product .wc-block-components-product-button::after,
.bnk17-glass-btn::after,
.wp-block-button:not(.is-style-outline)::after { top: -5px; }
.wc-block-product .wc-block-components-product-button:hover::before,
.bnk17-glass-btn:hover::before,
.wp-block-button:not(.is-style-outline):hover::before {
	bottom: 0;
	height: 50%;
	width: 100%; /* riempie tutto il bottone (la demo si fermava all'80%) */
	/* metà inferiore: arrotondata solo sotto → l'unione delle due metà
	   ricalca esattamente la capsula (border-radius 30px) del bottone */
	border-radius: 0 0 30px 30px;
	transition-delay: 0.15s;
}
.wc-block-product .wc-block-components-product-button:hover::after,
.bnk17-glass-btn:hover::after,
.wp-block-button:not(.is-style-outline):hover::after {
	top: 0;
	height: 50%;
	width: 100%;
	border-radius: 30px 30px 0 0; /* metà superiore: arrotondata solo sopra */
	transition-delay: 0.15s;
}

/* ---- Bottoni WooCommerce "classici" (singolo prodotto, carrello, checkout):
   niente wrapper → vetro sull'elemento stesso + pillole INTERNE (z-index:-1,
   sotto il testo ma sopra lo sfondo del bottone, visibili attraverso il vetro).
   Gli !important servono a battere gli !important dello stile rosso in theme.json. ---- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.wc-block-components-button:not(.is-link),
.added_to_cart {
	position: relative;
	background: rgba(255, 255, 255, 0.05) !important;
	border: none !important;
	border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-radius: 30px !important;
	color: var(--wp--preset--color--contrast, #f0ede6) !important;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
	overflow: hidden;
	-webkit-backdrop-filter: blur(15px);
	backdrop-filter: blur(15px);
	transition: 0.35s;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.wc-block-components-button:not(.is-link):hover,
.added_to_cart:hover {
	background: rgba(255, 255, 255, 0.05) !important;
	border-color: rgba(255, 255, 255, 0.1) !important;
	letter-spacing: 0.24em;
}
.woocommerce a.button::before,
.woocommerce a.button::after,
.woocommerce button.button::before,
.woocommerce button.button::after,
.wc-block-components-button:not(.is-link)::before,
.wc-block-components-button:not(.is-link)::after,
.added_to_cart::before,
.added_to_cart::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 30px;
	height: 8px;
	background: var(--wp--preset--color--accent, #be1623);
	box-shadow: 0 0 5px var(--wp--preset--color--accent, #be1623),
		0 0 15px var(--wp--preset--color--accent, #be1623),
		0 0 30px var(--wp--preset--color--accent, #be1623);
	border-radius: 10px;
	transition: 0.35s;
	transition-delay: 0s;
	pointer-events: none;
	z-index: -1;
}
.woocommerce a.button::before,
.woocommerce button.button::before,
.wc-block-components-button:not(.is-link)::before,
.added_to_cart::before { bottom: -4px; }
.woocommerce a.button::after,
.woocommerce button.button::after,
.wc-block-components-button:not(.is-link)::after,
.added_to_cart::after { top: -4px; }
.woocommerce a.button:hover::before,
.woocommerce button.button:hover::before,
.wc-block-components-button:not(.is-link):hover::before,
.added_to_cart:hover::before {
	bottom: 0;
	height: 50%;
	width: 100%;
	border-radius: 0 0 30px 30px; /* come sopra: le due metà compongono la capsula del bottone */
	transition-delay: 0.15s;
}
.woocommerce a.button:hover::after,
.woocommerce button.button:hover::after,
.wc-block-components-button:not(.is-link):hover::after,
.added_to_cart:hover::after {
	top: 0;
	height: 50%;
	width: 100%;
	border-radius: 30px 30px 0 0;
	transition-delay: 0.15s;
}

/* ---- Singolo prodotto: bottone "disabled" (variazioni non ancora scelte) —
   via l'effetto sbiadito di WooCommerce (opacity .5 su tutto il bottone):
   il vetro resta pieno, si attenuano solo testo e pillole glow. ---- */
.woocommerce .button.disabled,
.woocommerce .button:disabled,
.woocommerce button.button.wc-variation-selection-needed {
	opacity: 1 !important;
	color: rgba(240, 237, 230, 0.55) !important;
	cursor: not-allowed;
}
.woocommerce .button.disabled::before,
.woocommerce .button.disabled::after,
.woocommerce .button:disabled::before,
.woocommerce .button:disabled::after,
.woocommerce button.button.wc-variation-selection-needed::before,
.woocommerce button.button.wc-variation-selection-needed::after {
	opacity: 0.35;
}

/* ---- Dropdown navigazione desktop: stessa estetica glass del menu mobile
   (vetro scuro, blur, angoli arrotondati, ombra morbida, voci a pillola) ---- */
.wp-block-navigation .wp-block-navigation__submenu-container {
	background: rgba(16, 16, 16, 0.72) !important;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.08) !important;
	border-radius: 16px !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
	padding: 6px !important;
	overflow: hidden;
	min-width: 200px;
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	border-radius: 10px;
	padding: 10px 14px !important;
	color: var(--wp--preset--color--contrast, #f0ede6) !important; /* bianco a tema (il default del blocco era scuro) */
	transition: background 0.2s ease;
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: rgba(190, 22, 35, 0.18);
	color: var(--wp--preset--color--contrast, #f0ede6) !important;
}

/* ---- Niente outline/alone al click o tap (prodotti, menu, immagini, burger
   mobile incluso); il focus da tastiera (:focus-visible) resta per l'a11y. ---- */
html { -webkit-tap-highlight-color: transparent; }
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
img:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
	outline: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.wc-block-product .wc-block-components-product-button .wp-block-button__link,
	.wc-block-product .wc-block-components-product-button .wp-block-button__link::before,
	.wc-block-product .wc-block-components-product-button::before,
	.wc-block-product .wc-block-components-product-button::after,
	.bnk17-glass-btn .wp-block-button__link,
	.bnk17-glass-btn .wp-block-button__link::before,
	.bnk17-glass-btn::before,
	.bnk17-glass-btn::after,
	.wp-block-button:not(.is-style-outline) .wp-block-button__link,
	.wp-block-button:not(.is-style-outline) .wp-block-button__link::before,
	.wp-block-button:not(.is-style-outline)::before,
	.wp-block-button:not(.is-style-outline)::after,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.wc-block-components-button:not(.is-link),
	.added_to_cart,
	.woocommerce a.button::before,
	.woocommerce a.button::after,
	.woocommerce button.button::before,
	.woocommerce button.button::after,
	.wc-block-components-button:not(.is-link)::before,
	.wc-block-components-button:not(.is-link)::after,
	.added_to_cart::before,
	.added_to_cart::after {
		transition: none;
	}
}
