/*
 * Sweet Corner: home hero slider (2026-11-21)
 * The hero (WeDesignTech advanced carousel, templates 288 "Luxury collection" and
 * 633 "Vente flash") used a full-viewport section placed *below* the header, so on
 * short screens the button and dots fell off the first screen, and the 60px+ title
 * overflowed narrow phones.
 *
 * Now:
 * - each slide fills the first screen minus the header (--sc-hero-offset, set by
 *   js/sc-home.js), with a 420px floor and a 860px ceiling; content may still grow;
 * - the title, text and button scale with both width and height, so they always fit;
 * - everything is centred and long words never overflow.
 */

/*
 * 2026-11-21: the theme pulls the hero up under the header (~90px on desktop), so the top
 * of every slide was hidden and short windows cut the title. js/sc-home.js now publishes
 * where the header ends (--sc-hero-offset) and how much of the hero hides behind it
 * (--sc-hero-overlap): the slide fills the visible first screen, plus the hidden part,
 * which is added as top padding so the text starts below the header.
 */
/*
 * No layout shift on load: js/sc-home.js runs at the end of the page, after the first paint.
 * These defaults are the values it measures (2026-11-21), so the first paint already has the
 * final size and the script only confirms them. The overlap comes from a fixed -190px margin
 * on page 159's first section, so it is 90px at every width. If the header height changes,
 * update the offsets here too.
 */
html {
	--sc-hero-overlap: 90px;
	--sc-hero-offset: 166px;
}
@media (max-width: 479px) {
	html { --sc-hero-offset: 126px; }
}
/* Elementor's breakpoints are whole pixels (max-width:767px / min-width:768px, 1024 / 1025).
   At fractional widths in between (browser zoom, some screen scalings) neither side matches and
   the header shows its "VENTE FLASH" bar plus a taller row, so it is 235px there. */
@media (min-width: 767.01px) and (max-width: 767.99px), (min-width: 1024.01px) and (max-width: 1024.99px) {
	html { --sc-hero-offset: 235px; }
}

/* Button text: line-height "normal" changes height when Jost replaces the fallback font
   (font-display: swap), which moved the whole centred block. A fixed ratio keeps it still. */
body.home .wdt-custom-slider-1-advanced-carousel .wdt-custom-common-button .wdt-button-text,
body.home .wdt-custom-slider-1-advanced-carousel .wdt-custom-common-button .wdt-button-text span {
	line-height: 1.5;
}

body.home .wdt-custom-slider-1-advanced-carousel .elementor-section.elementor-section-height-min-height > .elementor-container {
	min-height: calc(clamp(420px, calc(100vh - var(--sc-hero-offset, 160px)), 860px) + var(--sc-hero-overlap, 0px));
	min-height: calc(clamp(420px, calc(100svh - var(--sc-hero-offset, 160px)), 860px) + var(--sc-hero-overlap, 0px));
	padding-top: calc(var(--sc-hero-overlap, 0px) + clamp(24px, 5vh, 64px));
	padding-bottom: clamp(76px, 10vh, 104px); /* room for the slider dots (below) */
	box-sizing: border-box;
	align-items: center;
}

body.home .wdt-custom-slider-1-advanced-carousel .elementor-section > .elementor-container > .elementor-column > .elementor-widget-wrap {
	align-content: center;
	justify-content: center;
}

/* Title: fits the width (12vw) and the height (15vh), whichever is smaller */
body.home .wdt-custom-slider-1-advanced-carousel .elementor-widget-heading .elementor-heading-title {
	font-size: clamp(34px, min(12vw, 15vh), 190px);
	line-height: 1;
	text-align: center;
	max-width: 100%;
	overflow-wrap: anywhere;
	hyphens: manual;
	text-wrap: balance;
}

/* Slider dots: the plugin pins their 50px wrapper 55px above the bottom, which sat on the
   button on short screens. Keep them low; the container's bottom padding reserves the room. */
body.home .wdt-custom-slider-1-advanced-carousel .wdt-carousel-pagination-wrapper {
	top: auto !important;
	bottom: clamp(10px, 2vh, 24px) !important;
}

/* Two-line titles (e.g. "PINK / FRIDAY") take twice the height: scale each line by less */
body.home .wdt-custom-slider-1-advanced-carousel .elementor-widget-heading .elementor-heading-title:has(br) {
	font-size: clamp(34px, min(11vw, 10.5vh), 150px);
	line-height: .95;
}

