/*
 * Sweet Corner: product cards + home section titles (2026-11-21)
 * Applies to every Neytri/WooCommerce product grid (home widgets, shop,
 * categories, related). Every card gets a 3:4 photo frame and a
 * two-line title slot, so cards in a row are the same size.
 */

/* 1. 3:4 photo frame (overrides the old `.image { max-height: 300px }` cap) */
ul.products li.product .product-thumb > a.image {
	display: block;
	position: relative;
	width: 100%;
	height: auto !important;
	max-height: none !important;
	aspect-ratio: 3 / 4;
	overflow: hidden;
}

ul.products li.product .product-thumb > a.image .primary-image,
ul.products li.product .product-thumb > a.image .secondary-image {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
}

ul.products li.product .product-thumb > a.image .primary-image img,
ul.products li.product .product-thumb > a.image .secondary-image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-height: none !important;
	object-fit: cover;
	object-position: center;
}

/* Keep labels and the hover overlay above the photo */
ul.products li.product .product-thumb > a.image .product-labels,
ul.products li.product .product-thumb > a.image .product-thumb-overlay {
	z-index: 2;
}

ul.products li.product .product-thumb {
	height: auto;
}

/* 2. Titles: at most two lines, price follows directly underneath (no reserved gap) */
ul.products li.product .product-title h5 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	line-height: 1.3;
	margin-bottom: 4px;
}

ul.products li.product .product-details .product-title {
	margin-bottom: 0;
	padding-bottom: 0;
}

ul.products li.product .product-details .product-price {
	margin-top: 0;
	padding-top: 0;
}

/* Badges: "Promo -34%" on one line, softer corners */
ul.products li.product .product-labels > span > span,
body.single-product .product-labels > span > span {
	white-space: nowrap;
	border-radius: 6px;
}

ul.products li.product .product-labels > span,
body.single-product .product-labels > span {
	border-radius: 6px;
	max-width: none;
	width: auto;
}

/*
 * All badges in one left-aligned column (2026-11-21). The theme right-aligns the label box
 * (text-align: right, stretched to the card's right edge), so "Promo" sat top right while
 * "Nouveau" sat left. Now both start at the theme's 20px inset, stacked with a 6px gap.
 */
ul.products li.product .product-labels {
	right: auto !important;
	display: flex !important;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	text-align: left !important;
}

ul.products li.product .product-labels > span {
	margin: 0 !important;
}

/* Stretch each card to the row height so the bottoms line up */
ul.products li.product:not(.isotope-grid-sizer) > .wdt-col,
ul.products li.product:not(.isotope-grid-sizer) .product-wrapper {
	height: 100%;
}

/*
 * 3. Prices: one size for every current price (regular, range or sale), in brand
 *    pink and bold. The old (crossed-out) price is smaller, dark grey and clearly struck.
 *    Sizes live in two variables so every price variant stays identical.
 */
ul.products li.product .product-price {
	--sc-price-size: 17px;
	--sc-old-price-size: 14px;
	color: #ac3c77;
	font-size: var(--sc-price-size);
	font-weight: 700;
	line-height: 1.3;
}

ul.products li.product .product-price .price,
ul.products li.product .product-price .price ins,
ul.products li.product .product-price .price .woocommerce-Price-amount,
ul.products li.product .product-price .price .woocommerce-Price-amount bdi,
ul.products li.product .product-price .price .woocommerce-Price-currencySymbol {
	color: #ac3c77;
	font-size: var(--sc-price-size);
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	background: none;
}

ul.products li.product .product-price .price del,
ul.products li.product .product-price .price del .woocommerce-Price-amount,
ul.products li.product .product-price .price del .woocommerce-Price-amount bdi,
ul.products li.product .product-price .price del .woocommerce-Price-currencySymbol {
	color: #6e6e6e;
	font-size: var(--sc-old-price-size);
	font-weight: 500;
	opacity: 1;
}

ul.products li.product .product-price .price del {
	margin-right: 6px;
	text-decoration: line-through;
	text-decoration-color: #6e6e6e;
	text-decoration-thickness: 1.5px;
}

