/* Buy in the Store — stili del sito */

:root {
	--bits-primary: #58a82b;
	--bits-primary-dark: #48891f;
	--bits-on-primary: #ffffff;
	--bits-primary-soft: #eef6e9;
	--bits-secondary: #fdf01e;
	--bits-on-secondary: #1f2a14;
	--bits-secondary-soft: #fefab8;
	--bits-ink: #1c2617;
	--bits-muted: #5b6654;
	--bits-line: #e2e8dc;
}

/* Contenitore ------------------------------------------------------------ */
.bits-box,
.bits-box * {
	box-sizing: border-box;
}

.bits-box {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: inherit;
}

.price .bits-box,
.price > .bits-box {
	font-size: 14px;
	font-weight: 400;
	color: var(--bits-ink);
}

.bits-box .bits-icon {
	display: block;
	flex: none;
}

/* Messaggio nelle card ----------------------------------------------------- */
.bits-info {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 7px 10px;
	border-radius: 10px;
	background: var(--bits-secondary);
	color: var(--bits-on-secondary);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}

.bits-info .bits-icon {
	width: 16px;
	height: 16px;
}

.bits-size-standard .bits-info {
	padding: 9px 12px;
	font-size: 14px;
}

/* Etichetta breve --------------------------------------------------------- */
.bits-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--bits-secondary);
	color: var(--bits-on-secondary);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.45;
	white-space: normal;
}

.bits-label::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--bits-primary);
}

/* Pulsante -------------------------------------------------------------- */
.bits-box .bits-btn,
.bits-modal .bits-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 42px;
	margin: 0;
	padding: 9px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--bits-primary);
	box-shadow: none;
	color: var(--bits-on-primary);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.bits-box .bits-btn:hover,
.bits-modal .bits-btn:hover {
	background: var(--bits-primary-dark);
	color: var(--bits-on-primary);
}

.bits-box .bits-btn:active,
.bits-modal .bits-btn:active {
	transform: translateY(1px);
}

.bits-box .bits-btn:focus-visible,
.bits-modal .bits-btn:focus-visible,
.bits-staff__toggle:focus-visible {
	outline: 3px solid var(--bits-secondary);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--bits-primary-dark);
}

.bits-box .bits-btn .bits-icon {
	width: 18px;
	height: 18px;
}

.bits-size-compact .bits-btn {
	min-height: 38px;
	padding: 8px 12px;
	font-size: 13px;
}

.bits-box--button {
	margin-top: 0;
}

/* Pagina prodotto ------------------------------------------------------- */
.bits-box--single {
	gap: 14px;
	max-width: 580px;
	margin: 18px 0 24px;
	font-size: 15px;
}

.bits-panel {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-radius: 16px;
	background: var(--bits-secondary);
	color: var(--bits-on-secondary);
}

.bits-panel__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--bits-primary);
	color: var(--bits-on-primary);
}

.bits-panel__icon .bits-icon {
	width: 22px;
	height: 22px;
}

.bits-panel__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.bits-panel__title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.bits-panel__sub {
	display: block;
	font-size: 13.5px;
	line-height: 1.45;
	opacity: 0.86;
}

.bits-box--single .bits-btn {
	align-self: flex-start;
	width: auto;
	min-height: 50px;
	padding: 12px 24px;
	border-radius: 12px;
	font-size: 15px;
}

.bits-box--single .bits-btn .bits-icon {
	width: 20px;
	height: 20px;
}

/* Versioni disponibili ------------------------------------------------- */
.bits-variants {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 12px 14px;
	border: 1px solid var(--bits-line);
	border-radius: 14px;
	background: #fafcf8;
	color: var(--bits-ink);
}

.bits-variants__title {
	display: block;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--bits-muted);
}

.bits-variants__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
}

.bits-variants__label {
	min-width: 72px;
	font-size: 13px;
	font-weight: 600;
}