/* Supporting text */
body.home .wdt-custom-slider-1-advanced-carousel .elementor-widget-text-editor {
	text-align: center;
	max-width: 62ch;
	margin-left: auto;
	margin-right: auto;
	font-size: clamp(13px, 1.1vw + 6px, 17px);
	line-height: 1.5;
	text-wrap: balance;
}

body.home .wdt-custom-slider-1-advanced-carousel .elementor-widget-text-editor p {
	margin-bottom: 0;
}

/* Button */
body.home .wdt-custom-slider-1-advanced-carousel .elementor-widget-wdt-button {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
}

/* Even vertical rhythm between title, text and button */
body.home .wdt-custom-slider-1-advanced-carousel .elementor-widget-wrap > .elementor-element:not(:last-child) {
	margin-bottom: clamp(12px, 2.5vh, 28px);
}

@media (max-width: 767px) {
	body.home .wdt-custom-slider-1-advanced-carousel .elementor-section.elementor-section-height-min-height {
		padding-left: 20px;
		padding-right: 20px;
	}

	body.home .wdt-custom-slider-1-advanced-carousel .elementor-section.elementor-section-height-min-height > .elementor-container {
		min-height: calc(clamp(380px, calc(100vh - var(--sc-hero-offset, 140px)), 720px) + var(--sc-hero-overlap, 0px));
		min-height: calc(clamp(380px, calc(100svh - var(--sc-hero-offset, 140px)), 720px) + var(--sc-hero-overlap, 0px));
	}
}

/* Very short landscape screens (phones turned sideways, small laptop windows) */
@media (max-height: 520px) and (min-width: 600px) {
	body.home .wdt-custom-slider-1-advanced-carousel .elementor-section.elementor-section-height-min-height > .elementor-container {
		min-height: calc(360px + var(--sc-hero-overlap, 0px));
	}
}

/*
 * Contact page (id 537): same compact title band as the shop pages. The big "Contact"
 * title repeats the "Contactez-nous !" heading right below it, so only the breadcrumb stays,
 * and the theme's 100px gap under the header goes down to 24px (12px on mobile).
 */
body.page-id-537 .main-title-section-wrapper .main-title-section {
	display: none;
}

body.page-id-537 .main-title-section-wrapper .main-title-section-container {
	padding: 16px 0 12px;
}

body.page-id-537 .main-title-section-wrapper .breadcrumb {
	font-size: 13px;
	line-height: 1.5;
}

body.page-id-537 #header-wrapper {
	margin-bottom: 24px;
}

@media (max-width: 767px) {
	body.page-id-537 .main-title-section-wrapper .main-title-section-container {
		padding: 10px 0 8px;
	}

	body.page-id-537 .main-title-section-wrapper .breadcrumb {
		font-size: 12px;
	}

	body.page-id-537 #header-wrapper {
		margin-bottom: 12px;
	}
}

/*
 * Contact form (CF7 form 520 on the contact page): visible light borders, pink focus,
 * full-width "Envoyer" on mobile, and breathing room before the footer.
 */
body.page-id-537 .wpcf7 input[type="text"],
body.page-id-537 .wpcf7 input[type="email"],
body.page-id-537 .wpcf7 input[type="tel"],
body.page-id-537 .wpcf7 textarea {
	border: 1px solid #e0e0e0 !important;
	border-radius: 8px;
	background-color: #fff;
	transition: border-color .2s ease, box-shadow .2s ease;
}

body.page-id-537 .wpcf7 input[type="text"]:focus,
body.page-id-537 .wpcf7 input[type="email"]:focus,
body.page-id-537 .wpcf7 input[type="tel"]:focus,
body.page-id-537 .wpcf7 textarea:focus {
	border-color: #ac3c77 !important;
	box-shadow: 0 0 0 3px rgba(172, 60, 119, 0.12);
	outline: none;
}

body.page-id-537 #main {
	padding-bottom: 88px;
}

@media (max-width: 767px) {
	body.page-id-537 .wpcf7 input[type="submit"],
	body.page-id-537 .wpcf7 .wpcf7-submit {
		display: block;
		width: 100% !important;
	}

	body.page-id-537 #main {
		padding-bottom: 56px;
	}
}

/*
 * Home "Make your home sweet" banner (section 48b5f7c): bright rattan-bed photo under a
 * plum overlay (set in Elementor). Framed on the headboard on wide screens and on the whole
 * bed on phones; a soft shadow keeps the small paragraph readable over the light bedding.
 */
