.cps-hidden { display: none !important; }

/* Mode sur mesure : on masque le prix / la quantité / le bouton standard (le panneau a les siens). */
form.cps-active .single_variation_wrap .single_variation,
form.cps-active .quantity,
form.cps-active .single_add_to_cart_button,
form.cps-active .reset_variations { display: none !important; }
/* Boutons de paiement express masqués tant que les dimensions ne sont pas valides / enregistrées. */
body.cps-block-express #wc-stripe-express-checkout-element,
body.cps-block-express #wc-stripe-payment-request-wrapper { display: none !important; }

/* Miniature « schéma » dans la galerie produit. */
.cps-thumb { cursor: pointer; list-style: none; }
.cps-thumb-in { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #f3faff; opacity: .5; transition: opacity .15s; }
.cps-thumb-in svg { width: 70%; height: 70%; }
.cps-thumb:hover .cps-thumb-in, .cps-schema-on .cps-thumb .cps-thumb-in { opacity: 1; }
.cps-schema-on .flex-control-thumbs li img { opacity: .5 !important; }

.cps-root { --cps-bg: #f3faff; display: block; width: 100%; max-width: 100%; min-width: 0; flex: 0 0 100%; grid-column: 1 / -1; margin: 0 0 1.4em; color: var(--cps-accent, #2d77a8); font-family: inherit; }
.cps-root:empty { margin: 0; }
.cps-panel { width: 100%; }
.cps-root * { box-sizing: border-box; }
.cps-root button { font-family: inherit; }

.cps-open-btn {
	display: block; width: 100%; padding: .95em 1.2em; font-size: 1rem; font-weight: 600; cursor: pointer;
	border: 2px solid var(--cps-accent, #2d77a8); border-radius: 10px; background: #fff; color: var(--cps-accent, #2d77a8);
	transition: background .15s;
}
.cps-open-btn:hover { background: var(--cps-bg); }

.cps-panel { border: 1px solid #d9e2ea; border-radius: 14px; padding: 18px; background: #fff; }
.cps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cps-check { width: 24px; height: 24px; display: inline-flex; }
.cps-check svg { width: 100%; height: 100%; }
.cps-title { font-size: 1.15rem; font-weight: 600; }
.cps-close { margin-left: auto; width: 32px; height: 32px; border: 0; background: none; font-size: 1.7rem; line-height: 1; color: #9aabb8; cursor: pointer; border-radius: 50%; }
.cps-close:hover { background: var(--cps-bg); color: var(--cps-accent, #2d77a8); }

.cps-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cps-mode {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 110px; padding: 12px 8px;
	border: 1px solid transparent; border-radius: 10px; background: #fff; color: var(--cps-accent, #2d77a8); font-size: .95rem; cursor: pointer; text-align: center;
}
.cps-mode svg { width: 48px; height: 48px; }
.cps-mode:hover { background: var(--cps-bg); }
.cps-mode.is-active { background: var(--cps-bg); border-color: var(--cps-accent, #2d77a8); }

.cps-box { background: var(--cps-bg); border-radius: 10px; padding: 16px; }
.cps-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.cps-field { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.cps-flabel { font-size: 1.05rem; }
.cps-fmax { font-size: .8rem; opacity: .85; margin-bottom: 6px; }
.cps-input { position: relative; display: block; }
.cps-input input {
	width: 100%; height: 50px; padding: 0 44px 0 14px; font-size: 1.1rem; color: var(--cps-accent, #2d77a8);
	border: 1.5px solid #9fd6f5; border-radius: 8px; background: #fff; box-shadow: none; margin: 0;
}
.cps-input input:focus { outline: none; border-color: var(--cps-accent, #2d77a8); box-shadow: 0 0 0 3px rgba(74, 168, 232, .2); }
.cps-input i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: #7cc3ee; pointer-events: none; }

.cps-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cps-tab { padding: 7px 14px; border: 0; border-radius: 6px; background: transparent; color: #4aa8e8; font-size: 1rem; cursor: pointer; }
.cps-tab.is-active { background: #4aa8e8; color: #fff; }
.cps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.cps-shape { aspect-ratio: 1; padding: 4px; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.cps-shape svg { width: 100%; height: 100%; display: block; }
.cps-shape:hover { background: #fff; border-color: #bcdff5; }

.cps-chosen { display: flex; align-items: center; gap: 10px; padding: 8px 4px 12px; margin-bottom: 14px; border-bottom: 1px solid #cfe6f5; }
.cps-chosen-ico { width: 26px; height: 26px; display: inline-flex; }
.cps-chosen-ico svg { width: 100%; height: 100%; }
.cps-chosen-name { font-size: 1.05rem; }
.cps-unpick { margin-left: auto; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--cps-accent, #2d77a8); cursor: pointer; }

.cps-summary { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--cps-bg); }
.cps-lines > div { display: flex; justify-content: space-between; gap: 10px; font-size: .95rem; padding: 2px 0; }
.cps-lines .cps-note { display: block; font-size: .8rem; opacity: .8; }
.cps-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; padding-top: 10px; border-top: 1px solid #cfe6f5; font-size: 1.05rem; }
.cps-price { font-size: 1.6rem; color: #1d1d1d; }
.cps-err { margin-top: 8px; color: #c0392b; font-size: .9rem; }
.cps-err:empty { display: none; }

.cps-buy { display: flex; gap: 10px; margin-top: 14px; }
.cps-stepper { display: flex; align-items: stretch; height: 52px; border: 1.5px solid #9fd6f5; border-radius: 8px; background: #fff; overflow: hidden; }
.cps-step { width: 42px; border: 0; background: transparent; color: var(--cps-accent, #2d77a8); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0; }
.cps-step:hover { background: var(--cps-bg); }
.cps-qty { width: 46px; min-width: 0; padding: 0; text-align: center; font-size: 1.05rem; border: 0; background: transparent; box-shadow: none; margin: 0; color: #1d1d1d; -moz-appearance: textfield; }
.cps-qty:focus { outline: none; }
.cps-add {
	flex: 1; height: 52px; border: 0; border-radius: 8px; background: var(--cps-accent, #2d77a8); color: #fff; font-size: 1.05rem; font-weight: 600; cursor: pointer;
}
.cps-add:hover:not(:disabled) { filter: brightness(1.1); }
.cps-add:disabled { opacity: .45; cursor: not-allowed; }
.cps-msg { margin-top: 10px; font-size: .95rem; }
.cps-msg:empty { display: none; }
.cps-msg.is-ok { color: #1e8449; }
.cps-msg.is-error { color: #c0392b; }
.cps-msg a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Même emprise que l'image produit (le format est mesuré en JS), le schéma remplit tout l'encadré. */
.cps-preview { background: #f3faff; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.cps-preview svg { display: block; width: 100%; height: 100%; }

.cps-pricebox { display: flex; flex-direction: column; align-items: flex-end; }
.cps-price-alt { font-size: .85rem; color: #6b7a86; }
.cps-price-alt:empty { display: none; }

/* Bouton « Personnaliser » : jamais barré / grisé, même si le plugin de swatches tente de le marquer indisponible. */
.cps-swatch, .cps-swatch.disabled { opacity: 1 !important; pointer-events: auto !important; cursor: pointer !important; }
.cps-swatch::before, .cps-swatch::after,
.cps-swatch .variable-item-contents::before, .cps-swatch .variable-item-contents::after,
.cps-swatch .variable-item-span::before, .cps-swatch .variable-item-span::after { display: none !important; content: none !important; }
.cps-swatch .variable-item-span, .cps-swatch.disabled .variable-item-span { color: inherit !important; opacity: 1 !important; }

@media (max-width: 480px) {
	.cps-fields { grid-template-columns: 1fr; }
	.cps-panel { padding: 14px; }
}
