/*
 * WooCommerce aux couleurs Wonderland : boutique, fiche produit, panier, commande,
 * mini-panier. Les blocs WooCommerce gardent leur fonctionnement ; seul l'habillage change.
 */

/* --- Pilule « Panier · N » (mini-panier de l'en-tête boutique) -------------- */

.wonderland-panier .wc-block-mini-cart__button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	font-family: var(--wp--preset--font-family--raleway);
	font-size: 15px;
	font-weight: 700;
	color: var(--wp--preset--color--aubergine);
	background: var(--wp--preset--color--caramel);
	border-radius: var(--wp--custom--rayon--pilule);
	white-space: nowrap;
}

.wonderland-panier .wc-block-mini-cart__button:hover {
	background: var(--wp--preset--color--creme);
}

.wonderland-panier .wc-block-mini-cart__quantity-badge {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.wonderland-panier .wc-block-mini-cart__icon {
	width: 20px;
	height: 20px;
	margin: 0;
	color: var(--wp--preset--color--aubergine);
}

/* Le badge rond de WooCommerce devient du texte : « Panier · 2 » */
.wonderland-panier .wc-block-mini-cart__badge {
	position: static;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	transform: none;
	font-size: inherit;
	font-weight: inherit;
	color: inherit !important;
	background: none !important;
	border: 0;
	border-radius: 0;
}

.wonderland-panier .wc-block-mini-cart__badge::before {
	content: "Panier ·\00a0";
}

/* --- Filtres --------------------------------------------------------------- */

.wonderland-filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding-bottom: 40px;
}

.wonderland-filtre {
	padding: 11px 22px;
	font-size: 15px;
	font-weight: 700;
	color: var(--wp--preset--color--creme);
	text-decoration: none;
	border: 2px solid rgba(252, 248, 216, 0.35);
	border-radius: var(--wp--custom--rayon--pilule);
}

.wonderland-filtre:hover {
	color: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--creme);
}

.wonderland-filtre[aria-current="page"] {
	color: var(--wp--preset--color--aubergine);
	background: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--creme);
}

/* --- Grille de la boutique ------------------------------------------------- */

/* Produits WooCommerce et cartes fixes partagent la même grille. */
.wonderland-grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
	gap: 24px;
}

.wonderland-grille > *,
.wonderland-grille .wp-block-woocommerce-product-collection,
.wonderland-grille .wc-block-product-template {
	margin: 0;
}

.wonderland-grille .wp-block-woocommerce-product-collection,
.wonderland-grille .wc-block-product-template {
	display: contents;
}

.wonderland-grille .wp-block-woocommerce-product-collection > :not(.wc-block-product-template) {
	grid-column: 1 / -1;
}

/* Les cartes fixes (tireuse, bientôt) ne s'affichent que sur la boutique complète. */
.tax-product_cat .wonderland-carte-fixe {
	display: none;
}

/* --- Carte produit (boutique, produits apparentés, cartes fixes) ----------- */

.wonderland-carte-produit,
.wc-block-product-template .wc-block-product {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
	text-align: left;
	background: var(--wp--preset--color--aubergine-clair);
	border-radius: 24px;
}

.wonderland-carte-produit > *,
.wc-block-product-template .wc-block-product > * {
	margin: 0;
}

.wc-block-product .wc-block-components-product-image,
.wonderland-carte-produit__image {
	align-self: center;
	width: 180px;
	margin-bottom: 8px !important;
}

.wc-block-product .wc-block-components-product-image img,
.wonderland-carte-produit__image img {
	width: 180px;
	height: 180px;
	object-fit: contain;
	border-radius: 0;
}

.wonderland-carte-produit__image--photo img {
	object-fit: cover;
	border-radius: 50%;
}

.wonderland-produit-type {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wonderland-produit-couleur, var(--wp--preset--color--vert-houblon));
}

