/* Homepage landing — section rhythm, cards, tiles, banners */

/*
 * Product rhythm: exactly 24px between major sections (mobile + desktop).
 * Use margin-top on each section after the first — clearer than split padding,
 * and !important beats theme.min.css (.home .block { padding-bottom:0 }, 
 * carousel__header padding-top: 88px / 36px).
 */
body.home {
	--home-section-gap: 24px;
	/* Inner breathing room inside section boxes (esp. colored carousels) */
	--home-section-pad-y: 28px;
	--home-section-pad-x: 16px;
}

@media (max-width: 767px) {
	body.home {
		--home-section-pad-y: 20px;
		--home-section-pad-x: 12px;
	}
}

/* ---- Reset theme vertical chrome on home ---- */
body.home .block {
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

body.home .branches,
body.home .branches.block__wrapper,
body.home .branches-2c,
body.home .branches-2c.block__wrapper {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

body.home .block > .carousel {
	padding-bottom: 0 !important;
}

/* Section owns the 24px gap; carousel title must not add 60–88px */
body.home .carousel__header,
body.home .block + .block .carousel__header,
body.home .home-section + .block .carousel__header,
body.home .block + .home-section .carousel__header {
	padding-top: 0 !important;
	margin-bottom: 12px !important;
}

@media (max-width: 1440px) {
	body.home .carousel__header,
	body.home .block + .block .carousel__header,
	body.home .home-section + .block .carousel__header,
	body.home .block + .home-section .carousel__header {
		padding-top: 0 !important;
	}
}

@media (max-width: 768px) {
	body.home .carousel__header,
	body.home .block + .block .carousel__header,
	body.home .home-section + .block .carousel__header,
	body.home .block + .home-section .carousel__header {
		padding-top: 0 !important;
	}
}

/* ---- Gap between sections + inner pad inside content boxes ---- */
body.home .home-categories,
body.home .home-image-banner__section {
	margin-top: var(--home-section-gap) !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	box-sizing: border-box;
}

/* Carousels / colored sections: keep gap, add inner pad (desktop + mobile) */
body.home .block[class*="__wrapper"],
body.home .home-carousel,
body.home .home-section,
body.home .art-of-stacking,
body.home .holidays__wrapper,
body.home .home-promotion__wrapper,
body.home .home-giftguide__wrapper {
	margin-top: var(--home-section-gap) !important;
	margin-bottom: 0 !important;
	padding-top: var(--home-section-pad-y) !important;
	padding-bottom: var(--home-section-pad-y) !important;
	padding-inline: var(--home-section-pad-x) !important;
	box-sizing: border-box;
}

/* Nested block inside .home-section — pad/gap on outer only (no double inset) */
body.home .home-section .block,
body.home .home-section .home-carousel,
body.home .home-section [class*="__wrapper"],
body.home .home-section .art-of-stacking,
body.home .home-section .holidays__wrapper,
body.home .home-section .home-promotion__wrapper,
body.home .home-section .home-giftguide__wrapper {
	margin-top: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	padding-inline: 0 !important;
}

/* Hero is the first section — no top gap */
body.home .hero,
body.home .hero__container {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* Product cards: image 10% shorter */
body.home .carousel__content li a {
	padding-bottom: 90%;
}

/* Color swatches on the same row as price */
body.home .product .woocommerce-card__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 8px;
	position: relative;
}

body.home .product .woocommerce-loop-product__title {
	width: 100%;
	flex: 0 0 100%;
}

body.home .product .product-color-container {
	position: static;
	bottom: auto;
	left: auto;
	order: 3;
	flex: 0 0 100%;
	margin: 0;
	/* Half of --home-section-gap (24px → 12px) between price/button and color bar */
	padding-top: calc(var(--home-section-gap) / 2);
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

body.home .product .woocommerce-card__header .price,
body.home .carousel .product .price {
	order: 1;
	margin: 0;
	flex: 1 1 auto;
}

/* Hide SnapPay installment badge on homepage product cards */
body.home .installment {
	display: none !important;
}

/* Image banners */
.home-image-banner__section {
	position: relative;
}

.home-image-banner {
	display: block;
	width: 100%;
	overflow: hidden;
	line-height: 0;
	aspect-ratio: 1272 / 260;
}

.home-image-banner__img,
.home-image-banner picture,
.home-image-banner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Optional CTA — position from ACF (top/right px, desktop + mobile) */
.home-image-banner__btn {
	position: absolute;
	z-index: 2;
	top: var(--hib-btn-top, 24px);
	right: var(--hib-btn-right, 24px);
	left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	background: #fff;
	color: #111;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	border: 1px solid #111;
	border-radius: 0;
	box-shadow: none;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.home-image-banner__btn:hover,
.home-image-banner__btn:focus {
	background: #111;
	color: #fff;
	outline: none;
}

@media (max-width: 767px) {
	.home-image-banner--tall {
		aspect-ratio: 390 / 400;
	}

	.home-image-banner--short {
		aspect-ratio: 390 / 221;
	}

	.home-image-banner__btn {
		top: var(--hib-btn-top-m, 16px);
		right: var(--hib-btn-right-m, 16px);
		padding: 8px 16px;
		font-size: 13px;
	}
}

/*
 * Carousel start alignment (RTL):
 * theme.css padding-left:60px on .slick-list clips the first card.
 */
body.home .slick-list {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/*
 * Gift tiles only. Theme adds 88px title pad + 40px title margin on top of the
 * shared section gap. Drop that extra so this block matches the other sections.
 * Tiles were 119% tall; a bit shorter.
 */
body.home .home-giftguide__wrapper .giftguide__container .title {
	padding-top: 0 !important;
}

body.home .home-giftguide__wrapper .title-content {
	margin-top: 0 !important;
	margin-bottom: 16px !important;
}

body.home .home-giftguide__wrapper .image__container span {
	padding-top: 90% !important;
}

/*
 * Per-section spacing from the page editor.
 * Only the sides with a number are overridden. Empty fields keep the current gap.
 */
@media (min-width: 768px) {
	body.home .home-section-space[style*="--hs-top-d:"] > * {
		margin-top: 0 !important;
		padding-top: var(--hs-top-d) !important;
	}

	body.home .home-section-space[style*="--hs-bottom-d:"] > * {
		margin-bottom: 0 !important;
		padding-bottom: var(--hs-bottom-d) !important;
	}
}

@media (max-width: 767px) {
	body.home .home-section-space[style*="--hs-top-m:"] > * {
		margin-top: 0 !important;
		padding-top: var(--hs-top-m) !important;
	}

	body.home .home-section-space[style*="--hs-bottom-m:"] > * {
		margin-bottom: 0 !important;
		padding-bottom: var(--hs-bottom-m) !important;
	}
}

/* Category tiles: shorter than the old 120% box. Section gap stays on .home-categories. */
body.home .home-categories__media {
	padding-bottom: 88%;
}

/* Category tiles: desktop fill row evenly */
@media (min-width: 768px) {
	body.home .home-categories {
		display: flex;
		flex-wrap: nowrap;
		justify-content: space-between;
		align-items: stretch;
		gap: 1px;
		grid-template-columns: none;
	}

	body.home .home-categories > a {
		flex: 1 1 0;
		min-width: 0;
		max-width: none;
	}
}

/*
 * شگفت carousel.
 * Beige sits inside the section pad, so the page white shows around it.
 * Outer section gap is unchanged.
 */
body.home .home-carousel--shegeft {
	background-color: transparent !important;
}

body.home .home-carousel--shegeft .carousel--shegeft {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-areas:
		"title"
		"track"
		"more";
	gap: 10px;
	align-items: center;
	margin: 0;
	padding: 14px 8px 16px !important;
	background-color: #f6efe4;
	border-radius: 18px;
	box-sizing: border-box;
}

body.home .home-carousel--shegeft .shegeft__title {
	grid-area: title;
	margin: 0;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.5;
	color: #1a1a1a;
	text-align: center;
}

body.home .home-carousel--shegeft .shegeft__track {
	grid-area: track;
	min-width: 0;
	position: relative;
}

body.home .home-carousel--shegeft .carousel__nav {
	top: 42%;
	z-index: 4;
}

body.home .home-carousel--shegeft .carousel__nav .slick-arrow {
	background: #fff;
}

body.home .home-carousel--shegeft .shegeft__more {
	grid-area: more;
	justify-self: center;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-decoration: none;
}

body.home .home-carousel--shegeft .shegeft__more:hover,
body.home .home-carousel--shegeft .shegeft__more:focus {
	color: #1a1a1a;
	text-decoration: none;
}

body.home .home-carousel--shegeft .carousel__content {
	padding: 0 !important;
}

body.home .home-carousel--shegeft .slick-list,
body.home .home-carousel--shegeft .slick-track {
	height: auto !important;
}

body.home .home-carousel--shegeft .slick-track {
	display: flex !important;
	align-items: stretch !important;
}

body.home .home-carousel--shegeft .slick-slide {
	box-sizing: border-box;
	height: auto !important;
	display: flex !important;
}

body.home .home-carousel--shegeft .slick-slide > div {
	display: flex;
	width: 100%;
}

body.home .home-carousel--shegeft .slick-list {
	margin: 0;
}

body.home .home-carousel--shegeft li.product {
	display: flex !important;
	flex-direction: column;
	background-color: #fff !important;
	background-clip: padding-box;
	border-inline: 5px solid transparent;
	border-radius: 16px;
	padding: 10px 10px 14px !important;
	box-sizing: border-box;
	width: 100%;
	height: auto !important;
	position: relative;
	overflow: visible;
}

body.home .home-carousel--shegeft .product > .woocommerce-loop-product__link {
	padding: 0 !important;
	height: 188px !important;
	background: #fff !important;
	border-radius: 10px;
}

body.home .home-carousel--shegeft .woocommerce-loop-product__title,
body.home .home-carousel--shegeft .woocommerce-loop-product__title a {
	padding: 0 !important;
	height: auto !important;
	position: static !important;
	background: transparent !important;
}

/*
 * آماده ارسال = physical left, تخفیف = physical right.
 * Do NOT set inset-inline-* here: in RTL, inset-inline-end maps to left and
 * would override left:10px (auto wins → static position sticks to the right).
 */
body.home .home-carousel--shegeft .parasteh-product-labels {
	position: absolute !important;
	top: 10px !important;
	left: 10px !important;
	right: auto !important;
	width: max-content !important;
	max-width: none !important;
	display: block !important;
	z-index: 21 !important;
}
body.home .home-carousel--shegeft .parasteh-product-labels .parasteh-instock-label,
body.home .home-carousel--shegeft .parasteh-product-labels .parasteh-tag-label {
	width: auto !important;
	height: auto !important;
	min-height: 20px;
	padding: 4px 10px !important;
	margin: 0 0 4px !important;
	white-space: nowrap !important;
	writing-mode: horizontal-tb !important;
}

body.home .home-carousel--shegeft .onsale {
	position: absolute !important;
	top: 10px !important;
	right: 10px !important;
	left: auto !important;
	z-index: 20 !important;
	display: inline-flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 2px !important;
	margin: 0 !important;
	padding: 4px 10px !important;
	min-height: 20px;
	width: auto !important;
	border-radius: 2px !important;
	background: #fff !important;
	border: none !important;
	color: #000 !important;
	font-size: 10px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	white-space: nowrap;
	box-shadow: none !important;
}
body.home .home-carousel--shegeft .onsale .onsale__label {
	display: block !important;
	font-size: 10px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
}
body.home .home-carousel--shegeft .onsale .onsale__pct {
	display: block !important;
	font-size: 10px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	color: #000 !important;
}

body.home .home-carousel--shegeft .product-color-container {
	display: flex !important;
	position: static !important;
	justify-content: center;
	width: 100%;
	margin-top: 6px;
	padding-top: 0;
}

body.home .home-carousel--shegeft .woocommerce-card__header {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: flex-start !important;
	flex: 0 0 auto;
	width: 100%;
	height: auto !important;
	text-align: center;
	margin-top: 8px;
	gap: 4px;
}

body.home .home-carousel--shegeft .woocommerce-loop-product__title,
body.home .home-carousel--shegeft .woocommerce-card__header .price,
body.home .home-carousel--shegeft .product-color-container {
	flex: 0 0 auto !important;
	height: auto !important;
	width: 100% !important;
	max-width: 100%;
}

body.home .home-carousel--shegeft .woocommerce-loop-product__title,
body.home .home-carousel--shegeft .woocommerce-loop-product__title a,
body.home .home-carousel--shegeft .price,
body.home .home-carousel--shegeft .woocommerce-card__header .price {
	text-align: center;
	width: 100%;
}

body.home .home-carousel--shegeft .woocommerce-loop-product__title a {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
	color: #1a1a1a;
}

body.home .home-carousel--shegeft .price,
body.home .home-carousel--shegeft .woocommerce-card__header .price {
	display: flex !important;
	flex-direction: column !important;
	align-items: center;
	gap: 2px;
	font-size: 12px;
	font-weight: 400;
	color: #1a1a1a;
	line-height: 1.4;
}

body.home .home-carousel--shegeft .price del,
body.home .home-carousel--shegeft .price ins {
	display: block;
	background: none;
}

body.home .home-carousel--shegeft .price del {
	color: #8a8178;
	font-size: 11px;
	line-height: 1.3;
}

body.home .home-carousel--shegeft .price ins {
	text-decoration: none;
	font-weight: 500;
	line-height: 1.3;
}

body.home .home-carousel--shegeft .js-carousel--favourites:not(.slick-initialized) {
	gap: 12px;
}

body.home .home-carousel--shegeft .js-carousel--favourites:not(.slick-initialized) > li.product,
body.home .home-carousel--shegeft .js-carousel--favourites:not(.slick-initialized) > .product {
	flex: 0 0 calc(50% - 6px) !important;
	max-width: calc(50% - 6px) !important;
	width: calc(50% - 6px) !important;
}

@media (min-width: 768px) {
	body.home .home-carousel--shegeft .carousel--shegeft {
		grid-template-columns: 112px minmax(0, 1fr);
		grid-template-areas:
			"title track"
			"more track";
		column-gap: 12px;
		row-gap: 6px;
	}

	body.home .home-carousel--shegeft .shegeft__title {
		align-self: end;
		font-size: 15px;
		font-weight: 500;
		text-align: center;
	}

	body.home .home-carousel--shegeft .product > .woocommerce-loop-product__link {
		height: 248px !important;
	}

	body.home .home-carousel--shegeft .shegeft__more {
		align-self: start;
		justify-self: center;
	}

	body.home .home-carousel--shegeft .js-carousel--favourites:not(.slick-initialized) > li.product,
	body.home .home-carousel--shegeft .js-carousel--favourites:not(.slick-initialized) > .product {
		flex-basis: calc(25% - 9px) !important;
		max-width: calc(25% - 9px) !important;
		width: calc(25% - 9px) !important;
	}
}

/* Black value bar sits on the footer. The white band was the footer top margin and padding. */
body.home footer.site-footer {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Three items, not four. A 4-column grid left the middle one right of center. */
@media (min-width: 480px) {
	body.home .value-props__containner {
		width: min(720px, 100%);
		max-width: 720px;
		margin-inline: auto;
		grid-template-columns: repeat(3, 1fr);
		justify-content: center;
		justify-items: center;
	}
}

/* Section spacing zeros the bar's bottom pad, so the icons sat high. */
body.home .home-section-space > .value-props__wrapper {
	padding-top: 28px !important;
	padding-bottom: 28px !important;
}

body.home .value-props__wrapper .value__content {
	justify-content: center;
}