.bits-variants__values {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bits-chip {
	display: inline-block;
	padding: 3px 11px;
	border: 1px solid var(--bits-line);
	border-radius: 999px;
	background: #ffffff;
	font-size: 12.5px;
	line-height: 1.45;
}

/* Blocchi (temi a blocchi) --------------------------------------------- */
.bits-block-wrap {
	width: 100%;
}

/* Compatibilità WoodMart e temi classici ------------------------------- */
.bits-restricted .price {
	display: block;
}

.bits-loop-price.bits-restricted .wd-add-btn,
.bits-loop-price.bits-restricted .wd-add-btn-replace,
.bits-loop-price.bits-restricted .add_to_cart_button,
.bits-loop-price.bits-restricted .wd-product-cats + .wd-add-btn {
	display: none !important;
}

.bits-restricted .swap-wrapp,
.bits-restricted .swap-elements,
.bits-restricted .wrap-price {
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
	transform: none !important;
}

.bits-restricted .wd-product .price,
.bits-restricted .product-wrapper .price {
	width: 100%;
}

.bits-product-restricted .wd-sticky-btn,
.bits-product-restricted .wd-sticky-add-to-cart,
.bits-product-restricted .wd-fbt,
.bits-product-restricted .wd-buy-now-btn {
	display: none !important;
}

.bits-hide-cart .wd-header-cart,
.bits-hide-cart .wd-toolbar-cart,
.bits-hide-cart .wd-tools-element.wd-header-cart,
.bits-hide-cart .site-header-cart,
.bits-hide-cart .wc-block-mini-cart,
.bits-hide-cart .cart-contents,
.bits-hide-cart .storefront-handheld-footer-bar li.cart,
.bits-hide-cart .wd-toolbar-item.wd-header-cart,
.bits-hide-cart .cart-widget-side {
	display: none !important;
}

.bits-modal .bits-btn:focus:not(:focus-visible),
.bits-box .bits-btn:focus:not(:focus-visible) {
	outline: none;
}

.woocommerce ul.products li.product .price .bits-box,
.wc-block-grid__product .bits-box {
	margin-top: 10px;
}

/* Popup ----------------------------------------------------------------- */
html.bits-lock,
html.bits-lock body {
	overflow: hidden !important;
}

.bits-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: inherit;
	line-height: 1.4;
	text-align: left;
}

.bits-modal[hidden],
.bits-modal [hidden] {
	display: none !important;
}

.bits-modal *,
.bits-modal *::before,
.bits-modal *::after {
	box-sizing: border-box;
}

.bits-modal .bits-icon {
	display: block;
	flex: none;
	fill: none;
	stroke: currentColor;
}

.bits-modal .bits-icon path {
	fill: none;
}

.bits-modal p {
	margin: 0;
}

.bits-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 14, 0.66);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.bits-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 900px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow: hidden;
	border-radius: 26px;
	background: #ffffff;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
	color: var(--bits-ink);
	opacity: 0;
	transform: translateY(14px) scale(0.98);
	transition: opacity 0.2s ease, transform 0.2s ease;
	outline: none;
}

.bits-modal.is-open .bits-modal__backdrop {
	opacity: 1;
}

.bits-modal.is-open .bits-modal__dialog {
	opacity: 1;
	transform: none;
}

.bits-modal__scroll {
	flex: 1 1 auto;
	min-height: 0;
	padding: 32px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.bits-modal__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(290px, 350px);
	grid-template-rows: auto 1fr;
	grid-template-areas:
		"media head"
		"media body";
	column-gap: 32px;
	row-gap: 20px;
	align-items: start;
}

.bits-modal__head {
	grid-area: head;
	min-width: 0;
	padding: 6px 52px 0 0;
}

.bits-modal__media {
	grid-area: media;
	min-width: 0;
}