/* Même alternance de couleurs que les cartes de l'accueil */
.wonderland-est-biere:nth-child(3n + 1 of .wonderland-est-biere) { --wonderland-produit-couleur: var(--wp--preset--color--turquoise); }
.wonderland-est-biere:nth-child(3n + 2 of .wonderland-est-biere) { --wonderland-produit-couleur: var(--wp--custom--couleur--magenta-doux); }
.wonderland-est-biere:nth-child(3n + 3 of .wonderland-est-biere) { --wonderland-produit-couleur: var(--wp--custom--couleur--dore); }
.wonderland-produit-type--caramel { --wonderland-produit-couleur: var(--wp--preset--color--caramel); }
.wonderland-produit-type--turquoise { --wonderland-produit-couleur: var(--wp--preset--color--turquoise); }

.wonderland-carte-produit__nom,
.wc-block-product .wp-block-post-title {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0;
}

.wc-block-product .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.wonderland-produit-detail {
	font-size: 15px;
	color: var(--wp--preset--color--beige-rose);
}

.wonderland-carte-produit__pied {
	margin-top: auto !important;
	padding-top: 10px;
	align-items: center;
}

.wc-block-product .wc-block-components-product-price,
.wonderland-carte-produit__prix {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 26px;
	font-weight: 700;
	color: var(--wp--preset--color--creme);
}

/* Bouton « Ajouter » crème, comme la maquette */
.wc-block-product .wc-block-components-product-button {
	margin: 0;
}

.wc-block-product .wc-block-components-product-button .wp-block-button__link,
.wc-block-product .wp-block-button__link.add_to_cart_button {
	padding: 12px 22px;
	font-size: 15px;
	color: var(--wp--preset--color--aubergine);
	background: var(--wp--preset--color--creme);
}

.wc-block-product .wc-block-components-product-button .wp-block-button__link:hover {
	background: var(--wp--preset--color--caramel);
}

.wc-block-components-product-button .added_to_cart {
	font-size: 14px;
	color: var(--wp--preset--color--beige-rose);
}

/* Carte « Bientôt » */
.wonderland-carte-bientot {
	background: var(--wp--custom--couleur--aubergine-nuit);
	border: 2px solid var(--wp--preset--color--turquoise);
}

.wonderland-icone-eclat {
	align-self: center;
	width: 72px;
	height: 180px;
	background-color: var(--wp--preset--color--turquoise);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M4.9 4.9l14.2 14.2M2 12h20M4.9 19.1L19.1 4.9'/%3E%3C/svg%3E") center / 72px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M4.9 4.9l14.2 14.2M2 12h20M4.9 19.1L19.1 4.9'/%3E%3C/svg%3E") center / 72px no-repeat;
}

/* --- Fiche produit --------------------------------------------------------- */

.wonderland-fil-ariane,
.wonderland-fil-ariane a {
	font-size: 14px;
	color: var(--wp--preset--color--beige-rose);
}

.wonderland-produit-visuel {
	padding: 40px;
	background: var(--wp--preset--color--aubergine-clair);
	border-radius: var(--wp--custom--rayon--carte);
}

.wonderland-produit-visuel .woocommerce-product-gallery {
	margin: 0;
}

.wonderland-produit-visuel .woocommerce-product-gallery__image img {
	border-radius: 16px;
}

.wonderland-produit-visuel .flex-control-thumbs {
	display: flex;
	gap: 12px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.wonderland-produit-visuel .flex-control-thumbs li {
	width: 72px;
}

.wonderland-produit-visuel .flex-control-thumbs img {
	border-radius: 12px;
	opacity: 0.6;
	cursor: pointer;
}

.wonderland-produit-visuel .flex-control-thumbs img.flex-active,
.wonderland-produit-visuel .flex-control-thumbs img:hover {
	opacity: 1;
}

.wonderland-produit-prix .wc-block-components-product-price,
.wonderland-produit-prix {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
}

.wonderland-ajout-panier form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 8px 0;
}

/* Champ quantité (fiche produit) */
.wonderland-ajout-panier .quantity .qty,
.wc-block-components-quantity-selector {
	min-height: 52px;
	color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--aubergine-clair);
	border: 2px solid rgba(252, 248, 216, 0.25);
	border-radius: var(--wp--custom--rayon--pilule);
}

.wonderland-ajout-panier .quantity .qty {
	width: 96px;
	padding: 0 16px;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	text-align: center;
}

