/* ---------- Layout del form: selezione sopra, pulsante sotto a tutta larghezza ---------- */
form.cart.bdb-form {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 14px;
}
form.cart.bdb-form .bdb-box { order: 0; }
form.cart.bdb-form .quantity { display: none !important; }
form.cart.bdb-form .e-atc-qty-button-holder {
	display: block !important;
	width: 100% !important;
	order: 1;
}
form.cart.bdb-form .single_add_to_cart_button {
	order: 1;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	flex: none !important;
}
form.cart.bdb-form .single_add_to_cart_button.bdb-disabled { opacity: .55; }

/* ---------- Box ---------- */
.bdb-box { width: 100%; margin: 0; }
.bdb-box [hidden] { display: none !important; }

.bdb-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: .5em;
}
.bdb-title { font-weight: 600; margin: 0; }
.bdb-count { font-size: .85em; opacity: .7; white-space: nowrap; }
.bdb-box.is-complete .bdb-count { color: #2e7d32; opacity: 1; font-weight: 600; }

/* Campo di ricerca */
.bdb-control { position: relative; }
.bdb-input {
	width: 100%;
	box-sizing: border-box;
	padding: .7em .9em;
}
.bdb-input:disabled { background: #f7f5f2; cursor: default; }

/* Tendina */
.bdb-results {
	position: absolute; z-index: 9999; left: 0; right: 0; top: 100%;
	margin: 4px 0 0; padding: 4px 0; list-style: none; background: #fff;
	border: 1px solid #e3ddd4; box-shadow: 0 8px 24px rgba(0,0,0,.08);
	max-height: 320px; overflow-y: auto;
}
.bdb-results li { display: flex; align-items: center; gap: .7em; margin: 0; padding: .5em .8em; }
.bdb-results img { width: 36px; height: 36px; object-fit: cover; flex: none; }
.bdb-option { cursor: pointer; }
.bdb-option-name { flex: 1; }
.bdb-option.is-active, .bdb-option:not(.is-excluded):hover { background: #f5f1ea; }
.bdb-option.is-excluded { cursor: not-allowed; opacity: .45; }
.bdb-option-note { font-size: .78em; font-style: italic; white-space: nowrap; }
.bdb-hint { font-size: .75em; text-transform: uppercase; letter-spacing: .06em; opacity: .6; cursor: default; }
.bdb-empty { opacity: .6; cursor: default; }

/* Profumi scelti */
.bdb-chips { list-style: none; margin: .6em 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bdb-chips:empty { display: none; }
.bdb-chip {
	display: flex; align-items: center; gap: .7em;
	margin: 0; padding: .4em .5em .4em .6em;
	border: 1px solid #e3ddd4; background: #faf8f5;
}
.bdb-chip img { width: 32px; height: 32px; object-fit: cover; flex: none; }
.bdb-chip-name { flex: 1; font-size: .95em; }
.bdb-chip-remove {
	background: none !important; border: 0 !important; box-shadow: none !important;
	color: inherit !important; padding: 0 .4em !important; margin: 0;
	font-size: 1.3em; line-height: 1; cursor: pointer; opacity: .6;
}
.bdb-chip-remove:hover { opacity: 1; }

.bdb-error { color: #b00020; font-size: .9em; margin: .5em 0 0; }

/* Pagamenti rapidi nascosti sulle pagine box (il CSS è caricato solo lì) */
#wc-stripe-express-checkout-element,
#wc-stripe-express-checkout-button-separator,
#wc-stripe-payment-request-wrapper,
#wc-stripe-payment-request-button-separator,
.wc-stripe-product-checkout-container { display: none !important; }

/* =========================================================================
 * V2 – riquadro "La tua box" + griglia
 * ====================================================================== */
.bdb-v2, .bdb2-grid, .bdb2-sticky {
	--bdb2-border: #e6ddd0;
	--bdb2-bg: #faf7f2;
	--bdb2-accent: #b8975a;
	--bdb2-dark: #3a2a1c;
	--bdb2-heading: var(--e-global-typography-primary-font-family, inherit);
}

/* Riquadro */
.bdb-v2 {
	border: 1px solid var(--bdb2-border);
	background: var(--bdb2-bg);
	padding: 18px 18px 16px;
	border-radius: 6px;
}
.bdb2-head { display: flex; justify-content: space-between; align-items: baseline; }
.bdb2-title { font-family: var(--bdb2-heading); font-size: 1.35em; color: var(--bdb2-dark); }
.bdb2-count { font-size: .85em; font-weight: 600; color: var(--bdb2-dark); }
.bdb2-progress { height: 3px; background: var(--bdb2-border); margin: 10px 0 14px; border-radius: 3px; overflow: hidden; }
.bdb2-progress span { display: block; height: 100%; width: 0; background: var(--bdb2-accent); transition: width .3s ease; }

.bdb2-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.bdb2-slot {
	position: relative; min-height: 76px; box-sizing: border-box;
	padding: 10px 12px; border-radius: 4px; text-align: left;
	display: flex; flex-direction: column; justify-content: center;
}
.bdb2-slot.is-filled { background: #fff; border: 1px solid var(--bdb2-accent); }
.bdb2-slot.is-empty {
	background: transparent !important; border: 1px dashed #cfc3b2 !important; color: #8a7d6c !important;
	align-items: center; cursor: pointer; box-shadow: none !important; font: inherit; width: 100%;
	text-transform: none; letter-spacing: normal; margin: 0;
}
.bdb2-slot.is-empty:hover { border-color: var(--bdb2-accent) !important; color: var(--bdb2-dark) !important; }
.bdb2-slot-plus { font-size: 1.4em; line-height: 1; }
.bdb2-slot-empty { font-size: .82em; margin-top: 4px; }
.bdb2-slot-label { font-size: .68em; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding-right: 20px; }
.bdb2-slot-name { font-family: var(--bdb2-heading); font-size: 1.1em; color: var(--bdb2-dark); line-height: 1.2; margin-top: 2px; }
.bdb2-slot-brand { font-size: .75em; opacity: .7; margin-top: 2px; }
.bdb2-slot-remove {
	position: absolute; top: 4px; right: 4px;
	background: none !important; border: 0 !important; box-shadow: none !important;
	color: var(--bdb2-dark) !important; padding: 2px 6px !important; margin: 0;
	font-size: 1.2em; line-height: 1; cursor: pointer; opacity: .6; min-height: 0;
}
.bdb2-slot-remove:hover { opacity: 1; }
.bdb-v2 .bdb-error { margin-top: 10px; }

/* Pulsante carrello in V2 */
form.cart.bdb-form-v2 { gap: 12px; }
form.cart.bdb-form-v2 .single_add_to_cart_button.bdb-disabled { opacity: 1; filter: saturate(.3); cursor: pointer; }

/* Griglia */
.bdb2-grid { width: 100%; box-sizing: border-box; padding: 40px 20px; }
.bdb2-grid-inner { max-width: var(--bdb2-width, 1200px); margin: 0 auto; }
.bdb2-grid-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.bdb2-grid-title { font-family: var(--bdb2-heading); margin: 0; color: var(--bdb2-dark); }
.bdb2-grid-sub { margin: 4px 0 0; font-size: .9em; opacity: .75; }
.bdb2-search { min-width: 240px; }
.bdb2-search label { display: block; font-size: .7em; text-transform: uppercase; letter-spacing: .08em; opacity: .6; margin-bottom: 4px; }
.bdb2-search-input { width: 100%; box-sizing: border-box; padding: .6em .8em; border: 1px solid var(--bdb2-border); border-radius: 4px; background: #fff; }

.bdb2-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.bdb2-pill {
	background: #fff !important; color: var(--bdb2-dark) !important; border: 1px solid var(--bdb2-border) !important;
	border-radius: 999px !important; padding: 7px 14px !important; font-size: .82em !important; line-height: 1.2 !important;
	cursor: pointer; box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important;
	min-height: 0 !important; margin: 0 !important; font-weight: 500;
}
.bdb2-pill:hover { border-color: var(--bdb2-accent) !important; }
.bdb2-pill.is-active { background: var(--bdb2-dark) !important; color: #fff !important; border-color: var(--bdb2-dark) !important; }

.bdb2-group { margin-bottom: 30px; }
.bdb2-group-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--bdb2-border); padding-bottom: 8px; margin-bottom: 14px; }
.bdb2-group-title { font-family: var(--bdb2-heading); margin: 0; font-size: 1.4em; color: var(--bdb2-dark); }
.bdb2-group-count { font-size: .78em; opacity: .6; }

.bdb2-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bdb2-card {
	display: flex; flex-direction: column; padding: 12px; min-height: 120px; box-sizing: border-box;
	background: #fff; border: 1px solid var(--bdb2-border); border-radius: 4px; transition: border-color .2s, background .2s;
}
.bdb2-card.is-selected { border-color: var(--bdb2-accent); background: var(--bdb2-bg); }
.bdb2-card-brand { font-size: .65em; text-transform: uppercase; letter-spacing: .08em; opacity: .6; }
.bdb2-card-name { font-family: var(--bdb2-heading); font-size: 1.1em; line-height: 1.2; color: var(--bdb2-dark); margin: 3px 0 12px; }
.bdb2-card-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }

.bdb2-add, .bdb2-step {
	font: inherit; font-size: .8em !important; line-height: 1.2 !important; cursor: pointer;
	box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important;
	min-height: 0 !important; margin: 0 !important; border-radius: 4px !important;
}
.bdb2-add {
	width: 100%; padding: 8px 6px !important; font-weight: 600;
	background: #fff !important; color: var(--bdb2-dark) !important; border: 1px solid var(--bdb2-dark) !important;
}
.bdb2-add:hover:not(:disabled) { background: var(--bdb2-dark) !important; color: #fff !important; }
.bdb2-step {
	width: 32px; height: 32px; padding: 0 !important; flex: none; font-size: 1.1em !important;
	background: #fff !important; color: var(--bdb2-dark) !important; border: 1px solid var(--bdb2-dark) !important;
}
.bdb2-step-plus { background: var(--bdb2-dark) !important; color: #fff !important; }
.bdb2-add:disabled, .bdb2-step:disabled { opacity: .35; cursor: not-allowed; }
.bdb2-qty { font-size: .75em; text-align: center; line-height: 1.2; }

.bdb2-empty { opacity: .7; }
.bdb2-note { margin: 10px 0 0; padding-top: 16px; border-top: 1px solid var(--bdb2-border); font-size: .9em; text-align: center; }
.bdb2-grid [hidden], .bdb2-sticky[hidden] { display: none !important; }

/* Barra fissa */
.bdb2-sticky {
	position: fixed; z-index: 9990; left: 50%; bottom: 16px; transform: translateX(-50%);
	width: calc(100% - 24px); max-width: 520px; box-sizing: border-box;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 10px 10px 10px 18px; background: #fff; border: 1px solid var(--bdb2-border);
	border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.14);
}
.bdb2-sticky-count { font-weight: 600; color: var(--bdb2-dark); white-space: nowrap; }
.bdb2-sticky-btn {
	background: var(--bdb2-border) !important; color: var(--bdb2-dark) !important; border: 0 !important;
	border-radius: 6px !important; padding: 10px 16px !important; font: inherit; font-size: .85em !important;
	font-weight: 600; cursor: pointer; box-shadow: none !important; margin: 0 !important; min-height: 0 !important;
}
.bdb2-sticky.is-complete .bdb2-sticky-btn { background: var(--bdb2-dark) !important; color: #fff !important; }

@media (max-width: 767px) {
	.bdb-v2 { padding: 14px; }
	.bdb2-slots { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
	.bdb2-slot { min-height: 68px; padding: 8px 10px; }
	.bdb2-grid { padding: 28px 14px 90px; }
	.bdb2-search { min-width: 0; width: 100%; }
	.bdb2-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
	.bdb2-pill { white-space: nowrap; flex: none; }
	.bdb2-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
