/**
 * eBay-inspired homepage
 * Scoped to .marketplace-home-ebay
 */

.marketplace-home-ebay {
	--home-shell-width: var(--container-width);
	--home-shell-gutter: var(--site-shell-gutter, 16px);
}

.marketplace-home-ebay .marketplace-home {
	background: #f5f5f5;
	padding-bottom: 24px;
	max-width: var(--home-shell-width);
	width: 100%;
	margin-inline: auto;
	padding-inline: var(--home-shell-gutter);
	box-sizing: border-box;
}

/* Homepage modules share one column — no extra container inset */
.marketplace-home-ebay .marketplace-home .container,
.marketplace-home-ebay .ebay-home-gateway > .container {
	max-width: none;
	width: 100%;
	margin-inline: 0;
	padding-inline: 0;
	box-sizing: border-box;
}

/* Shared module card shell */
.marketplace-home-ebay .home-marketplace-shell {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 20px 16px 16px;
	box-sizing: border-box;
}

/* eBay gateway — category sidebar + spotlight cards + promo banner */
.marketplace-home-ebay .ebay-home-gateway {
	padding: 14px 0 10px;
}

.marketplace-home-ebay .ebay-home-gateway__grid {
	--ebay-gateway-height: 340px;
	display: grid;
	grid-template-columns: 220px minmax(0, 1.35fr) minmax(360px, 34%);
	grid-template-rows: var(--ebay-gateway-height);
	gap: 12px;
	align-items: stretch;
	min-height: var(--ebay-gateway-height);
}

.marketplace-home-ebay .ebay-home-gateway__sidebar {
	grid-column: 1;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	max-height: var(--ebay-gateway-height);
	min-height: 0;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
}

.marketplace-home-ebay .ebay-home-gateway__cards {
	grid-column: 2;
	grid-row: 1;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	min-width: 0;
	height: 100%;
	min-height: 0;
}

.marketplace-home-ebay .ebay-home-gateway__banner {
	grid-column: 3;
	grid-row: 1;
	min-width: 0;
	height: 100%;
	min-height: 0;
}

/* Category sidebar list — scroll inside fixed hero height */
.marketplace-home-ebay .ebay-gateway-cats {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #c4c4c4 transparent;
}

.marketplace-home-ebay .ebay-gateway-cats::-webkit-scrollbar {
	width: 6px;
}

.marketplace-home-ebay .ebay-gateway-cats::-webkit-scrollbar-thumb {
	background: #c4c4c4;
	border-radius: 999px;
}

.marketplace-home-ebay .ebay-gateway-cats__all {
	flex-shrink: 0;
}

.marketplace-home-ebay .ebay-gateway-cats__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 12px;
	color: #191919;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.35;
}

.marketplace-home-ebay .ebay-gateway-cats__link:hover {
	background: #f7f7f7;
	color: var(--color-primary);
}

.marketplace-home-ebay .ebay-gateway-cats__link svg {
	flex-shrink: 0;
	opacity: 0.45;
}

.marketplace-home-ebay .ebay-gateway-cats__all {
	display: block;
	padding: 10px 12px;
	border-top: 1px solid #e5e5e5;
	color: var(--color-primary);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	flex-shrink: 0;
}

.marketplace-home-ebay .ebay-gateway-cats__all:hover {
	background: #fff7f2;
}

/* Spotlight cards */
.marketplace-home-ebay .ebay-home-gateway__cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	min-width: 0;
}

.marketplace-home-ebay .ebay-gateway-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	padding: 12px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	text-decoration: none;
	color: #191919;
	transition: box-shadow 0.2s, transform 0.2s;
}

.marketplace-home-ebay .ebay-gateway-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.marketplace-home-ebay .ebay-gateway-card__head {
	display: grid;
	gap: 2px;
	margin-bottom: 10px;
}

.marketplace-home-ebay .ebay-gateway-card__title {
	font-size: 14px;
	font-weight: 800;
	line-height: 1.3;
}

.marketplace-home-ebay .ebay-gateway-card__subtitle {
	font-size: 13px;
	font-weight: 600;
	color: #707070;
	line-height: 1.3;
}

.marketplace-home-ebay .ebay-gateway-card__media {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	padding-bottom: 28px;
	background: #fafafa;
	border-radius: 6px;
	overflow: hidden;
}

.marketplace-home-ebay .ebay-gateway-card__media img,
.marketplace-home-ebay .ebay-gateway-card__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 200px;
	max-height: 220px;
	object-fit: contain;
}

.marketplace-home-ebay .ebay-gateway-card__price {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	padding: 4px 12px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #e5e5e5;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	font-size: 14px;
	font-weight: 800;
	color: #191919;
	white-space: nowrap;
}

.marketplace-home-ebay .ebay-gateway-card__price .woocommerce-Price-amount {
	color: inherit;
}