@media (max-width: 767px) {
	ul.products li.product .product-price {
		--sc-price-size: 15px;
		--sc-old-price-size: 13px;
	}
}

/* 4. Home page: centre every section title (not the footer, which matches the other pages) */
body.home .elementor-widget-wdt-heading:not(#footer *) .wdt-heading-holder,
body.home .elementor-widget-wdt-heading:not(#footer *) .wdt-heading-title-wrapper,
body.home .elementor-widget-heading:not(#footer *) .elementor-heading-title {
	text-align: center;
}

body.home .elementor-widget-wdt-heading:not(#footer *) .wdt-heading-title {
	justify-content: center;
}

/*
 * 5. One pagination style for the shop (nav.woocommerce-pagination) and the
 *    home product widgets (.wdt-product-pagination, AJAX). Round buttons,
 *    current page filled with the brand pink, arrows on the same row.
 */
body .woocommerce nav.woocommerce-pagination,
body.woocommerce nav.woocommerce-pagination,
.wdt-product-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 32px;
	text-align: center;
}

body .woocommerce nav.woocommerce-pagination ul.page-numbers,
body.woocommerce nav.woocommerce-pagination ul.page-numbers,
.wdt-product-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}

body .woocommerce nav.woocommerce-pagination ul.page-numbers li,
body.woocommerce nav.woocommerce-pagination ul.page-numbers li,
.wdt-product-pagination ul.page-numbers li,
.wdt-product-pagination .prev-post,
.wdt-product-pagination .next-post {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	float: none;
	line-height: 1;
}

body .woocommerce nav.woocommerce-pagination ul.page-numbers li a,
body.woocommerce nav.woocommerce-pagination ul.page-numbers li a,
body .woocommerce nav.woocommerce-pagination ul.page-numbers li span,
body.woocommerce nav.woocommerce-pagination ul.page-numbers li span,
.wdt-product-pagination .page-numbers a,
.wdt-product-pagination .page-numbers span.page-numbers,
.wdt-product-pagination .prev-post a,
.wdt-product-pagination .next-post a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 36px;
	width: auto;
	height: 36px;
	padding: 0 8px;
	border: 1px solid #e6e6e6;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

body .woocommerce nav.woocommerce-pagination ul.page-numbers li a:hover,
body.woocommerce nav.woocommerce-pagination ul.page-numbers li a:hover,
.wdt-product-pagination .page-numbers a:hover,
.wdt-product-pagination .prev-post a:hover,
.wdt-product-pagination .next-post a:hover {
	border-color: #ac3c77;
	color: #ac3c77;
	background: #fff;
}

body .woocommerce nav.woocommerce-pagination ul.page-numbers li span.current,
body.woocommerce nav.woocommerce-pagination ul.page-numbers li span.current,
.wdt-product-pagination .page-numbers span.current {
	background: #ac3c77;
	border-color: #ac3c77;
	color: #fff;
}

body .woocommerce nav.woocommerce-pagination ul.page-numbers li span.dots,
body.woocommerce nav.woocommerce-pagination ul.page-numbers li span.dots,
.wdt-product-pagination .page-numbers span.dots {
	border-color: transparent;
	background: transparent;
	min-width: 20px;
	padding: 0 2px;
}

/*
 * 5b. Home widgets: "Charger plus" button in place of the page numbers
 *     (inc/sc-product-cards.php + js/sc-product-cards.js). The plugin's next arrow is hidden.
 */
.wdt-product-pagination .sc-load-more ~ .next-post,
.wdt-product-pagination .sc-load-more ~ .prev-post {
	display: none !important;
}

.wdt-product-pagination .sc-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	margin: 0;
	padding: 0 32px;
	border: 1.5px solid #ac3c77;
	border-radius: 999px;
	background: #fff;
	color: #ac3c77;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
	touch-action: manipulation;
}

.wdt-product-pagination .sc-load-more:hover,
.wdt-product-pagination .sc-load-more:focus-visible {
	background: #ac3c77;
	color: #fff;
}

