/*
 * Boutique WooCommerce aux couleurs de Nuit d'atelier.
 * Modèles : archive-product.html, product-search-results.html, single-product.html.
 * Panier, commande et confirmation gardent les modèles de WooCommerce, habillés ici.
 * Testé avec WooCommerce 11.3.1 (version en ligne au 20/11/2026).
 */

/* ---------- Pastilles de catégories ---------- */
/* En barre, comme la barre d'outils des archives. */
.deft-chips ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--30) !important;
	border-top: 1px solid var(--wp--preset--color--border);
	padding: 0;
	list-style: none;
}

.deft-chips a {
	display: inline-block;
	padding: 0.45em 1em;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.deft-chips a:is(:hover, :focus-visible) {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--foreground);
}

.deft-chips a[aria-current="page"] {
	background: var(--wp--preset--color--foreground);
	border-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
}

/* ---------- Grille de produits ---------- */
.deft-products .wc-block-product-template {
	gap: var(--wp--preset--spacing--40) 20px;
}

.deft-products .wc-block-product {
	text-align: left;
}

.deft-products .wc-block-components-product-image,
.deft-products .wc-block-components-product-image img {
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
}

.deft-products .wc-block-components-product-image img {
	transition: opacity 0.2s;
}

.deft-products .wc-block-product:hover .wc-block-components-product-image img {
	opacity: 0.85;
}

.deft-product-meta {
	margin-top: 0.75rem;
	gap: 12px;
}

.deft-product-meta .wp-block-post-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.15;
}

.deft-product-meta .wp-block-post-title a {
	text-decoration: none;
}

.deft-products .wc-block-product:hover .wp-block-post-title a {
	color: var(--wp--preset--color--accent);
}

.deft-shop .wc-block-components-product-price,
.deft-shop .wp-block-woocommerce-product-price {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--wp--preset--color--foreground);
}