body.home .elementor-element-48b5f7c {
	background-size: cover !important;
	background-position: 50% 38% !important;
}

body.home .elementor-element-48b5f7c .elementor-element-55131e5 .wdt-heading-title,
body.home .elementor-element-48b5f7c .elementor-element-55131e5 .wdt-heading-content,
body.home .elementor-element-48b5f7c .elementor-element-55131e5 p {
	text-shadow: 0 1px 12px rgba(40, 15, 28, 0.55);
}

@media (max-width: 767px) {
	body.home .elementor-element-48b5f7c {
		background-position: 50% 100% !important;
	}
}

/*
 * Home product sections: per-row count by screen (2026-11-21).
 *   1541px and up: 6 | laptops 1281-1540px: 5 | iPad landscape and small laptops 992-1280px: 4
 *   below 992px: the theme's 2. (Elementor's Columns setting stops at 5, so this lives here.)
 * The widget loads 6 at a time; js/sc-product-cards.js shows only complete rows and keeps the
 * rest for the next "Charger plus". Before that script runs, the extras are hidden here too,
 * so the grid doesn't jump when it starts.
 */
@media (min-width: 1541px) {
	body.home .elementor-widget-wdt-shop-products .woocommerce ul.products[class*="column-"]:not(.products-apply-isotope):not(.swiper-wrapper) {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (min-width: 1281px) and (max-width: 1540.98px) {
	body.home .elementor-widget-wdt-shop-products .woocommerce ul.products[class*="column-"]:not(.products-apply-isotope):not(.swiper-wrapper) {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	body.home .wdt-products-container:has(.sc-load-more) ul.products:not(.sc-rows-ready) > li.product:nth-child(n+6 of li.product:not(.isotope-grid-sizer)) {
		display: none;
	}
}

@media (min-width: 992px) and (max-width: 1280.98px) {
	body.home .elementor-widget-wdt-shop-products .woocommerce ul.products[class*="column-"]:not(.products-apply-isotope):not(.swiper-wrapper) {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	body.home .wdt-products-container:has(.sc-load-more) ul.products:not(.sc-rows-ready) > li.product:nth-child(n+5 of li.product:not(.isotope-grid-sizer)) {
		display: none;
	}
}

body.home ul.products > li.product.sc-row-hidden {
	display: none !important;
}

/*
 * Hero button entrance (2026-11-21). The theme slides the button up (60px, 30px up to 1280px wide) and
 * fades it in with a CSS transition when its slide becomes active. A transition only plays if
 * the browser has already drawn the hidden state; on fast or cached loads the slider starts
 * before the first paint and the button simply appears. A keyframe animation plays every time
 * the slide becomes active (page load and slide changes), with the same motion and timing.
 */
@keyframes sc-hero-rise {
	from { opacity: 0; transform: translateY(var(--sc-hero-rise, 60px)); }
	to   { opacity: 1; transform: translateY(0); }
}

/*
 * 2026-11-22: the first slide's button no longer waits for the slider script. The theme only
 * marks a slide active once its slider has started (about 4 s into a load here), and the page is
 * busy for a few more seconds after that, so "Découvrir" sat invisible and then popped in with no
 * motion. The first slide in the page's HTML (before the slider adds its loop copies) now plays the
 * same entrance from the first paint, and keeps it once the slider has started (Swiper then marks the
 * same slide data-swiper-slide-index="0"), so the running animation carries on instead of restarting.
 */
.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-wrapper > .swiper-slide:first-child:not(.swiper-slide-duplicate) .wdt-custom-common-button,
.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) .wdt-custom-common-button,
.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-slide-active .wdt-custom-common-button {
	animation: sc-hero-rise 1s ease .3s both;
}

@media (max-width: 1280px) {
	.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-wrapper > .swiper-slide:first-child:not(.swiper-slide-duplicate) .wdt-custom-common-button,
	.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) .wdt-custom-common-button,
	.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-slide-active .wdt-custom-common-button {
		--sc-hero-rise: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-wrapper > .swiper-slide:first-child:not(.swiper-slide-duplicate) .wdt-custom-common-button,
	.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) .wdt-custom-common-button,
	.wdt-custom-slider-1-advanced-carousel .wdt-advanced-carousel-holder .swiper-slide-active .wdt-custom-common-button {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/*
 * Home Google reviews (Widget Google Reviews 7.3, section 2143711, 2026-11-21).
 * The plugin's defaults (grey cards, blue names and button, orange stars, a Google store
 * icon) didn't match the shop. Restyled in the brand palette through the plugin's own
 * CSS variables where it has them:
 * - the block sits on the same 90% page width as the product rows;
 * - the rating summary is a soft pink plate with the Sweet Corner logo and a pink button;
 * - reviews are white cards with a hairline border, dark names, plum stars and a quote mark
 *   (it also fills cards whose review has stars only);
 * - arrows and dots are plum; on phones the summary stacks above one card per view.
 */
body.home .wp-gr {
	--color: #ac3c77;
	--star-color: #ac3c77;
	--rpi-star-color: #ac3c77;
	--rpi-star-size: 17px;
	--star-empty-color: #ecd3e0;
	--rev-color: #fff;
	--rev-bg: #fff;
	--text-color: #3a3a3a;
	--name-color: #1f1f1f;
	--head-name-color: #1f1f1f;
	--head-based-color: #6e6e6e;
	--powered-color: #6e6e6e;
	--img-size: 42px;
	--card-gap: 16px;
	--card-margin: 0px;
	--slide-pad-y: 10px;
	--btn-color: #ac3c77;
	--btn-txt-color: #fff;
	--btn-txt-shadow: none;
	--slider-head-card-bg: #fbf4f8;
	--slider-head-card-radius: 16px;
	--slider-head-card-shadow: none;
	--slider-dot-color: #d9b3c7;
	--slider-act-dot-color: #ac3c77;
	--slider-btn-bg: #fff;
	--slider-btn-bc: #ecd3e0;
	--slider-btn-color: #ac3c77;
	--slider-btn-shadow: 0 4px 14px rgba(172, 60, 119, 0.14);
	--slider-dot-padding-top: 18px;
	font-family: Jost, sans-serif;
}

body.home .elementor-element-825c2a8 {
	width: 90%;
	max-width: 1560px;
	margin-left: auto;
	margin-right: auto;
}

/* One height for the summary plate and every card: the row stretches, and each card's
   text takes the room left (scrolling if a review is longer). */
body.home .wp-gr .grw-row,
body.home .wp-gr .grw-content-inner,
body.home .wp-gr .rpi-slides,
body.home .wp-gr .grw-review {
	align-items: stretch !important;
}

body.home .wp-gr .grw-content-inner {
	height: 100%;
}

body.home .wp-gr .grw-header {
	display: flex !important;
}

/* Summary plate */
body.home .wp-gr .grw-header > .grw-header-inner {
	flex: 1 1 auto !important;
	margin: 4px 0 !important;
	padding: 22px 18px !important;
	border: 1px solid #f0dde8;
	border-radius: 16px !important;
	background: #fbf4f8 !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center;
	gap: 8px !important;
	box-sizing: border-box !important;
}

body.home .wp-gr .grw-header > .grw-header-inner > .rpi-flx {
	flex: 0 0 auto !important;
	align-items: center;
	align-items: center !important;
	min-width: 0 !important;
	width: 100% !important;
}

/* The Sweet Corner logo in place of Google's store icon, uncropped (no circle: the logo
   is wider than tall and its square file is off-centre). */
body.home .wp-gr .grw-header .grw-img-wrap {
	flex: 0 0 auto !important;
	width: 104px !important;
	min-width: 104px !important;
	max-width: 104px !important;
	height: 83px !important;
	margin-bottom: 2px;
	border-radius: 0;
	background: url(/wp-content/uploads/2025/03/sweet-corner-logo-2025-300x239.png) center / contain no-repeat;
	box-shadow: none;
}

body.home .wp-gr .grw-header .grw-img-wrap::before {
	content: none !important;
	display: none !important;
}

body.home .wp-gr .grw-header .grw-img-wrap img {
	opacity: 0 !important;
	min-width: 104px !important;
	max-width: 104px !important;
	height: 83px !important;
}

/* The logo already says "Sweet Corner": the plugin's text name under it is hidden. */
body.home .wp-gr .grw-header .wp-google-name {
	display: none !important;
}

body.home .wp-gr.rpi .grw-header .wp-google-name a,
body.home .wp-gr.rpi .grw-header .wp-google-name span {
	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: 0.08em;
	color: #1f1f1f !important;
}

body.home .wp-gr .grw-header .rpi-stars {
	--head-star-size: 20px;
	--head-grade-fs: 26px;
	align-self: center !important;
	font-size: 26px !important;
	font-weight: 600 !important;
	color: #ac3c77 !important;
}

body.home .wp-gr .grw-header .wp-google-based,
body.home .wp-gr .grw-header .wp-google-powered {
	font-size: 14px !important;
	line-height: 1.5 !important;
}

body.home .wp-gr .grw-header .wp-google-wr {
	justify-content: center;
	margin-top: 6px !important;
}

body.home .wp-gr .wp-google-wr a {
	display: inline-flex !important;
	align-items: center !important;
	min-height: 40px;
	padding: 0 20px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: #ac3c77 !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	text-shadow: none !important;
	box-shadow: none !important;
	transition: background-color .2s ease, box-shadow .2s ease !important;
}

body.home .wp-gr .wp-google-wr a:hover,
body.home .wp-gr .wp-google-wr a:active {
	background: #8f2f62 !important;
	box-shadow: none !important;
}

body.home .wp-gr .wp-google-wr a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -5px;
}

/* Review cards */
body.home .wp-gr .grw-review-inner.grw-backgnd {
	padding: 22px 22px 20px !important;
	border: 1px solid #f0e4eb;
	border-radius: 16px !important;
	background: #fff !important;
	box-shadow: 0 6px 20px rgba(60, 20, 40, 0.06) !important;
	box-sizing: border-box !important;
	overflow: hidden;
	gap: 12px;
}

/* Decorative quote mark, bottom-right */
body.home .wp-gr .grw-review-inner.grw-backgnd::after {
	content: "\201D";
	position: absolute;
	right: 18px;
	bottom: -22px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 96px;
	line-height: 1;
	color: #f5e6ee;
	pointer-events: none;
}

body.home .wp-gr .grw-review .wp-google-feedback {
	position: relative;
	z-index: 1;
	height: auto !important;
	flex: 1 1 0 !important;
	min-height: 48px !important;
	scrollbar-width: thin;
	scrollbar-color: #e3c4d5 transparent;
}

body.home .wp-gr .grw-review-inner > .rpi-flx.rpi-col4 {
	flex: 1 1 0 !important;
	min-height: 0 !important;
}

body.home .wp-gr .grw-scroll::-webkit-scrollbar-thumb {
	background: #e3c4d5 !important;
	box-shadow: none !important;
}

body.home .wp-gr.rpi a.wp-google-name {
	color: #1f1f1f !important;
	font-size: 15px !important;
	font-weight: 600 !important;
}

body.home .wp-gr.rpi a.wp-google-name:hover {
	color: #ac3c77 !important;
}

body.home .wp-gr .wp-google-time {
	color: #8a8a8a !important;
	font-size: 12.5px !important;
}

body.home .wp-gr .wp-google-text {
	color: #3a3a3a !important;
	font-size: 14.5px !important;
	line-height: 24px !important;
}

body.home .wp-gr .grw-review-inner > .rpi-logo {
	top: 18px !important;
	right: 18px !important;
}

/* Arrows */
body.home .wp-gr .rpi-ltgt {
	--slider-btn-bw: 1px;
	top: 50% !important;
	translate: 0 -50% !important;
	transition: background-color .2s ease, border-color .2s ease !important;
}

body.home .wp-gr .rpi-ltgt:hover {
	--slider-btn-color: #fff;
	background-color: #ac3c77 !important;
	border-color: #ac3c77 !important;
}

/* Phones and small tablets: the plugin stacks the summary above the cards. The plate stays
   centred; each card sizes to its own text (the slider still evens the row). */
@media (max-width: 767px) {
	body.home .elementor-element-825c2a8 {
		width: calc(100% - 32px);
	}

	body.home .wp-gr .grw-header > .grw-header-inner {
		margin: 0 20px 12px !important;
		padding: 20px 16px !important;
	}

	body.home .wp-gr .grw-review-inner > .rpi-flx.rpi-col4,
	body.home .wp-gr .grw-review .wp-google-feedback {
		flex: 0 0 auto !important;
	}

	body.home .wp-gr .grw-review .wp-google-feedback {
		max-height: 120px;
		min-height: 0 !important;
	}

	body.home .wp-gr .grw-review-inner.grw-backgnd {
		min-height: 168px;
		padding: 20px 18px 18px !important;
	}
}
