/*
 * Ochanta — base commune des widgets WooCommerce compatibles The7 : étoiles de note, prix,
 * badge « Promo », mention « Rupture de stock », choix des variations (listes et pastilles),
 * états des boutons d'ajout au panier (chargement, ajouté).
 *
 * Variables posées par les réglages des widgets : --variations-direction / -align / -justify,
 * --label-justify, --label-margin*, --align-variation-items, --variations-opacity,
 * --variations-border-color, --swatch-variations-border-color, --out-of-stock-line-color,
 * --out-of-stock-swatch-line-color, --sale-h-position / --sale-v-position.
 */

/* Étoiles : cinq étoiles grises, recouvertes des étoiles pleines sur la largeur de la note. */
.the7-elementor-widget .star-rating,
[class*="elementor-widget-the7-woocommerce"] .star-rating {
	position: relative;
	display: inline-block;
	overflow: hidden;
	width: 5.4em;
	height: 1em;
	font-size: 14px;
	font-family: Arial, sans-serif;
	line-height: 1;
	letter-spacing: .1em;
	vertical-align: middle;
}

.the7-elementor-widget .star-rating:before,
[class*="elementor-widget-the7-woocommerce"] .star-rating:before {
	position: absolute;
	top: 0;
	left: 0;
	content: "\2605\2605\2605\2605\2605";
	color: rgba(0, 0, 0, .15);
}

.the7-elementor-widget .star-rating > span,
[class*="elementor-widget-the7-woocommerce"] .star-rating > span {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	height: 100%;
	padding-top: 1.5em;
	color: transparent;
}

