/* SetupExpress — styles spécifiques WordPress (par-dessus theme.css).
   1) Accessibilité / chrome WP  2) contenu Gutenberg (articles)  3) Woo custom. */

/* L'attribut hidden doit TOUJOURS gagner (le DS pose des display:flex
   sur les icônes du toggle, le menu mobile, le compteur panier…). */
[hidden] { display: none !important; }

/* Nav sticky sous la barre d'admin WordPress. */
body.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .nav { top: 46px; } }

/* Bug WordPress connu (trac #47477) : la barre d'admin impose une largeur
   minimale de 600px → scroll horizontal + page « coupée » en mobile QUAND ON
   EST CONNECTÉ. Les visiteurs ne le voient pas ; neutralisé quand même. */
#wpadminbar { min-width: 100% !important; }
@media screen and (max-width: 600px) {
	#wpadminbar { position: fixed !important; }
	#wpadminbar .ab-top-menu > li > .ab-item { padding: 0 8px !important; }
}

/* ---------- Accessibilité ---------- */
.skip-link {
	position: absolute; top: 0; left: 0; z-index: 999;
	background: var(--ink); color: var(--text-on-ink);
	padding: 0.7em 1.1em; border-radius: 0 0 10px 0;
	font-family: var(--font-mono); font-size: var(--fs-mono-sm);
	/* masqué sans décalage géométrique (pas de left:-9999px : certains
	   navigateurs mobiles étendent la zone scrollable) */
	clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
.skip-link:focus { clip-path: none; width: auto; height: auto; }
.screen-reader-text, .sx-sr-only {
	position: absolute !important; width: 1px; height: 1px;
	clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- En-tête minimal (caisse) ---------- */
.nav--minimal .nav__inner { justify-content: space-between; }
.footer--minimal { border-top: 1px solid var(--hairline); margin-top: var(--section-y); }
.footer--minimal .footer__bottom { border-top: none; padding: 1.4rem 0; }

/* ---------- Boutons : états AJAX ---------- */
.sx-btn.is-loading { opacity: 0.6; pointer-events: none; }
.sx-btn.is-added { --_bg: var(--signal); --_fg: #fff; --_bd: transparent; }

/* ---------- Fil d'ariane ---------- */
.crumbs {
	display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
	font-family: var(--font-mono); font-size: var(--fs-mono-sm);
	color: var(--text-muted); letter-spacing: 0.01em;
	padding: 1.1rem 0 0;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--accent-deep); }
.crumbs__sep { color: var(--border-strong); }
.crumbs [aria-current] { color: var(--text); }

/* ---------- Contenu Gutenberg (blocs seedés depuis articles.json) ---------- */
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); letter-spacing: var(--ls-snug); color: var(--text-strong); margin-top: 2.2em; scroll-margin-top: 96px; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h4); color: var(--text-strong); margin-top: 1.8em; }
.prose p, .prose li { font-size: var(--fs-body); line-height: var(--lh-relaxed); color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: 0.5em; }
.prose a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
	margin: 1.6em 0; padding: 0.4em 0 0.4em 1.2em;
	border-left: 3px solid var(--accent); color: var(--text-strong);
	font-family: var(--font-display); font-size: var(--fs-body-lg); line-height: 1.55;
}
.prose code { font-family: var(--font-mono); font-size: 0.92em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.prose table th { font-family: var(--font-mono); font-size: var(--fs-mono-sm); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 0.6em 0.9em; border-bottom: 2px solid var(--border-strong); }
.prose table td { padding: 0.7em 0.9em; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose .sx-callout { margin: 1.6em 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-card); }

/* ---------- Formulaires (contact / urgence / support) ---------- */
.sx-form { display: flex; flex-direction: column; gap: 1.1rem; }
.sx-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) { .sx-form__row { grid-template-columns: 1fr; } }
.sx-form__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.3rem; }
.sx-form__notice { border-radius: var(--r-card); padding: 0.9rem 1.1rem; font-size: var(--fs-small); }
.sx-form__notice--ok { background: var(--signal-tint); color: var(--signal); }
.sx-form__notice--err { background: var(--negative-tint); color: var(--negative); }
.sx-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Caisse : contrôles panier + 2× + paiement ---------- */
.sx-checkout--review { max-width: none; }
.sx-checkout__line .chk-cart__meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.9rem; margin-top: 0.35rem; }
.chk-cart__qty { display: inline-flex; align-items: center; gap: 0.15rem; border: 1px solid var(--border-strong); border-radius: var(--r-pill); }
.chk-cart__qty button { background: none; border: 0; cursor: pointer; color: var(--text); font-family: var(--font-mono); font-size: 1rem; line-height: 1; padding: 0.25rem 0.6rem; }
.chk-cart__qty button:hover { color: var(--accent-deep); }
.chk-cart__qty span { font-family: var(--font-mono); font-size: var(--fs-mono-sm); min-width: 1.2em; text-align: center; }
.chk-cart__rm { background: none; border: 0; cursor: pointer; font-family: var(--font-mono); font-size: var(--fs-mono-sm); color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.chk-cart__rm:hover { color: var(--negative); }
.sx-checkout__amt--var { color: var(--text-muted); font-size: var(--fs-mono-sm); }

.chk-pay { margin-top: 1rem; }
/* Erreurs de validation Woo (préposées au form par checkout.js) : pleine largeur de la grille. */
.chk-grid > .woocommerce-NoticeGroup, .chk-grid > .woocommerce-error, .chk-grid > .woocommerce-message { grid-column: 1 / -1; }
.chk-pay__methods { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.chk-pay__methods li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 0.8rem 1rem; }
.chk-pay__methods label { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--text-strong); cursor: pointer; }
.chk-pay__methods .payment_box { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 0.5rem; }
.chk-pay__methods input[type="radio"] { accent-color: var(--accent); margin-right: 0.4rem; }
.chk-pay__place .sx-checkout__note { justify-content: center; }
.chk-installments { border: 1px solid var(--border-strong); border-radius: var(--r-card); padding: 0.9rem 1rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.55rem; background: var(--surface); }
.chk-installments legend { padding: 0 0.3rem; }
.chk-installments input[type="radio"] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; }