.wdt-product-pagination .sc-load-more:focus-visible {
	outline: 2px solid #ac3c77;
	outline-offset: 3px;
}

/* Loading: a small spinner beside the label, same button size */
.wdt-product-pagination .sc-load-more.is-loading {
	cursor: progress;
}

.wdt-product-pagination .sc-load-more.is-loading::after {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: sc-spin .7s linear infinite;
}

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

/* 6. Card text centred everywhere (two home widgets were left-aligned, the shop was centred) */
ul.products li.product .product-details,
ul.products li.product .product-details .product-title,
ul.products li.product .product-details .product-title h5,
ul.products li.product .product-details .product-price,
ul.products li.product .product-details .product-price .price {
	text-align: center !important;
}

ul.products li.product .product-details .product-price .price,
ul.products li.product .product-details .product-rating-wrapper,
ul.products li.product .product-details .star-rating-wrapper {
	justify-content: center;
}

ul.products li.product .product-details .star-rating {
	margin-left: auto;
	margin-right: auto;
}

/*
 * 7. Home product sections share the site container (90% wide, like the header, shop and
 *    breadcrumb: 64px gutters at 1440px, 12px at 390px). Each section had its own Elementor
 *    side padding (30px or 20px), so the grids didn't line up with each other or the header.
 */
body.home .elementor-top-section:has(ul.products) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.home .elementor-top-section:has(ul.products) > .elementor-container {
	width: 90%;
	max-width: 90%;
	margin-left: auto;
	margin-right: auto;
}