.bits-modal__body {
	grid-area: body;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

/* Pulsante di chiusura: regole rinforzate perché alcuni temi (es. WoodMart)
   applicano a tutti i pulsanti posizione, padding e altezza minima. */
.bits-modal .bits-modal__close {
	position: absolute !important;
	top: 18px !important;
	right: 18px !important;
	bottom: auto !important;
	left: auto !important;
	z-index: 5;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--bits-line) !important;
	border-radius: 50% !important;
	background: #ffffff;
	box-shadow: 0 4px 14px rgba(20, 30, 10, 0.12);
	color: var(--bits-ink);
	font-size: 0 !important;
	line-height: 1 !important;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.bits-modal .bits-modal__close .bits-icon {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px;
	stroke-width: 2.2;
	transition: transform 0.25s ease;
}

.bits-modal .bits-modal__close:hover {
	border-color: var(--bits-primary) !important;
	background: var(--bits-primary);
	box-shadow: 0 6px 18px rgba(20, 30, 10, 0.2);
	color: var(--bits-on-primary);
}

.bits-modal .bits-modal__close:hover .bits-icon {
	transform: rotate(90deg);
}

.bits-modal .bits-modal__close:focus:not(:focus-visible) {
	outline: none;
}

.bits-modal .bits-modal__close:focus-visible {
	outline: 3px solid var(--bits-secondary);
	outline-offset: 2px;
}

/* Intestazione */
.bits-modal__eyebrow {
	margin: 0 0 8px !important;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bits-primary-dark);
}

.bits-modal .bits-modal__title {
	margin: 0 0 10px;
	padding: 0;
	border: 0;
	font-family: inherit;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--bits-ink);
}

.bits-modal__product {
	font-size: 15px;
	line-height: 1.45;
	color: var(--bits-muted);
}

/* Immagine */
.bits-modal__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 440px;
	padding: 16px;
	border-radius: 20px;
	background: #f2f5ee;
}

.bits-modal__image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100vh - 160px);
	max-height: calc(100dvh - 160px);
	border-radius: 12px;
	background: #ffffff;
	box-shadow: 0 10px 28px rgba(20, 30, 10, 0.14);
	-webkit-touch-callout: default;
}

.bits-modal__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 32px 20px;
	font-size: 14px;
	color: var(--bits-muted);
	text-align: center;
}

.bits-spinner {
	width: 38px;
	height: 38px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--bits-primary);
	border-radius: 50%;
	animation: bits-spin 0.8s linear infinite;
}

@keyframes bits-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Passaggi */
.bits-modal .bits-modal__steps {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 16px;
	border: 1px solid var(--bits-line);
	border-radius: 16px;
	list-style: none;
	counter-reset: bits-step;
}

.bits-modal .bits-modal__steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.35;
	list-style: none;
	color: var(--bits-ink);
	counter-increment: bits-step;
}

.bits-modal .bits-modal__steps li::before {
	content: counter(bits-step);
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--bits-secondary);
	color: var(--bits-on-secondary);
	font-size: 13px;
	font-weight: 700;
}

/* Azioni */
.bits-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bits-modal__row {
	display: flex;
	gap: 10px;
}

.bits-modal__row .bits-btn {
	flex: 1 1 0;
}

.bits-modal .bits-modal__actions .bits-btn {
	min-height: 48px;
	border-radius: 12px;
	font-size: 15px;
}

.bits-modal .bits-btn--ghost {
	background: #ffffff;
	box-shadow: inset 0 0 0 1.5px #d4dbcd;
	color: var(--bits-ink);
}

.bits-modal .bits-btn--ghost:hover {
	background: #f4f7f1;
	color: var(--bits-ink);
}

.bits-modal .bits-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.bits-modal__hint {
	font-size: 12.5px;
	color: var(--bits-muted);
}

.bits-modal__error {
	padding: 10px 12px;
	border-radius: 10px;
	background: #fdecec;
	color: #8a1f1f;
	font-size: 13.5px;
}

.bits-modal__status {
	min-height: 18px;
	margin-top: -6px !important;
	font-size: 12.5px;
	color: var(--bits-primary-dark);
}