/* ---------- Caisse : code promo discret + toggle Woo masqué ---------- */
.woocommerce-form-coupon-toggle { display: none !important; }
.chk-coupon { margin-top: 0.85rem; }
.chk-coupon summary { cursor: pointer; font-family: var(--font-mono); font-size: var(--fs-mono-sm); color: var(--text-muted); letter-spacing: 0.01em; }
.chk-coupon summary:hover { color: var(--accent-deep); }
.chk-coupon form.checkout_coupon { display: flex !important; gap: 0.5rem; margin-top: 0.6rem; }
.chk-coupon form.checkout_coupon .sx-field__input { flex: 1; min-width: 0; }

/* ---------- Pages WooCommerce (compte) ---------- */
.sx-wcpage { padding-bottom: var(--section-y); }
.sx-wcpage > .woocommerce { margin-top: 1.2rem; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.woocommerce-MyAccount-navigation a { display: inline-block; font-family: var(--font-mono); font-size: var(--fs-mono-sm); letter-spacing: 0.02em; padding: 0.5em 0.95em; border: 1px solid var(--border-strong); border-radius: var(--r-pill); color: var(--text); text-decoration: none; }
.woocommerce-MyAccount-navigation a:hover { border-color: var(--accent-deep); color: var(--accent-deep); }
.woocommerce-MyAccount-navigation li.is-active a { background: var(--ink); border-color: var(--ink); color: var(--text-on-ink); }
.woocommerce table.shop_table, .woocommerce-orders-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.woocommerce table.shop_table th, .woocommerce-orders-table th { font-family: var(--font-mono); font-size: var(--fs-mono-sm); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 0.7em 1em; border-bottom: 2px solid var(--border-strong); }
.woocommerce table.shop_table td, .woocommerce-orders-table td { padding: 0.75em 1em; border-bottom: 1px solid var(--border); font-size: var(--fs-small); }

/* ---------- WooCommerce : notices au DS ---------- */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-message, .woocommerce-info, .woocommerce-error li {
	font-family: var(--font-sans); font-size: var(--fs-small);
	border-radius: var(--r-card); padding: 0.9rem 1.1rem; margin: 0.6rem 0;
	list-style: none;
}
.woocommerce-message { background: var(--signal-tint); color: var(--signal); }
.woocommerce-info { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.woocommerce-error { margin: 0; padding: 0; }
.woocommerce-error li { background: var(--negative-tint); color: var(--negative); }

/* Champs Woo mappés sur .sx-field */
.woocommerce form .form-row { margin: 0; padding: 0; }
.form-row label { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--text-strong); display: block; margin-bottom: 0.45rem; }
.form-row .optional { font-family: var(--font-mono); font-size: var(--fs-mono-sm); font-weight: 400; color: var(--text-muted); }
.form-row .input-text, .form-row select, .form-row textarea {
	font-family: var(--font-sans); font-size: var(--fs-body); color: var(--text-strong);
	background: var(--field-bg); border: 1px solid var(--border-strong);
	border-radius: var(--r-sm); padding: 0.7em 0.85em; width: 100%;
	transition: border-color var(--dur-fast) var(--ease-out);
}
.form-row .input-text:focus-visible, .form-row select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.form-row.woocommerce-invalid .input-text { border-color: var(--negative); }
