/* =========================================================
   Office Store Homepage — Bestseller Carousel
   Scoped only to .ofs-home__bestsellers.
   ========================================================= */

/* Carousel container + pre-init fallback. */
.ofs-home__bestsellers {
	position: relative;
	overflow: hidden;
}

.ofs-home__bestsellers
	.ofs-products:not(.flickity-enabled) {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 22px;
	width: 100%;
	margin: 0;
	padding: 4px 52px 18px;
	overflow: hidden;
	direction: rtl;
	box-sizing: border-box;
}

.ofs-home__bestsellers
	.ofs-products:not(.flickity-enabled)
	.ofs-product-card {
	flex: 0 0 calc((100% - 88px) / 5);
	width: calc((100% - 88px) / 5);
	direction: rtl;
}

/* Section + heading */
.ofs-home__bestsellers {
	padding-top: 40px;
	padding-bottom: 40px;
	background: #f7f9fc;
}

.ofs-home__bestsellers .ofs-section-header {
	max-width: 100%;
	margin: 0 0 18px;
	text-align: center;
}

.ofs-home__bestsellers .ofs-section-header h2 {
	margin: 0 0 5px;
	font-size: 27px;
	line-height: 1.45;
	text-align: center;
}

.ofs-home__bestsellers .ofs-section-header p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.8;
	text-align: center;
}

/* Product cells are intentionally not cards. */
.ofs-home__bestsellers .ofs-product-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: visible;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	transition: none;
}

.ofs-home__bestsellers .ofs-product-card:hover {
	transform: none;
	border-color: transparent;
	box-shadow: none;
}

/* Image area — same natural-image model as Windows/M365/Office. */
.ofs-home__bestsellers .ofs-product-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	overflow: visible;
	text-decoration: none;
}

.ofs-home__bestsellers .ofs-product-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	object-fit: contain;
	transform: none;
	transition: none;
	background: transparent;
	border: 0;
	box-shadow: none;

	/* White in the JPG remains white in the source file;
	   multiply is what visually merges it with #f7f9fc. */
	mix-blend-mode: multiply;
}

.ofs-home__bestsellers .ofs-product-card:hover .ofs-product-card__image img {
	transform: none;
}

/* Keep the Flickity layers transparent so they cannot introduce
   a white backdrop around the product artwork. */
.ofs-home__bestsellers .ofs-products,
.ofs-home__bestsellers .flickity-viewport,
.ofs-home__bestsellers .flickity-slider {
	background: transparent;
}

.ofs-home__bestsellers .flickity-slider {
	isolation: auto;
}

/* Text follows the artwork naturally. */
.ofs-home__bestsellers .ofs-product-card__body {
	display: block;
	flex: none;
	margin: 0;
	padding: 7px 2px 0;
	background: transparent;
	text-align: center;
}

.ofs-home__bestsellers .ofs-product-card__title {
	min-height: 42px;
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.55;
	text-align: center;
}

.ofs-home__bestsellers .ofs-product-card__title a {
	color: #172033;
	text-decoration: none;
}

.ofs-home__bestsellers .ofs-product-card__price {
	min-height: 23px;
	margin: 0;
	color: #159447;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
}

.ofs-home__bestsellers .ofs-product-card__price del {
	margin-left: 6px;
	color: #98a1ae;
	font-size: 11px;
	font-weight: 400;
}

/* Desktop: five visible products. */
@media (min-width: 1051px) {
	.ofs-home__bestsellers
		.ofs-products:not(.flickity-enabled) {
		display: flex;
		flex-wrap: nowrap;
		gap: 22px;
		width: 100%;
		margin: 0;
		padding: 0 52px 4px;
		overflow: hidden;
		direction: rtl;
		box-sizing: border-box;
	}

	.ofs-home__bestsellers
		.ofs-products:not(.flickity-enabled)
		.ofs-product-card {
		flex: 0 0 calc((100% - 88px) / 5);
		width: calc((100% - 88px) / 5);
		direction: rtl;
	}

	.ofs-home__bestsellers
		.ofs-products.flickity-enabled {
		display: block;
		width: 100%;
		margin: 0;
		padding: 0 52px 4px;
		overflow: hidden;
		direction: rtl;
		box-sizing: border-box;
	}

	.ofs-home__bestsellers
		.flickity-slider
		.ofs-product-card {
		width: calc((100% - 88px) / 5);
		margin-left: 22px;
		direction: rtl;
	}

	.ofs-home__bestsellers
		.flickity-slider
		.ofs-product-card:last-child {
		margin-left: 0;
	}
}