.deft-product-meta .wp-block-woocommerce-product-price {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/* Stock : on ne signale que la rupture. */
.deft-shop .wc-block-components-product-stock-indicator {
	margin: 0.25rem 0 0;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.deft-shop .wc-block-components-product-stock-indicator--in-stock,
.deft-shop .wc-block-components-product-stock-indicator--available-on-backorder {
	display: none;
}

.deft-shop .wc-block-components-product-stock-indicator--out-of-stock {
	color: var(--wp--preset--color--accent);
}

/* Badge promotion. */
.deft-shop .wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--accent);
	border: 0;
	border-radius: 2px;
	color: var(--wp--preset--color--on-accent);
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- Fiche produit ---------- */
.deft-product-columns {
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.deft-product-info {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	align-content: start;
}

.deft-product-info > * {
	margin: 0;
}

.deft-product-info .deft-eyebrow a {
	text-decoration: none;
	color: inherit;
}

.deft-product-info .wp-block-post-title {
	font-size: min(var(--deft-titre-page), 4rem);
	line-height: 1;
}

.deft-product-price {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

/* Galerie : toute la largeur de sa colonne (le bloc de WooCommerce la limite à 512 px). */
.deft-product .wp-block-woocommerce-product-image-gallery,
.deft-product .woocommerce-product-gallery {
	width: 100% !important;
	max-width: none !important;
	float: none !important;
	margin: 0;
}

.deft-product .woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
}

.deft-product .woocommerce-product-gallery__trigger {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
}

.deft-product .flex-control-thumbs {
	display: flex;
	gap: 8px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.deft-product .flex-control-thumbs img {
	opacity: 0.6;
	cursor: pointer;
}

.deft-product .flex-control-thumbs img.flex-active {
	opacity: 1;
	outline: 1px solid var(--wp--preset--color--accent);
}

/* Formulaire d'achat : quantité et bouton. */
.deft-shop .wp-block-add-to-cart-form form.cart,
.deft-shop .wc-block-add-to-cart-form form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: stretch;
}

.deft-shop .quantity .qty,
.wc-block-components-quantity-selector {
	min-height: 3rem;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
}

.deft-shop :is(.single_add_to_cart_button, .wc-block-components-product-button__button) {
	background: var(--wp--preset--color--accent) !important;
	border: 1px solid var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--on-accent) !important;
	border-radius: 2px;
	padding: 0.9em 1.6em;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.deft-shop :is(.single_add_to_cart_button, .wc-block-components-product-button__button):is(:hover, :focus-visible) {
	background: var(--wp--preset--color--foreground) !important;
	border-color: var(--wp--preset--color--foreground) !important;
	color: var(--wp--preset--color--background) !important;
}

/* Description, informations (onglets en version « minimal »). */
.deft-product-details {
	margin-top: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: var(--wp--preset--spacing--40);
}

.deft-product-details .wc-tabs,
.deft-product-details .wc-block-components-tab-list {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.deft-product-details :is(.wc-tabs li a, .wc-block-components-tab-list button) {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.deft-product-details :is(.wc-tabs li.active a, [aria-selected="true"]) {
	color: var(--wp--preset--color--foreground);
}

.deft-product-details .woocommerce-Tabs-panel {
	max-width: var(--deft-measure, 46rem);
}

/* L'onglet dit déjà « Description » : on ne répète pas le titre dans le panneau. */
.deft-product-details .woocommerce-Tabs-panel > h2:first-child {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* Produits apparentés. */
.deft-product .wp-block-woocommerce-related-products,
.deft-product .related.products {
	margin-top: var(--wp--preset--spacing--60);
}

/*
 * Vignettes des produits apparentés en 4:5, comme la grille de la boutique
 * (décision de Julien, 20/11/2026). WooCommerce 11 les rend en collection de produits et écrit
 * « aspect-ratio:1/1 » directement sur chaque image : seul !important passe devant un style en ligne.
 */
.deft-product :is(.wp-block-woocommerce-related-products, .wp-block-woocommerce-product-collection) .wc-block-components-product-image {
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.deft-product :is(.wp-block-woocommerce-related-products, .wp-block-woocommerce-product-collection) .wc-block-components-product-image img {
	width: 100%;
	height: 100% !important;
	aspect-ratio: 4 / 5 !important;
	object-fit: cover !important;
}

.deft-product :is(.wp-block-woocommerce-related-products, .wp-block-woocommerce-product-collection) :is(.wp-block-post-title, .wc-block-components-product-price, .wp-block-woocommerce-product-price) {
	text-align: left;
}

.deft-product :is(.wp-block-woocommerce-related-products, .wp-block-woocommerce-product-collection) .wp-block-post-title {
	font-size: 1rem;
	line-height: 1.15;
}

.deft-product :is(.wp-block-woocommerce-related-products, .wp-block-woocommerce-product-collection) .wp-block-post-title a {
	text-decoration: none;
}

/* ---------- Panier, commande, mon compte ---------- */
:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout, .woocommerce-account) :is(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea),
.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-blocks-components-select .wc-blocks-components-select__select {
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--foreground) !important;
	border-color: var(--wp--preset--color--border) !important;
	border-radius: 2px !important;
}

.wc-block-components-text-input label,
.wc-blocks-components-select__label {
	color: var(--wp--preset--color--muted) !important;
}

.wc-block-components-totals-wrapper,
.wc-block-components-panel,
.wc-block-cart-items,
.wc-block-cart-items td,
.wc-block-components-order-summary-item {
	border-color: var(--wp--preset--color--border) !important;
}

.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	background: var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--on-accent) !important;
	border-radius: 2px !important;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.wc-block-components-button:not(.is-link):is(:hover, :focus-visible) {
	background: var(--wp--preset--color--foreground) !important;
	color: var(--wp--preset--color--background) !important;
}

.wc-block-components-notice-banner,
.wc-block-components-notice-banner:is(.is-info, .is-success, .is-error, .is-warning) {
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--foreground) !important;
	border-color: var(--wp--preset--color--border) !important;
	border-radius: 2px;
}

.wc-block-components-notice-banner:is(.is-error, .is-warning) {
	border-color: var(--wp--preset--color--accent) !important;
}

.wc-block-components-notice-banner > svg {
	background: var(--wp--preset--color--accent) !important;
	fill: var(--wp--preset--color--on-accent) !important;
}

.wc-block-components-notice-banner a {
	color: var(--wp--preset--color--foreground);
}

/*
 * Panier, commande et compte en shortcodes « classiques » ([woocommerce_cart]…) :
 * c'est ce qu'utilisent les pages de la base actuelle.
 */
.woocommerce table.shop_table {
	border: 0;
	border-collapse: collapse;
	border-radius: 0;
	border-top: 1px solid var(--wp--preset--color--foreground);
}

.woocommerce table.shop_table :is(th, td) {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 14px 10px;
}

.woocommerce table.shop_table th {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.woocommerce table.shop_table td.product-name a {
	text-decoration: none;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
}

.woocommerce table.shop_table img {
	width: 64px;
	border-radius: 2px;
}

.woocommerce a.remove {
	color: var(--wp--preset--color--muted) !important;
}

.woocommerce a.remove:hover {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent) !important;
}

.woocommerce :is(input.input-text, .input-text, select, textarea, .qty),
.woocommerce form .form-row :is(input.input-text, textarea, select),
.select2-container--default .select2-selection--single {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	padding: 0.6em 0.8em;
}

.woocommerce :is(.button, button.button, a.button, input.button) {
	background: transparent;
	color: var(--wp--preset--color--foreground);
	border: 1px solid var(--wp--preset--color--foreground);
	border-radius: 2px;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.woocommerce :is(.button, button.button, a.button, input.button):is(:hover, :focus-visible) {
	background: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
}

.woocommerce :is(.button, button.button):disabled,
.woocommerce :is(.button, button.button)[disabled] {
	opacity: 0.4;
}

/* Action principale : valider le panier, passer la commande. */
.woocommerce :is(a.checkout-button, #place_order, button.alt, a.button.alt) {
	background: var(--wp--preset--color--accent) !important;
	border-color: var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--on-accent) !important;
}

.woocommerce :is(a.checkout-button, #place_order, button.alt, a.button.alt):is(:hover, :focus-visible) {
	background: var(--wp--preset--color--foreground) !important;
	border-color: var(--wp--preset--color--foreground) !important;
	color: var(--wp--preset--color--background) !important;
}

.woocommerce .cart-collaterals .cart_totals h2,
.woocommerce-checkout h3 {
	font-size: var(--wp--preset--font-size--medium);
}

.woocommerce :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
	border-top-color: var(--wp--preset--color--accent);
}

.woocommerce :is(.woocommerce-message, .woocommerce-info)::before {
	color: var(--wp--preset--color--accent);
}

.woocommerce-checkout #payment,
.woocommerce-checkout #payment div.payment_box {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
	border-radius: 2px;
}