/* Promo banner carousel */
.marketplace-home-ebay .ebay-home-gateway__banner {
	min-width: 0;
}

.marketplace-home-ebay .ebay-gateway-banner-wrap {
	position: relative;
	height: 100%;
	min-height: 0;
}

.marketplace-home-ebay .ebay-gateway-banner {
	height: 100%;
}

.marketplace-home-ebay .ebay-gateway-banner__viewport {
	height: 100%;
	border-radius: 4px;
	overflow: hidden;
}

.marketplace-home-ebay .ebay-gateway-banner__track {
	height: 100%;
}

.marketplace-home-ebay .ebay-gateway-banner__slide {
	height: 100%;
}

.marketplace-home-ebay .ebay-gateway-banner__link {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	min-height: 0;
	padding: 20px;
	border-radius: 4px;
	overflow: hidden;
	text-decoration: none;
	color: #191919;
	background: linear-gradient(135deg, #fff7ed 0%, #fff 55%, #ecfdf5 100%);
	border: 1px solid #e5e5e5;
}

.marketplace-home-ebay .ebay-gateway-banner__slide.has-image .ebay-gateway-banner__link,
.marketplace-home-ebay .ebay-gateway-banner__slide.has-demo-image .ebay-gateway-banner__link {
	color: #fff;
	border: 0;
}

.marketplace-home-ebay .ebay-gateway-banner__slide.has-demo-image .ebay-gateway-banner__link {
	background: #f5f5f5;
}

.marketplace-home-ebay .ebay-gateway-banner__media {
	position: absolute;
	inset: 0;
}

.marketplace-home-ebay .ebay-gateway-banner__media img,
.marketplace-home-ebay .ebay-gateway-banner__media picture,
.marketplace-home-ebay .ebay-gateway-banner__img {
	display: block;
	width: 100%;
	height: 100%;
}

.marketplace-home-ebay .ebay-gateway-banner__media img,
.marketplace-home-ebay .ebay-gateway-banner__img {
	object-fit: cover;
	height: 100%;
	min-height: 0;
	max-height: none;
	aspect-ratio: auto;
}

.marketplace-home-ebay .ebay-gateway-banner__slide.has-image .ebay-gateway-banner__link::after,
.marketplace-home-ebay .ebay-gateway-banner__slide.has-demo-image .ebay-gateway-banner__link::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
}

.marketplace-home-ebay .ebay-gateway-banner__content {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 8px;
	max-width: 280px;
}

.marketplace-home-ebay .ebay-gateway-banner__title {
	font-size: 28px;
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.marketplace-home-ebay .ebay-gateway-banner__subtitle {
	font-size: 14px;
	line-height: 1.45;
	opacity: 0.92;
}

.marketplace-home-ebay .ebay-gateway-banner__cta {
	display: inline-flex;
	align-self: flex-start;
	margin-top: 4px;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--color-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 800;
}

.marketplace-home-ebay .ebay-gateway-banner__slide.has-image .ebay-gateway-banner__cta,
.marketplace-home-ebay .ebay-gateway-banner__slide.has-demo-image .ebay-gateway-banner__cta {
	background: #fff;
	color: var(--color-primary);
}

.marketplace-home-ebay .ebay-gateway-banner__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	justify-content: center;
}

.marketplace-home-ebay .ebay-gateway-banner__dots .carousel-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.55);
}

.marketplace-home-ebay .ebay-gateway-banner__dots .carousel-dot.is-active {
	background: #fff;
}

.marketplace-home-ebay .ebay-gateway-banner__slide.is-fallback:nth-child(2) .ebay-gateway-banner__link {
	background: linear-gradient(135deg, #ecfdf5 0%, #fff 60%, #eff6ff 100%);
}

@media (max-width: 1200px) {
	.marketplace-home-ebay {
		--home-shell-width: min(1480px, 100vw);
	}

	.marketplace-home-ebay .ebay-home-gateway__grid {
		grid-template-columns: 200px minmax(0, 1.2fr) minmax(300px, 32%);
	}
}

@media (max-width: 1024px) {
	.marketplace-home-ebay .ebay-home-gateway__grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto;
		min-height: 0;
		--ebay-gateway-height: auto;
	}

	.marketplace-home-ebay .ebay-home-gateway__sidebar,
	.marketplace-home-ebay .ebay-home-gateway__cards,
	.marketplace-home-ebay .ebay-home-gateway__banner {
		grid-column: 1;
		grid-row: auto;
	}

	.marketplace-home-ebay .ebay-home-gateway__sidebar {
		display: none;
	}

	.marketplace-home-ebay .ebay-home-gateway__cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.marketplace-home-ebay .ebay-gateway-banner-wrap,
	.marketplace-home-ebay .ebay-gateway-banner__link {
		min-height: 260px;
	}
}