.wonderland-ajout-panier .single_add_to_cart_button {
	padding: 16px 30px;
	font-family: var(--wp--preset--font-family--raleway);
	font-size: 16px;
	font-weight: 700;
	color: var(--wp--preset--color--aubergine);
	background: var(--wp--preset--color--caramel);
	border: 0;
	border-radius: var(--wp--custom--rayon--pilule);
	cursor: pointer;
}

.wonderland-ajout-panier .single_add_to_cart_button:hover {
	background: var(--wp--preset--color--creme);
}

/* Onglets Description / Informations complémentaires */
.wp-block-woocommerce-product-details .wc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
	border: 0;
}

.wp-block-woocommerce-product-details .wc-tabs li {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	opacity: 1;
}

.wp-block-woocommerce-product-details .wc-tabs li a {
	display: block;
	padding: 11px 22px;
	font-size: 15px;
	font-weight: 700;
	color: var(--wp--preset--color--creme);
	text-decoration: none;
	border: 2px solid rgba(252, 248, 216, 0.35);
	border-radius: var(--wp--custom--rayon--pilule);
}

.wp-block-woocommerce-product-details ul.wc-tabs li.active a {
	color: var(--wp--preset--color--aubergine) !important;
	background: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--creme);
}

/* Filets et arrondis décoratifs de WooCommerce autour des onglets */
.wp-block-woocommerce-product-details ul.wc-tabs::before,
.wp-block-woocommerce-product-details ul.wc-tabs li::before,
.wp-block-woocommerce-product-details ul.wc-tabs li::after {
	display: none !important;
}

.wp-block-woocommerce-product-details .woocommerce-Tabs-panel > h2:first-child {
	display: none;
}

.woocommerce-product-attributes {
	width: 100%;
	max-width: 640px;
	border-collapse: collapse;
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
	padding: 14px 0;
	text-align: left;
	border-bottom: 1px solid var(--wp--custom--couleur--filet);
}

.woocommerce-product-attributes th {
	width: 40%;
	font-weight: 700;
	color: var(--wp--preset--color--beige-rose);
}

.woocommerce-product-attributes td,
.woocommerce-product-attributes td p {
	margin: 0;
	font-style: normal;
}

/* Produits apparentés : titre de section */
.wp-block-woocommerce-related-products h2,
.wp-block-woocommerce-product-collection > h2 {
	font-size: var(--wp--preset--font-size--huge);
}

/* --- Panier & commande (blocs WooCommerce) --------------------------------- */

.wc-block-cart,
.wc-block-checkout {
	color: var(--wp--preset--color--creme);
}

/* Colonne récapitulative en carte */
.wc-block-cart .wc-block-cart__sidebar,
.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	padding: 28px;
	background: var(--wp--preset--color--aubergine-clair);
	border: 0;
	border-radius: var(--wp--custom--rayon--carte);
}

.wc-block-components-totals-wrapper,
.wc-block-cart-items td,
.wc-block-cart-items th,
.wc-block-cart-items {
	border-color: var(--wp--custom--couleur--filet) !important;
}

.wc-block-cart-items__header,
.wc-block-components-totals-item__label,
.wc-block-components-product-metadata,
.wc-block-components-checkout-step__description,
.wc-block-components-checkout-step__title + * {
	color: var(--wp--preset--color--beige-rose);
}

.wc-block-components-title,
.wc-block-components-checkout-step__title,
.wc-block-cart__totals-title {
	font-family: var(--wp--preset--font-family--fraunces) !important;
	font-weight: 700 !important;
	letter-spacing: 0;
	text-transform: none !important;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	color: var(--wp--preset--color--creme);
}

.wc-block-cart-item__image img,
.wc-block-components-order-summary-item__image img {
	border-radius: 0;
}

.wc-block-components-product-name {
	font-weight: 700;
	color: var(--wp--preset--color--creme);
	text-decoration: none;
}

/* Pastille de quantité sur les miniatures du récapitulatif */
.wc-block-components-order-summary-item__quantity {
	color: var(--wp--preset--color--aubergine);
	background: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--aubergine-clair);
	box-shadow: none;
}