.woocommerce-checkout #payment div.payment_box::before {
	border-bottom-color: var(--wp--preset--color--surface);
}

/* ---------- Mon compte ---------- */
.woocommerce-account :is(form.login, form.register, form.lost_reset_password) {
	max-width: 28rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
}

/* Même précision que la règle générale « .woocommerce :is(button.button…) », plus le contexte du compte. */
.woocommerce-account .woocommerce :is(button.woocommerce-form-login__submit, button.woocommerce-form-register__submit, form.lost_reset_password button.button) {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}

.woocommerce-account .woocommerce :is(button.woocommerce-form-login__submit, button.woocommerce-form-register__submit, form.lost_reset_password button.button):is(:hover, :focus-visible) {
	background: var(--wp--preset--color--foreground);
	border-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
}

.woocommerce-account .woocommerce-LostPassword a {
	color: var(--wp--preset--color--muted);
}

/* Menu du compte (client connecté). */
.woocommerce-MyAccount-navigation ul {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wp--preset--color--foreground);
}

.woocommerce-MyAccount-navigation li {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.woocommerce-MyAccount-navigation a {
	display: block;
	padding: 10px 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.woocommerce-MyAccount-navigation .is-active a,
.woocommerce-MyAccount-navigation a:hover {
	color: var(--wp--preset--color--foreground);
}

.woocommerce-MyAccount-navigation .is-active a {
	box-shadow: inset 2px 0 0 var(--wp--preset--color--accent);
	padding-left: 12px;
}

@media (max-width: 781px) {
	.deft-products .wc-block-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