/* Active Flickity state: override the generic product grid. */
.ofs-home__bestsellers .ofs-products.flickity-enabled {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0 52px 4px;
	overflow: hidden;
	direction: rtl;
	box-sizing: border-box;
}

.ofs-home__bestsellers .flickity-viewport {
	width: 100%;
	overflow: hidden;
}

.ofs-home__bestsellers .flickity-slider {
	width: 100%;
}

/* Arrows */
.ofs-home__bestsellers .flickity-prev-next-button {
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid #dce2e9;
	border-radius: 50%;
	background: #fff;
	color: #172033;
	box-shadow: 0 6px 20px rgba(15, 31, 51, 0.15);
	opacity: 1;
	visibility: visible;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		opacity 0.2s ease;
}

.ofs-home__bestsellers .flickity-prev-next-button.previous {
	right: 5px;
	left: auto;
}

.ofs-home__bestsellers .flickity-prev-next-button.next {
	left: 5px;
	right: auto;
}

.ofs-home__bestsellers .flickity-prev-next-button svg {
	fill: #172033;
}

.ofs-home__bestsellers .flickity-page-dots {
	display: none;
}

.ofs-home__bestsellers .flickity-prev-next-button:hover {
	background: #e64a00;
	border-color: #e64a00;
	box-shadow: 0 9px 24px rgba(15, 31, 51, 0.18);
}

.ofs-home__bestsellers .flickity-prev-next-button:hover svg {
	fill: #fff;
}

.ofs-home__bestsellers .flickity-prev-next-button:disabled {
	opacity: 0.25;
	cursor: default;
	pointer-events: none;
}

.ofs-home__bestsellers .flickity-prev-next-button:focus-visible {
	outline: 3px solid rgba(230, 74, 0, 0.25);
	outline-offset: 2px;
}

.ofs-home__bestsellers .flickity-enabled.is-draggable .flickity-viewport {
	cursor: grab;
}

.ofs-home__bestsellers .flickity-enabled.is-draggable .flickity-viewport.is-pointer-down {
	cursor: grabbing;
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1050px) {
	.ofs-home__bestsellers {
		padding-top: 38px;
		padding-bottom: 38px;
	}

	.ofs-home__bestsellers .ofs-product-card__image {
		aspect-ratio: 1 / 1;
	}

	.ofs-home__bestsellers
		.ofs-products:not(.flickity-enabled) {
		gap: 18px;
		padding-right: 48px;
		padding-left: 48px;
	}

	.ofs-home__bestsellers
		.ofs-products:not(.flickity-enabled)
		.ofs-product-card {
		flex-basis: calc((100% - 18px) / 2);
		width: calc((100% - 18px) / 2);
	}

	.ofs-home__bestsellers .ofs-products:not(.flickity-enabled),
	.ofs-home__bestsellers .ofs-products.flickity-enabled {
		padding-right: 48px;
		padding-left: 48px;
	}

	.ofs-home__bestsellers
		.flickity-slider
		.ofs-product-card {
		width: calc((100% - 18px) / 2);
		margin-left: 18px;
	}

	.ofs-home__bestsellers .flickity-prev-next-button {
		width: 42px;
		height: 42px;
	}
}

/* Mobile */
@media (max-width: 640px) {
	.ofs-home__bestsellers {
		padding-top: 34px;
		padding-bottom: 34px;
	}

	.ofs-home__bestsellers .ofs-section-header h2 {
		font-size: 23px;
	}

	.ofs-home__bestsellers .ofs-section-header p {
		font-size: 13px;
	}

	.ofs-home__bestsellers .ofs-product-card__title {
		min-height: 0;
		font-size: 13px;
	}

	.ofs-home__bestsellers .ofs-product-card__price {
		font-size: 13px;
	}

	.ofs-home__bestsellers
		.ofs-products:not(.flickity-enabled) {
		gap: 14px;
		padding-right: 44px;
		padding-left: 44px;
		padding-bottom: 14px;
	}

	.ofs-home__bestsellers
		.ofs-products:not(.flickity-enabled)
		.ofs-product-card {
		flex: 0 0 84%;
		width: 84%;
	}

	.ofs-home__bestsellers .ofs-products:not(.flickity-enabled),
	.ofs-home__bestsellers .ofs-products.flickity-enabled {
		padding-right: 44px;
		padding-left: 44px;
	}

	.ofs-home__bestsellers
		.flickity-slider
		.ofs-product-card {
		width: 84%;
		margin-left: 14px;
	}

	.ofs-home__bestsellers .flickity-prev-next-button {
		width: 40px;
		height: 40px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ofs-home__bestsellers .ofs-product-card__image img {
		transition: none;
	}
}