/* Sélecteur de quantité du panier */
.wc-block-components-quantity-selector {
	min-height: 0;
	border-width: 1px;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	color: var(--wp--preset--color--creme);
	background: transparent;
}

.wc-block-components-quantity-selector::after {
	border: 0;
}

.wc-block-cart-item__remove-link {
	color: var(--wp--preset--color--beige-rose) !important;
}

/* Boutons principaux : « Valider la commande », « Commander » */
.wc-block-components-button:not(.is-link) {
	min-height: 54px;
	padding: 16px 30px;
	font-family: var(--wp--preset--font-family--raleway);
	font-size: 16px;
	font-weight: 700;
	color: var(--wp--preset--color--aubergine) !important;
	background: var(--wp--preset--color--caramel) !important;
	border: 0;
	border-radius: var(--wp--custom--rayon--pilule);
}

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

.wc-block-components-button.is-link,
.wc-block-components-checkout-return-to-cart-button {
	color: var(--wp--preset--color--beige-rose);
}

/* Champs de formulaire */
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-block-components-select select,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-combobox .components-combobox-control input,
.wc-block-components-totals-coupon input {
	color: var(--wp--preset--color--creme) !important;
	background: var(--wp--preset--color--aubergine-clair) !important;
	border: 1px solid rgba(252, 248, 216, 0.25) !important;
	border-radius: 14px !important;
}

.wc-block-components-text-input input:focus,
.wc-block-components-textarea:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus {
	border-color: var(--wp--preset--color--turquoise) !important;
	box-shadow: 0 0 0 1px var(--wp--preset--color--turquoise) !important;
}

.wc-block-components-text-input label,
.wc-block-components-textarea + label,
.wc-blocks-components-select .wc-blocks-components-select__label,
.wc-block-components-combobox label {
	color: var(--wp--preset--color--beige-rose) !important;
}

.wc-blocks-components-select .wc-blocks-components-select__container {
	background: transparent;
}

.wc-blocks-components-select svg {
	fill: var(--wp--preset--color--creme);
}

/* Cases à cocher et boutons radio */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
.wc-block-components-radio-control__input {
	background: var(--wp--preset--color--aubergine-clair) !important;
	border-color: rgba(252, 248, 216, 0.5) !important;
}

.wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: var(--wp--preset--color--turquoise);
}

.wc-block-components-radio-control__input:checked::before {
	background: var(--wp--preset--color--turquoise) !important;
}

/* Options (mode de retrait, paiement) en cartes */
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option,
.wc-block-checkout__shipping-method-option,
.wc-block-checkout__pickup-options .wc-block-components-radio-control__option {
	color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--aubergine-clair);
	border-color: rgba(252, 248, 216, 0.2) !important;
	border-radius: 16px !important;
	box-shadow: none !important;
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option-checked,
.wc-block-checkout__shipping-method-option--selected {
	border-color: var(--wp--preset--color--turquoise) !important;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--turquoise) !important;
}

.wc-block-checkout__shipping-method-option-icon,
.wc-block-checkout__shipping-method-option svg {
	fill: currentColor;
}

/* Bandeaux d'information */
.wc-block-components-notice-banner {
	color: var(--wp--preset--color--aubergine);
	border-radius: 16px;
}

.wc-block-components-notice-banner a {
	color: inherit;
}

/* Panier vide */
.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title {
	font-size: var(--wp--preset--font-size--xx-large);
}

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title::before {
	background-color: var(--wp--preset--color--caramel);
}

/* --- Panneau du mini-panier ------------------------------------------------ */

.wc-block-mini-cart__drawer .components-modal__content,
.wc-block-components-drawer {
	color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--aubergine);
}

.wc-block-mini-cart__title {
	font-family: var(--wp--preset--font-family--fraunces);
	font-weight: 700;
}

.wc-block-mini-cart__footer {
	border-top: 1px solid var(--wp--custom--couleur--filet);
}

.wc-block-components-drawer__close {
	color: var(--wp--preset--color--creme) !important;
}

.wc-block-mini-cart__footer-actions .wc-block-components-button.outlined {
	color: var(--wp--preset--color--creme) !important;
	background: transparent !important;
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--creme);
}
