/*
 * Home: Best Sellers section (template-parts/home/best-sellers.php).
 * Loads after main.css on the front page only.
 *
 * Best Sellers takes over the spot right under the hero that Our Treatments
 * used to have (it overlaps the hero's bottom fade), and the hero is a little
 * shorter on desktop so the title and the whole first row of tiles fit on
 * screen without scrolling.
 */

/* ---------- Section placement ---------- */
.best-sellers {
	position: relative;
	z-index: 20;
	margin-top: -262px;
	padding: 0 0 56px;
}
.best-sellers + .treatments { margin-top: 0; }
.best-sellers__inner { position: relative; z-index: 10; }

@media (max-width: 991px) {
	.best-sellers { margin-top: -100px; padding-bottom: 40px; }
}
/* Phones: sit the title a little lower, on a longer white fade, so the dark
   title never lands on a dark part of the hero photo. */
@media (max-width: 576px) {
	.best-sellers { margin-top: -70px; }
	.hero::after { height: 210px; }
}

/* Desktop: shorter hero so Best Sellers' first row sits above the fold.
   Row = title (~76px) + tile (290px); the section overlaps the hero by 262px. */
@media (min-width: 992px) {
	.hero,
	.hero .hero__bg.hero__bg-slider .hero__slide,
	.hero .hero__bg.hero__bg-slider .hero__img {
		height: max(460px, calc(100vh - 150px - var(--pn-bfcm-h, 0px)));
		min-height: max(460px, calc(100vh - 150px - var(--pn-bfcm-h, 0px)));
	}
	.hero .hero__bg.hero__bg-slider .hero__img { object-position: center top; }
}

/* ---------- Title ---------- */
.best-sellers__title {
	margin: 0 0 18px;
	text-align: center;
	font-family: var(--font-family);
	font-size: 56px;
	font-weight: 900;
	line-height: 1.1;
	letter-spacing: .01em;
	text-transform: uppercase;
	color: var(--violet-bright, #5246B8);
}

/* ---------- Grid ---------- */
.best-sellers__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.best-sellers__item { margin: 0; min-width: 0; }
.best-sellers__item--mobile-only { display: none; }

/* ---------- Tile ---------- */
.best-sellers__card {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 290px;
	padding: 22px;
	overflow: hidden;
	border-radius: 18px;
	background: #3b2f73;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 10px 30px rgba(41, 38, 66, .12);
}
.best-sellers__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform .35s ease;
}
.best-sellers__card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(20, 14, 50, .5) 0%, rgba(20, 14, 50, 0) 34%, rgba(20, 14, 50, 0) 55%, rgba(20, 14, 50, .72) 100%);
}
.best-sellers__card:hover .best-sellers__img { transform: scale(1.04); }

.best-sellers__name {
	max-width: 85%;
	font-family: var(--font-family);
	font-size: 24px;
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: .02em;
	text-transform: uppercase;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .25);
}
.best-sellers__bottom {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}
.best-sellers__price {
	min-width: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}
/* Main price only; the subscription line lives on the product page. */
.best-sellers__price .wcsatt-sub-options { display: none; }
.best-sellers__price .amount,
.best-sellers__price .pn-bfcm-price ins .amount { color: #fff; }
.best-sellers__price del { opacity: .7; }
.best-sellers__link { flex: 0 0 auto; }

/* ---------- Tablet ---------- */
@media (max-width: 1200px) {
	.best-sellers__title { font-size: 44px; }
	.best-sellers__name { font-size: 20px; }
	.best-sellers__card { height: 260px; padding: 18px; }
}

/* ---------- Phones: 2 columns, 4 tiles ---------- */
@media (max-width: 767px) {
	.best-sellers__title { margin-bottom: 12px; font-size: 32px; }
	.best-sellers__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.best-sellers__item--mobile-only { display: block; }
	.best-sellers__card { height: auto; aspect-ratio: 4 / 5; padding: 14px; border-radius: 14px; }
	.best-sellers__name { max-width: 100%; font-size: 15px; }
	.best-sellers__bottom { gap: 8px; }
	.best-sellers__price { font-size: 13px; }
	.best-sellers__link { transform: scale(.85); transform-origin: bottom right; }
}

/* ---------- Section titles: brand gradient (Violet Dark → Violet Bright) ----------
   Shared by Best Sellers and Our Treatments on the homepage so both read clearly
   over the hero fade and on white. Solid Violet Dark if gradient text isn't supported. */
.best-sellers__title,
.best-sellers + .treatments .treatments__title {
	color: var(--violet-dark, #292642);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.best-sellers__title,
	.best-sellers + .treatments .treatments__title {
		background-image: linear-gradient(90deg, var(--violet-dark, #292642) 0%, var(--violet-bright, #5246B8) 100%);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
		color: transparent;
	}
	/* Fit the gradient to the words, not the full-width heading box. */
	.best-sellers__title,
	.best-sellers + .treatments .treatments__title {
		display: block;
		width: fit-content;
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
	}
}
.best-sellers + .treatments .treatments__title { padding-top: 8px; }
/* Best Sellers sits over the hero photo: a soft white glow keeps it legible on every slide. */
.best-sellers__title { filter: drop-shadow(0 0 14px rgba(255, 255, 255, .85)) drop-shadow(0 0 3px rgba(255, 255, 255, .6)); }
