/**
 * MR Stiff Product Manual Tab — Bestsellers carousel.
 *
 * Columns are driven by the --mspmt-bs-cols custom property (set per breakpoint
 * by the script); --mspmt-bs-gap and --mspmt-bs-ratio come from the widget.
 */

.mspmt-bs {
	position: relative;
	--mspmt-bs-gap: 16px;
	--mspmt-bs-cols: 4;
}

.mspmt-bs__viewport {
	overflow: hidden;
}

.mspmt-bs__track {
	display: flex;
	gap: var( --mspmt-bs-gap );
	transition: transform var( --mspmt-bs-speed, 400ms ) ease;
	will-change: transform;
}

.mspmt-bs__slide {
	flex: 0 0 calc( ( 100% - ( var( --mspmt-bs-cols ) - 1 ) * var( --mspmt-bs-gap ) ) / var( --mspmt-bs-cols ) );
	box-sizing: border-box;
	min-width: 0;
}

/* ---- Card -------------------------------------------------------------- */

.mspmt-bs-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #f6f6f6;
}

.mspmt-bs-card__media {
	position: relative;
}

.mspmt-bs-card__tags {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.mspmt-bs-tag {
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.7;
	border-radius: 4px;
}

.mspmt-bs-tag--sale {
	color: #1a1a1a;
	background: #f4e409;
}

.mspmt-bs-tag--best {
	color: #fff;
	background: #2b2b2b;
}

.mspmt-bs-card__wishlist {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 4;
}

.mspmt-bs-card__link {
	display: block;
}

.mspmt-bs-card__images {
	position: relative;
	aspect-ratio: var( --mspmt-bs-ratio, 1 / 1 );
	background: #f6f6f6;
}

.mspmt-bs-card__img {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.mspmt-bs-card__img.is-active {
	opacity: 1;
}

.mspmt-bs-card__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.mspmt-bs-card__gdots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10px;
	z-index: 4;
	display: flex;
	gap: 6px;
	justify-content: center;
	transition: opacity 0.2s ease;
}

.mspmt-bs-card__gdot {
	width: 8px;
	height: 8px;
	padding: 0;
	cursor: pointer;
	background: rgba( 0, 0, 0, 0.25 );
	border: 0;
	border-radius: 50%;
}

.mspmt-bs-card__gdot.is-active {
	background: #333;
}

/* Hover: reveal add-to-cart, hide gallery dots. */

.mspmt-bs-card__cart {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 28px;
	z-index: 5;
	opacity: 0;
	transform: translateY( 8px );
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mspmt-bs-card:hover .mspmt-bs-card__cart {
	opacity: 1;
	transform: none;
}

.mspmt-bs-card__cart .button {
	display: block;
	width: 100%;
	text-align: center;
}

.mspmt-bs-card__cart .added_to_cart {
	display: block;
	margin-top: 4px;
	text-align: center;
	font-size: 0.85em;
}

/* ---- Body -------------------------------------------------------------- */

.mspmt-bs-card__body {
	padding: 12px 4px 4px;
}

.mspmt-bs-card__title {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
	text-decoration: none;
}

.mspmt-bs-card__rating {
	margin-bottom: 4px;
	font-size: 0.85em;
}

.mspmt-bs-card__price {
	font-weight: 600;
}

.mspmt-bs-card__price del {
	margin-left: 6px;
	font-weight: 400;
	opacity: 0.6;
}

.mspmt-bs-card__from {
	margin-right: 2px;
	font-weight: 400;
}

/* ---- Arrows & dots ----------------------------------------------------- */

.mspmt-bs__arrow {
	position: absolute;
	top: 38%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	font-size: 22px;
	line-height: 1;
	color: #222;
	cursor: pointer;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.12 );
	/* Hidden by default; revealed when the section is hovered. */
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0.15s ease;
}

.mspmt-bs:hover .mspmt-bs__arrow {
	opacity: 1;
	visibility: visible;
}

.mspmt-bs__arrow .mspmt-arrow-svg {
	display: block;
}

.mspmt-bs__arrow--prev {
	left: -8px;
}

.mspmt-bs__arrow--next {
	right: -8px;
}

.mspmt-bs__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.mspmt-bs__dots {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 16px;
}

.mspmt-bs__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	cursor: pointer;
	background: #ccc;
	border: 0;
	border-radius: 50%;
	transition: background-color 0.15s ease;
}

.mspmt-bs__dot.is-active {
	background: #333;
}

/* ---- Editor empty state ------------------------------------------------ */

.mspmt-bs--empty {
	padding: 20px;
	color: #767676;
	text-align: center;
	background: #f7f7f7;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
}