.the7-elementor-widget .star-rating > span:before,
[class*="elementor-widget-the7-woocommerce"] .star-rating > span:before {
	position: absolute;
	top: 0;
	left: 0;
	content: "\2605\2605\2605\2605\2605";
	color: var(--the7-accent-color, #f5a623);
}

/* Prix */
.the7-elementor-widget .price,
[class*="elementor-widget-the7-woocommerce"] .price {
	display: block;
	color: var(--the7-title-color, inherit);
}

.the7-elementor-widget .price del,
[class*="elementor-widget-the7-woocommerce"] .price del {
	margin-right: .3em;
	opacity: .6;
}

.the7-elementor-widget .price ins,
[class*="elementor-widget-the7-woocommerce"] .price ins {
	background: none;
	text-decoration: none;
}

/* Badge « Promo » et « Rupture de stock » sur l'image */
.the7-elementor-widget .onsale,
.the7-elementor-widget .out-stock-label {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 40px;
	min-height: 0;
	margin: 10px;
	padding: 4px 10px;
	border-radius: 0;
	background-color: var(--the7-accent-color, #c00);
	color: #fff;
	font-size: 12px;
	font-weight: bold;
	line-height: 1.4;
	text-transform: uppercase;
	transform: translate(var(--sale-h-position, 0), var(--sale-v-position, 0));
}

.the7-elementor-widget .out-stock-label {
	top: 50%;
	left: 50%;
	margin: 0;
	background-color: rgba(0, 0, 0, .65);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

/* Variations : une rangée par attribut (libellé + choix). */
.products-variations-wrap {
	display: none;
	flex-flow: column nowrap;
	gap: 10px;
	box-sizing: border-box;
	opacity: var(--variations-opacity, 1);
	transition: opacity .3s;
}

.wf-cell:hover .products-variations-wrap,
.e-loop-item:hover .products-variations-wrap,
.products-variations-wrap:focus-within {
	opacity: 1;
}

.product-variation-row {
	display: flex;
	flex-direction: var(--variations-direction, row);
	align-items: var(--variations-align, center);
	justify-content: var(--variations-justify, var(--align-variation-items, flex-start));
}

.product-variation-row > span {
	justify-content: var(--label-justify, flex-start);
	margin: var(--label-margin, 0 10px 0 0);
}

.products-variations {
	display: flex;
	flex-flow: row wrap;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.products-variations li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.products-variations li a {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 30px;
	min-height: 30px;
	padding: 2px 8px;
	border: 1px solid var(--variations-border-color, rgba(0, 0, 0, .15));
	color: inherit;
	font-size: 13px;
	line-height: 1;
	text-decoration: none;
	transition: color .3s, background-color .3s, border-color .3s, box-shadow .3s;
}

.products-variations li a:hover,
.products-variations li.active a {
	border-color: var(--the7-accent-color, currentColor);
}

/* Pastilles de couleur ou d'image */
.products-variations a.isset-swatch {
	min-width: 26px;
	height: 26px;
	padding: 0;
	border-color: var(--swatch-variations-border-color, rgba(0, 0, 0, .15));
	border-radius: 50%;
	background-position: center;
	background-size: cover;
	font-size: 0;
}

.products-variations.swatch-type-list li a.isset-swatch:after {
	position: absolute;
	inset: -3px;
	content: "";
	border-radius: inherit;
	transition: box-shadow .3s;
}

.products-variations li.active a.isset-swatch:after {
	box-shadow: 0 0 0 2px var(--the7-accent-color, #333);
}

/* Choix indisponible : barré. */
.products-variations li a.out-of-stock {
	opacity: .5;
	cursor: not-allowed;
}

.products-variations li a.out-of-stock:before {
	position: absolute;
	top: 50%;
	left: 10%;
	width: 80%;
	height: 1px;
	content: "";
	background: var(--out-of-stock-line-color, currentColor);
	transform: rotate(-30deg);
}

.products-variations li a.isset-swatch.out-of-stock:before {
	background: var(--out-of-stock-swatch-line-color, var(--out-of-stock-line-color, #333));
}

/* Bouton d'ajout au panier : en attente du choix d'une variation, en cours, ajouté. */
.the7-elementor-widget .variation-btn-disabled:not(.product_type_variable),
[class*="elementor-widget-the7-woocommerce"] .variation-btn-disabled:not(.product_type_variable) {
	opacity: .5;
	cursor: not-allowed;
}

.the7-elementor-widget .add_to_cart_button.loading,
[class*="elementor-widget-the7-woocommerce"] .add_to_cart_button.loading {
	opacity: .6;
	pointer-events: none;
}

.the7-elementor-widget .add_to_cart_button.loading:after,
[class*="elementor-widget-the7-woocommerce"] .add_to_cart_button.loading:after {
	display: inline-block;
	width: .9em;
	height: .9em;
	margin-left: .4em;
	content: "";
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: och-wc-spin .7s linear infinite;
}

@keyframes och-wc-spin {
	to {
		transform: rotate(360deg);
	}
}

.the7-elementor-widget .added_to_cart,
[class*="elementor-widget-the7-woocommerce"] .woo-list-buttons .added_to_cart {
	display: none;
}

.the7-elementor-widget .hidden.added-to-cart-icon-template {
	display: none;
}

/* ------------------------------------------------------------------ *
 * Petits widgets de la fiche produit
 * ------------------------------------------------------------------ */

/* Rupture de stock (the7-woocommerce-product-out-of-stock-label) */
.the7-out-of-stock {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 4px 10px;
	border: 0 solid transparent;
	background-color: rgba(0, 0, 0, .65);
	color: #fff;
}

.the7-out-of-stock .out-stock-label {
	position: static;
	margin: 0;
	padding: 0;
	background: none;
	color: inherit;
	transform: none;
}

/* Note (the7-woocommerce-product-rating) : étoiles et lien vers les avis */
.elementor-widget-the7-woocommerce-product-rating .woocommerce-product-rating {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	justify-content: var(--content-align, flex-start);
	gap: var(--show-star-text-spacing, 5px);
	margin: 0;
}

.elementor-widget-the7-woocommerce-product-rating .woocommerce-review-link {
	display: var(--star-text-display, inline-flex);
	gap: .25em;
	color: inherit;
	text-decoration: none;
}

/* Méta (the7-woocommerce-product-meta) */
.elementor-widget-the7-woocommerce-product-meta .product_meta > span {
	display: block;
	margin-bottom: 5px;
}

.elementor-widget-the7-woocommerce-product-meta .product_meta a {
	color: inherit;
}

/* Produits apparentés et ventes incitatives : grille de WooCommerce sans la classe .woocommerce. */
[class*="elementor-widget-the7-woocommerce-product-"] ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

[class*="elementor-widget-the7-woocommerce-product-"] ul.products:before,
[class*="elementor-widget-the7-woocommerce-product-"] ul.products:after {
	display: none;
}

[class*="elementor-widget-the7-woocommerce-product-"] ul.products.columns-1 { grid-template-columns: minmax(0, 1fr); }
[class*="elementor-widget-the7-woocommerce-product-"] ul.products.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[class*="elementor-widget-the7-woocommerce-product-"] ul.products.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[class*="elementor-widget-the7-woocommerce-product-"] ul.products.columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
[class*="elementor-widget-the7-woocommerce-product-"] ul.products.columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

[class*="elementor-widget-the7-woocommerce-product-"] ul.products li.product {
	position: relative;
	float: none;
	width: auto !important;
	margin: 0 !important;
	padding: 0;
	list-style: none;
}

[class*="elementor-widget-the7-woocommerce-product-"] ul.products li.product img {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 10px;
}

[class*="elementor-widget-the7-woocommerce-product-"] ul.products li.product .woocommerce-loop-product__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

[class*="elementor-widget-the7-woocommerce-product-"] ul.products li.product .woocommerce-loop-product__title {
	margin: 0 0 5px;
	font-size: 1em;
}

@media (max-width: 767px) {
	[class*="elementor-widget-the7-woocommerce-product-"] ul.products[class*="columns-"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
