/* ==========================================================================
   PIX – Panier / Commande (blocs WooCommerce)
   Chargé uniquement sur les pages panier, commande, confirmation et Mon compte
   (mu-plugin pix-cartes-cadeaux).
   Couleurs et polices reprises de themes/tendance/pix-custom.css.
   ========================================================================== */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart, .woocommerce-order) {
	--pix-cc-vert-fonce: #4b5f52; /* titres h1 / h3 */
	--pix-cc-vert:       #72927C; /* titres h2, boutons, bordures */
	--pix-cc-orange:     #dd6c49; /* liens, prix */
	--pix-cc-text:       #262626;

	color: var(--pix-cc-text);
	font-family: "Lato", sans-serif;
}


/* --- Titres des étapes et des blocs ---------------------------------------- */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart, .woocommerce-order) :is(
	.wc-block-components-title,
	.wc-block-components-checkout-step__title,
	.wc-block-cart__totals-title,
	.wc-block-components-order-summary__button-text,
	h2,
	h3
) {
	font-family: "Anton", sans-serif;
	font-weight: 400;
	text-transform: uppercase;
	color: var(--pix-cc-vert-fonce);
	letter-spacing: 0;
}


/* --- Liens ------------------------------------------------------------------ */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart, .woocommerce-order, .woocommerce-MyAccount-content) a:not(.wc-block-components-button):not(.wp-element-button):not(.wp-block-button__link):not(.button) {
	color: var(--pix-cc-orange);
	font-weight: 700;
}


/* --- Champs de saisie ------------------------------------------------------ */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-text-input input,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-textarea,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-blocks-components-select .wc-blocks-components-select__select,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input {
	font-family: "Lato", sans-serif;
	color: var(--pix-cc-text);
	border: 1px solid var(--pix-cc-vert);
	border-radius: 0;
	background-color: #fff;
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-text-input input:focus,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-textarea:focus,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-blocks-components-select .wc-blocks-components-select__select:focus,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus {
	outline: none;
	border-color: var(--pix-cc-vert-fonce);
	box-shadow: 0 0 0 1px var(--pix-cc-vert-fonce);
}

/* Libellés flottants des champs */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-text-input label,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-blocks-components-select .wc-blocks-components-select__label {
	color: #707172;
}

/* Champs en erreur : on garde le rouge de WooCommerce */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .has-error input,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .has-error select {
	border-color: #cc1818;
	box-shadow: none;
}


/* --- Cases à cocher (CGV, adresse de facturation identique…) --------------- */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	border: 1px solid var(--pix-cc-vert);
	border-radius: 0;
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	background-color: var(--pix-cc-vert);
	border-color: var(--pix-cc-vert);
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: #fff;
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:focus {
	outline: 2px solid var(--pix-cc-vert-fonce);
	outline-offset: 2px;
}


/* --- Boutons radio (moyens de paiement) ------------------------------------ */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-radio-control__input {
	border-color: var(--pix-cc-vert);
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-radio-control__input:checked {
	border-color: var(--pix-cc-vert);
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-radio-control__input:checked::before {
	background: var(--pix-cc-vert);
}

/* Moyen de paiement sélectionné : cadre vert */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted {
	box-shadow: inset 0 0 0 2px var(--pix-cc-vert);
	border-radius: 0;
}


/* --- Récapitulatif : produits, prix, total --------------------------------- */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-product-name {
	color: var(--pix-cc-vert-fonce);
	font-weight: 700;
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-product-price,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-formatted-money-amount {
	color: var(--pix-cc-text);
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-totals-footer-item .wc-block-components-formatted-money-amount {
	font-weight: 900;
	color: var(--pix-cc-orange);
}

/* Infos du bénéficiaire (PDF Vouchers) sous le produit */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-product-details {
	color: #707172;
}


/* ==========================================================================
   BOUTONS WOOCOMMERCE : style a.pix-bouton (pix-custom.css)
   bordure verte pointillée, Lato 900 majuscules, remplissage animé au survol.
   - blocs Panier / Validation : « Commander », « Valider la commande », « Appliquer » ;
   - panier vide : « Retour à la boutique » ;
   - pages WooCommerce classiques : Mon compte (connexion, inscription, mot de passe
     perdu, enregistrer), confirmation de commande (télécharger le bon cadeau),
     liste des commandes (« Voir », « Payer », « Commander à nouveau »).
   Exclus : boutons des notifications (style sobre, plus bas) et boutons de type lien.
   Les !important neutralisent les couleurs de woocommerce.css (violet au survol, gris…).
   ========================================================================== */

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link),
.wp-block-woocommerce-cart :is(.wp-block-button__link, .wp-element-button):not(.is-link),
.woocommerce :is(a.button, button.button, input.button):not(:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) *) {
	position: relative;
	z-index: 1;
	overflow: hidden;
	/* pas de « display » ici : les boutons des blocs gardent leur mise en page
	   (inline-flex, largeur gérée par WooCommerce) ; voir la règle suivante */
	min-height: 0;
	padding: 10px 25px;
	font-family: "Lato", sans-serif;
	font-style: normal;
	font-size: 20px;
	font-weight: 900;
	line-height: 1.4;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	text-shadow: none;
	cursor: pointer;
	color: #72927C !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	transition: all .2s ease 0s;

	/* bordure pointillée (identique à a.pix-bouton) */
	background-color: transparent !important;
	background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%2372927C' stroke-width='4' stroke-dasharray='6%2c 10' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e") !important;
	background-size: calc(100% - 1px) calc(100% - 1px) !important;
	background-position: center center !important;
	background-repeat: no-repeat !important;
}

/* Boutons hors blocs (panier vide, pages classiques) : en ligne, largeur du texte */
.wp-block-woocommerce-cart .wp-block-button__link,
.woocommerce :is(a.button, button.button, input.button):not(:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) *) {
	display: inline-block;
}

/* Fond animé au survol (identique à a.pix-bouton::before) */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link)::before,
.wp-block-woocommerce-cart :is(.wp-block-button__link, .wp-element-button):not(.is-link)::before,
.woocommerce :is(a.button, button.button, input.button):not(:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) *)::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #72927C;
	clip-path: polygon(0% 0%, 0% 100%, 0 100%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%, 100% 100%, 100% 0%);
	transition: clip-path .2s ease;
	z-index: -1;
}

:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link):is(:hover, :focus-visible)::before,
.wp-block-woocommerce-cart :is(.wp-block-button__link, .wp-element-button):not(.is-link):is(:hover, :focus-visible)::before,
.woocommerce :is(a.button, button.button, input.button):not(:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) *):is(:hover, :focus-visible)::before {
	clip-path: polygon(0% 0%, 0% 100%, 3px 100%, 3px 3px, calc(100% - 3px) 3px, calc(100% - 3px) calc(100% - 3px), 3px calc(100% - 3px), 3px 100%, 100% 100%, 100% 0%);
}

/* Focus clavier visible */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link):focus-visible,
.wp-block-woocommerce-cart :is(.wp-block-button__link, .wp-element-button):not(.is-link):focus-visible,
.woocommerce :is(a.button, button.button, input.button):focus-visible {
	outline: 2px dashed #dd6c49;
	outline-offset: 3px;
}

/* Désactivé / en cours de traitement : grisé, sans animation */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link):is(:disabled, [aria-disabled="true"]),
.woocommerce :is(button.button, input.button):disabled,
.woocommerce :is(a.button, button.button).disabled {
	opacity: .5;
	cursor: not-allowed;
}
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link):is(:disabled, [aria-disabled="true"])::before,
.woocommerce :is(button.button, input.button):disabled::before,
.woocommerce :is(a.button, button.button).disabled::before {
	clip-path: polygon(0% 0%, 0% 100%, 0 100%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%, 100% 100%, 100% 0%);
}