body.home .elementor-top-section:has(ul.products) .elementor-inner-section,
body.home .elementor-top-section:has(ul.products) .elementor-column > .elementor-widget-wrap {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Section titles span the full container so "centred" means centred on the page */
body.home .elementor-top-section:has(ul.products) .elementor-widget-wdt-heading {
	margin-left: 0 !important;
	margin-right: 0 !important;
	left: auto !important;
	width: 100% !important;
	max-width: 100% !important;
}

/*
 * 8. Promo badge: one compact two-tone pill. "Promo" on brand pink, the discount ("-34%") on
 *    the pale pink of the announcement bar, flush against the right end of the pill.
 *    The theme styles every span inside a label (padding, letter-spacing, width), which also
 *    hit the discount span and made it wider than the badge, so those are reset here.
 *    --sc-badge-h sets the size: 22px on cards, 26px on the product photo.
 */
.product-labels .onsale,
.sc-gallery-labels .onsale {
	--sc-badge-h: 22px;
	display: inline-flex !important;
	align-items: stretch;
	height: var(--sc-badge-h) !important;
	min-height: 0 !important;
	width: auto !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 6px !important;
	overflow: hidden;
	background-color: #ac3c77 !important;
	box-shadow: none !important;
	line-height: var(--sc-badge-h) !important;
}

.product-labels .onsale > span,
.sc-gallery-labels .onsale > span {
	display: inline-flex !important;
	align-items: center;
	height: 100% !important;
	width: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 0 0 8px !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: #fff !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em !important;
	text-transform: none !important; /* "Promo", same as on the product photo */
	line-height: 1 !important;
	white-space: nowrap;
}

/* No discount span (e.g. a sale without a computable percentage): balanced padding */
.product-labels .onsale > span:not(:has(.sc-onsale-pct)),
.sc-gallery-labels .onsale > span:not(:has(.sc-onsale-pct)) {
	padding-right: 8px !important;
}

.product-labels .onsale .sc-onsale-pct,
.sc-gallery-labels .onsale .sc-onsale-pct {
	display: inline-flex !important;
	align-items: center;
	align-self: stretch;
	height: 100% !important;
	width: auto !important;
	min-width: 0 !important;
	margin: 0 0 0 7px !important;
	padding: 0 7px !important;
	border-radius: 0 !important;
	background: #fbe8f1 !important;
	color: #ac3c77 !important;
	font-size: inherit !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	line-height: 1 !important;
}

.sc-gallery-labels .onsale {
	--sc-badge-h: 26px;
}

.sc-gallery-labels .onsale > span {
	font-size: 12.5px !important;
	padding-left: 10px !important;
}

.sc-gallery-labels .onsale .sc-onsale-pct {
	padding: 0 8px !important;
}

/*
 * 8b. "Nouveau" badge: black pill, white uppercase text, same height and corners as the Promo
 *     badge above it (22px on cards, 26px on the product photo). The theme only styles it inside
 *     product cards, so on the product photo it showed as plain grey text.
 */
.product-labels .new,
.sc-gallery-labels .new {
	--sc-badge-h: 22px;
	display: inline-flex !important;
	align-items: center;
	height: var(--sc-badge-h) !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 6px !important;
	background-color: #000 !important;
	line-height: 1 !important;
}

.product-labels .new > span,
.sc-gallery-labels .new > span {
	display: inline-flex !important;
	align-items: center;
	height: 100% !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 6.4px 0 8px !important; /* right side minus the 1.6px letter spacing after the last letter */
	border-radius: 0 !important;
	background: transparent !important;
	color: #fff !important;
	font-size: 10px !important;
	font-weight: 500 !important;
	letter-spacing: 1.6px !important;
	text-transform: uppercase !important;
	line-height: 1 !important;
	white-space: nowrap;
}

.sc-gallery-labels .new {
	--sc-badge-h: 26px;
}

.sc-gallery-labels .new > span {
	padding: 0 8.4px 0 10px !important;
	font-size: 11px !important;
}

/*
 * 9. (Removed 2026-11-22 at the owner's request.) This section used to hide the card's button
 *    overlay on phones so one tap opened the product. The owner wants the theme's behaviour back:
 *    the first tap on a card shows the "Ajouter au panier" button (and the second photo), the
 *    next tap opens the product.
 */

/*
 * 10. Card buttons ("Ajouter au panier", "Choix des options") on one line at any card width.
 *     The theme's 14px uppercase label with 2.6px letter spacing needs ~222px, so on cards
 *     narrower than that it wrapped to two lines. The label now scales with the card
 *     (container query on the photo area): 14px on wide cards, down to 10.5px on the
 *     narrowest. The button stays the same height; a cut-off "…" is the last resort.
 */
ul.products li.product .product-thumb {
	container-type: inline-size;
}

ul.products li.product .product-thumb a.wdt-button:not(.screen-reader-text),
ul.products li.product .product-thumb a.added_to_cart {
	overflow: hidden;
	padding-right: 12px !important;
	padding-left: 12px !important;
	font-size: clamp(10.5px, calc(8.4cqi - 6px), 14px) !important;
	letter-spacing: .12em !important;
	white-space: nowrap !important;
	text-overflow: ellipsis;
}

/* Very narrow cards (phones with 2 columns, narrow desktop windows) */
@container (max-width: 199px) {
	ul.products li.product .product-thumb a.wdt-button:not(.screen-reader-text),
	ul.products li.product .product-thumb a.added_to_cart {
		padding-right: 8px !important;
		padding-left: 8px !important;
		font-size: 9.5px !important;
		letter-spacing: .04em !important;
	}
}

/*
 * 11. Wishlist heart on product cards (2026-11-21). The theme pins the icon column 15px from the
 *     top right plus a 5px margin (always 20px), while the badges on the left use 20px, and 10px
 *     up to 767px wide (style.css). The 30px heart also sat 4px lower than the centre of the
 *     22px badge next to it. Now both use --sc-card-inset, and the heart's centre lines up with
 *     the first badge (top = inset + (22 - 30) / 2).
 */
ul.products li.product .product-thumb {
	--sc-card-inset: 20px;
}

@media (max-width: 767px) {
	ul.products li.product .product-thumb {
		--sc-card-inset: 10px;
	}
}

.woocommerce ul.products li.product .product-thumb .product-buttons-wrapper.product-icons {
	top: calc(var(--sc-card-inset) - 4px) !important;
	right: var(--sc-card-inset) !important;
	left: auto !important;
	margin: 0 !important;
}

/*
 * 12. Hover button inset, the same on every grid (2026-11-22). The home "Best sellers" and
 *     "Derniers articles" widgets use the theme's main-shop style, which insets the button 20px
 *     from the photo edges; "Luxury collection", Boutique and the category pages use list
 *     style 9, where the button ran edge to edge. Every grid now insets it by --sc-card-inset,
 *     so it lines up with the badges and the heart: 20px on desktop, 10px on phones.
 */
.woocommerce ul.products li.product .product-wrapper .product-thumb .product-thumb-content {
	padding: 0 var(--sc-card-inset) var(--sc-card-inset) !important;
}

/*
 * 13. Touch screens: a tap on a card shows the button and the second gallery photo instantly,
 *     the same on every grid (2026-11-22, owner). Every grid now has the second photo: see
 *     sc_card_secondary_image_on() in inc/sc-product-cards.php. List style 9 (home Luxury collection,
 *     Boutique, search results) slid the button up from 10px lower while fading it in over 0.5s
 *     and cross-faded the second photo, which flickered on phones. On touch screens there is no
 *     transition and no slide. Desktop hover keeps its animation.
 */
@media (hover: none) {
	.woocommerce ul.products li.product .product-thumb .product-thumb-content > div,
	.woocommerce ul.products li.product .product-thumb .image .primary-image,
	.woocommerce ul.products li.product .product-thumb .image .secondary-image,
	.woocommerce ul.products li.product .product-thumb .image .product-thumb-overlay {
		transition: none !important;
	}

	.woocommerce ul.products.product-content-hover-slidebottom li.product .product-thumb .product-thumb-content > div {
		transform: none !important;
	}
}

/*
 * 14. "Ajouter au panier" while the product is being added (2026-11-22, owner). WooCommerce fades
 *     a.button.loading to 25% opacity. Neytri moves the button up by its own height to bring an
 *     icon in from ::after, which section 10's overflow: hidden clips (see section 15). Only the
 *     empty wrapper was left: white on the main-shop grids, black on list style 9. Now the button
 *     stays in place, solid black with its label, and a small white spinner sits before the text
 *     on ::before, which the theme doesn't use. It can't be clicked twice.
 */
.woocommerce ul.products li.product a.add_to_cart_button.loading {
	opacity: 1 !important;
	transform: none !important;
	pointer-events: none;
}

.woocommerce ul.products li.product a.add_to_cart_button.loading::before {
	content: "" !important;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin-right: 10px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sc-atc-spin 0.7s linear infinite;
}

@keyframes sc-atc-spin {
	to {
		transform: rotate(360deg);
	}
}

/*
 * 15. Card buttons stay still on hover (2026-11-23, owner video). On hover Neytri slides the button
 *     up by its full height (translateY(-100%)) so a cart icon comes in from ::after below it. Section
 *     10 needs overflow: hidden on the button (one-line label with "…"), which clips that icon, so
 *     hovering showed an empty box: white on Best sellers / Derniers articles, black on Luxury
 *     collection, Boutique and search. The clipped icon can't be hovered either, so the button kept
 *     sliding up and down under the mouse and clicks often missed it. Now the button never moves:
 *     the label always shows, and on a mouse hover it turns dark grey. On phones a tap no longer
 *     slides it away either. The main-shop grids paint the button black with an inline
 *     "background: ... !important" rule, hence the longer selectors for the hover colour.
 */
.woocommerce ul.products li.product .product-thumb .product-buttons-wrapper.product-button a:hover,
.woocommerce ul.products li.product .product-thumb .product-buttons-wrapper.product-button a:focus,
.woocommerce ul.products li.product .product-thumb .product-buttons-wrapper.product-button a:active {
	transform: none !important;
}

@media (hover: hover) {
	.woocommerce ul.products li.product .product-thumb .product-buttons-wrapper.product-button a:hover,
	.woocommerce ul.products.product-thumb-buttonelement-style-simple li.product .product-thumb .product-buttons-wrapper.product-button .wc_btn_inline a.button:hover,
	.woocommerce ul.products.product-thumb-buttonelement-style-simple li.product .product-thumb .product-buttons-wrapper.product-button .wc_btn_inline a.added_to_cart:hover {
		background: #3a3a3a !important;
	}
}