@media (max-width: 768px) {
	.marketplace-home-ebay .ebay-home-gateway__cards {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 10px;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.marketplace-home-ebay .ebay-home-gateway__cards::-webkit-scrollbar {
		display: none;
	}

	.marketplace-home-ebay .ebay-gateway-card {
		flex: 0 0 72%;
		min-height: 280px;
		scroll-snap-align: start;
	}

	.marketplace-home-ebay .ebay-gateway-banner__title {
		font-size: 22px;
	}
}

/* Sections */
.marketplace-home-ebay .home-deals-row,
.marketplace-home-ebay .home-product-feed,
.marketplace-home-ebay .home-category-rows {
	padding: 12px 0;
}

.marketplace-home-ebay .home-deals-row .container,
.marketplace-home-ebay .home-product-feed .container,
.marketplace-home-ebay .home-category-row {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 20px 16px 16px;
	box-sizing: border-box;
}

.marketplace-home-ebay .home-category-rows .container {
	padding: 0;
	background: transparent;
	border: 0;
}

.marketplace-home-ebay .home-section-bar__title,
.marketplace-home-ebay .section-title {
	font-size: 20px;
	font-weight: 800;
	color: #191919;
}

.marketplace-home-ebay .home-section-bar__subtitle,
.marketplace-home-ebay .section-subtitle {
	color: #707070;
	font-size: 13px;
}

.marketplace-home-ebay .home-deal-card {
	border-radius: 4px;
}

.marketplace-home-ebay .home-product-feed__tablist {
	border-bottom: 1px solid #e5e5e5;
}

.marketplace-home-ebay .home-product-feed__tab {
	font-size: 14px;
	font-weight: 600;
	color: #707070;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: transparent;
}

.marketplace-home-ebay .home-product-feed__tab.is-active {
	color: #191919;
	border-bottom-color: var(--color-primary);
	background: transparent;
}

.marketplace-home-ebay .marketplace-home-products {
	gap: 12px !important;
}

/* Compact product cards — eBay-style dense grid */
.marketplace-home-ebay .home-product-feed__grid {
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)) !important;
	gap: 12px !important;
}

.marketplace-home-ebay .home-product-feed__grid li.product {
	max-width: 220px;
}

.marketplace-home-ebay .home-product-feed__grid li.product img {
	height: 148px;
	object-fit: cover;
}

.marketplace-home-ebay .home-product-feed__grid li.product .woocommerce-loop-product__title {
	min-height: 36px;
	padding: 8px 10px 2px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}

.marketplace-home-ebay .home-product-feed__grid li.product .price {
	padding: 0 10px 10px;
	font-size: 14px;
	font-weight: 700;
}

.marketplace-home-ebay .home-product-feed__grid li.product .button {
	display: none;
}

@media (min-width: 1200px) {
	.marketplace-home-ebay .home-product-feed__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	}

	.marketplace-home-ebay .home-product-feed__grid li.product {
		max-width: none;
	}
}

@media (max-width: 768px) {
	.marketplace-home-ebay .home-product-feed__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.marketplace-home-ebay .home-product-feed__grid li.product {
		max-width: none;
	}

	.marketplace-home-ebay .home-product-feed__grid li.product img {
		height: 132px;
	}
}

@media (max-width: 768px) {
	.marketplace-home-ebay .home-deals-row .container,
	.marketplace-home-ebay .home-product-feed .container,
	.marketplace-home-ebay .home-category-row {
		padding: 14px;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}
}

[data-theme="dark"].marketplace-home-ebay .marketplace-home {
	background: #0f172a;
}

[data-theme="dark"].marketplace-home-ebay .ebay-home-gateway__sidebar,
[data-theme="dark"].marketplace-home-ebay .ebay-gateway-card,
[data-theme="dark"].marketplace-home-ebay .ebay-gateway-banner__link,
[data-theme="dark"].marketplace-home-ebay .home-deals-row .container,
[data-theme="dark"].marketplace-home-ebay .home-product-feed .container,
[data-theme="dark"].marketplace-home-ebay .home-category-row {
	background: #111827;
	border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"].marketplace-home-ebay .home-section-bar__title,
[data-theme="dark"].marketplace-home-ebay .section-title,
[data-theme="dark"].marketplace-home-ebay .ebay-gateway-cats__link,
[data-theme="dark"].marketplace-home-ebay .ebay-gateway-card,
[data-theme="dark"].marketplace-home-ebay .ebay-gateway-card__title {
	color: #f8fafc;
}

[data-theme="dark"].marketplace-home-ebay .ebay-gateway-card__subtitle {
	color: #94a3b8;
}

[data-theme="dark"].marketplace-home-ebay .ebay-gateway-card__price {
	background: #1f2937;
	border-color: rgba(255, 255, 255, 0.12);
	color: #f8fafc;
}