/* Pages classiques (Mon compte, confirmation) : un cran plus petit */
.woocommerce :is(a.button, button.button, input.button):not(:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) *) {
	padding: 8px 20px;
	font-size: 16px;
}

/* Dans les tableaux (« Voir », « Télécharger »…) : compacts, empilables */
.woocommerce table :is(a.button, button.button):not(:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) *) {
	margin: 2px 4px 2px 0;
	padding: 6px 14px;
	font-size: 14px;
	white-space: nowrap;
}

/* Spinner du bouton pendant la validation */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button .wc-block-components-spinner::after {
	border-color: var(--pix-cc-vert) var(--pix-cc-vert) transparent;
}

/* Boutons secondaires de type lien (« Retour au panier », « Ajouter un code promo ») */
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.is-link,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-checkout-return-to-cart-button,
:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-panel__button {
	color: var(--pix-cc-orange);
	font-weight: 700;
}

/* --- Confirmation de commande / Mon compte : tableaux ---------------------- */
/* (Téléchargements, Détails de la commande, Commandes)                     */

:is(.woocommerce-order, .woocommerce-MyAccount-content) table.shop_table {
	border: 1px solid #BDC7AF;
	border-radius: 0;
	border-collapse: collapse;
	font-family: "Lato", sans-serif;
}

:is(.woocommerce-order, .woocommerce-MyAccount-content) table.shop_table th,
:is(.woocommerce-order, .woocommerce-MyAccount-content) table.shop_table td {
	border: 0;
	border-top: 1px solid #BDC7AF;
	background: none !important; /* annule le fond gris des lignes impaires du thème Hello */
	padding: 12px 15px;
	vertical-align: middle;
}

:is(.woocommerce-order, .woocommerce-MyAccount-content) table.shop_table thead th {
	border-top: 0;
	font-weight: 700;
	color: #4b5f52;
	background-color: rgba(114, 146, 124, .12) !important; /* vert #72927C très clair */
}

:is(.woocommerce-order, .woocommerce-MyAccount-content) table.shop_table tfoot th,
:is(.woocommerce-order, .woocommerce-MyAccount-content) table.shop_table tfoot td {
	font-weight: 700;
}

/* Titres de section (Téléchargements, Détails de la commande, Adresse…) */
:is(.woocommerce-order, .woocommerce-MyAccount-content) :is(h2, h3) {
	font-family: "Anton", sans-serif;
	font-weight: 400;
	text-transform: uppercase;
	color: #4b5f52;
}



/* --- Lien « Ajouter une autre carte cadeau » sous le panier --------------- */

.pix-cc-add-another {
	margin: 1em 0 2em;
	font-family: "Lato", sans-serif;
	font-size: 18px;
}

.pix-cc-add-another a {
	color: #dd6c49;
	font-weight: 700;
	text-decoration: none;
}

.pix-cc-add-another a:hover {
	text-decoration: underline;
}


/* --- Panier vide ------------------------------------------------------------ */

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title {
	font-family: "Anton", sans-serif;
	font-weight: 400;
	text-transform: uppercase;
	color: var(--pix-cc-vert-fonce, #4b5f52);
}

@media (max-width: 767px) {
	:is(.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) .wc-block-components-button.contained:not(.is-link),
	.wp-block-woocommerce-cart :is(.wp-block-button__link, .wp-element-button):not(.is-link) {
		padding: 7px 15px;
		font-size: 18px;
	}
}


/* ==========================================================================
   BOUTONS DES NOTIFICATIONS WOOCOMMERCE : style sobre
   (« Voir le panier », « Parcourir les produits »… dans les bandeaux
   de message / info / erreur) : simple lien souligné, sans cadre ni fond.
   ========================================================================== */

:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(a.button, button.button) {
	float: right;
	margin: 0 0 0 1em;
	padding: 0;
	font-family: "Lato", sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: inherit;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	color: #dd6c49 !important;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

:is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(a.button, button.button):hover {
	color: #4b5f52 !important;
}