.bits-modal__status:empty {
	display: none;
}

/* Negozio */
.bits-modal__store {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	border-radius: 16px;
	background: var(--bits-primary-soft);
	font-size: 13px;
	line-height: 1.45;
	color: var(--bits-ink);
}

.bits-modal__store-title {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--bits-primary-dark);
}

.bits-modal__store-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.bits-modal__store-row .bits-icon {
	width: 16px;
	height: 16px;
	margin-top: 2px;
	color: var(--bits-primary-dark);
}

.bits-modal__store-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 2px;
}

.bits-modal .bits-modal__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 999px;
	background: #ffffff;
	box-shadow: inset 0 0 0 1px var(--bits-line);
	color: var(--bits-ink);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bits-modal .bits-modal__link .bits-icon {
	width: 16px;
	height: 16px;
}

.bits-modal .bits-modal__link:hover {
	background: var(--bits-primary);
	box-shadow: none;
	color: var(--bits-on-primary);
}

/* Vista banco sul sito ------------------------------------------------ */
.bits-staff {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	width: 380px;
	max-width: calc(100vw - 32px);
	font-family: inherit;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--bits-ink);
}

.bits-staff * {
	box-sizing: border-box;
}

.bits-staff__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 0;
	margin: 0;
	padding: 10px 16px;
	border: 0;
	border-radius: 999px;
	background: #1c2617;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
	color: #ffffff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

.bits-staff__toggle:hover {
	background: #2c3a24;
	color: #ffffff;
}

.bits-staff__badge {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--bits-secondary);
	color: var(--bits-on-secondary);
	font-size: 11px;
}

.bits-staff__body {
	width: 100%;
	max-height: min(72vh, 660px);
	margin-top: 10px;
	overflow: auto;
	padding: 16px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 20px;
	background: #ffffff;
	box-shadow: 0 20px 56px rgba(0, 0, 0, 0.24);
}

.bits-staff[data-state="closed"] .bits-staff__body {
	display: none;
}

@media (max-width: 600px) {
	.bits-box--single .bits-btn {
		width: 100%;
	}

	.bits-staff {
		right: 10px;
		bottom: 10px;
		max-width: calc(100vw - 20px);
	}
}

@media (max-width: 760px) {
	.bits-modal {
		align-items: flex-end;
		padding: 0;
	}

	.bits-modal__dialog {
		max-width: none;
		max-height: 94vh;
		max-height: 94dvh;
		border-radius: 24px 24px 0 0;
		transform: translateY(40px);
	}

	.bits-modal__dialog::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		z-index: 4;
		width: 44px;
		height: 5px;
		margin-left: -22px;
		border-radius: 999px;
		background: #d9dfd3;
	}

	.bits-modal__scroll {
		padding: 28px 18px calc(18px + env(safe-area-inset-bottom, 0px));
	}

	.bits-modal__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		grid-template-areas:
			"head"
			"media"
			"body";
		row-gap: 16px;
	}

	.bits-modal__head {
		padding: 4px 48px 0;
		text-align: center;
	}

	.bits-modal .bits-modal__title {
		font-size: 23px;
	}

	.bits-modal__product {
		font-size: 14px;
	}

	.bits-modal .bits-modal__close {
		top: 16px !important;
		right: 14px !important;
		width: 40px !important;
		height: 40px !important;
	}

	.bits-modal__stage {
		min-height: 280px;
		padding: 10px;
	}

	.bits-modal__image {
		max-height: 58vh;
		max-height: 58dvh;
	}

	.bits-modal .bits-modal__steps {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bits-box .bits-btn,
	.bits-modal .bits-btn,
	.bits-modal__backdrop,
	.bits-modal__dialog,
	.bits-modal .bits-modal__close,
	.bits-modal .bits-modal__close .bits-icon {
		transition: none;
	}

	.bits-spinner {
		animation-duration: 2s;
	}
}
