/* ==========================================================================
   my-shop — صفحه اصلی (فقط در صفحه اصلی بارگذاری می‌شود)
   ========================================================================== */

.home {
	--ms-home-bg: #faf6ef;
	--ms-home-card: #ffffff;
	--ms-home-line: #eadfce;
	--ms-home-ink: #2b2118;
	--ms-home-btn1: #4d7a2e;
	--ms-home-btn2: #c2570c;
	--ms-home-radius: 1.1rem;
	--ms-home-gap: 2.75rem;
	padding-block: 0 3rem;
	background: var(--ms-home-bg);
	color: var(--ms-home-ink);
}

.home-notices:empty {
	display: none;
}

.home-notices {
	padding-block-start: 1rem;
}

.home-section {
	margin-block-start: var(--ms-home-gap);
}

@media (min-width: 768px) {
	.home {
		--ms-home-gap: 4rem;
		padding-block-end: 4rem;
	}
}

.home-section__title {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin: 0 0 1rem;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
}

.home-section__title::before,
.home-section__title::after {
	content: "";
	flex: none;
	width: 0.55rem;
	height: 0.55rem;
	background: var(--ms-home-btn2);
	border-radius: 0.15rem;
	rotate: 45deg;
}

/* ---------- بالای صفحه ---------- */

.home-hero-wrap {
	padding-inline: 0;
}

.home-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 26rem;
	overflow: hidden;
	color: #fff;
	background: #3a2d22;
	isolation: isolate;
}

.home-hero.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(20, 14, 8, 0.6) 0%, rgba(20, 14, 8, 0.3) 45%, rgba(20, 14, 8, 0.65) 100%);
}

.home-hero__media,
.home-hero__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	display: block;
	width: 100%;
	height: 100%;
}

.home-hero__img {
	object-fit: cover;
	object-position: center;
}

.home-hero__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.75rem 1.25rem 1.25rem;
}

.home-hero__title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.7;
}

.home-hero__title-1,
.home-hero__title-2 {
	display: block;
}

.home-hero__tagline {
	margin: 0.25rem 0 0;
	font-size: 1rem;
	font-weight: 700;
}

.home-hero__actions {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.home-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.9rem 1.1rem;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.6;
	color: #fff;
	text-decoration: none;
	border: 2px solid rgba(255, 255, 255, 0.22);
	border-radius: 0.9rem;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
	transition: transform 0.15s, filter 0.15s;
}

.home-btn:hover {
	filter: brightness(1.08);
	transform: translateY(-2px);
}

.home-btn--1 {
	background: var(--ms-home-btn1);
}

.home-btn--2 {
	background: var(--ms-home-btn2);
}

.home-btn__icon {
	display: grid;
	flex: none;
	place-items: center;
}

.home-btn__icon .icon {
	width: 2rem;
	height: 2rem;
	stroke-width: 1.6;
}

@media (min-width: 768px) {
	.home-hero-wrap {
		padding-inline: 1rem;
		padding-block-start: 1.25rem;
	}

	.home-hero {
		min-height: clamp(21rem, 30vw, 27rem);
		color: var(--ms-home-ink);
		background: var(--ms-home-bg);
		border-radius: 1.4rem;
		box-shadow: 0 8px 30px rgba(80, 55, 20, 0.12);
	}

	.home-hero.has-image::after {
		background: linear-gradient(to left, rgba(250, 246, 239, 0.97) 0%, rgba(250, 246, 239, 0.92) 34%, rgba(250, 246, 239, 0) 64%);
	}

	.home-hero.has-image:dir(ltr)::after {
		background: linear-gradient(to right, rgba(250, 246, 239, 0.97) 0%, rgba(250, 246, 239, 0.92) 34%, rgba(250, 246, 239, 0) 64%);
	}

	.home-hero__img {
		object-position: center;
	}

	.home-hero__body {
		justify-content: center;
		gap: 1.5rem;
		width: 52%;
		padding: 2rem 2.5rem;
	}

	.home-hero__title {
		font-size: clamp(1.7rem, 3vw, 2.4rem);
	}

	.home-hero__title-1 {
		color: color-mix(in srgb, var(--ms-home-btn2) 90%, #000);
	}

	.home-hero__title-2 {
		color: var(--ms-home-ink);
	}

	.home-hero__tagline {
		margin-block-start: 0.5rem;
		font-size: 1.15rem;
		font-weight: 400;
		color: #6b5e50;
	}

	.home-hero__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.home-btn {
		flex: 1 1 14rem;
		max-width: 17rem;
		min-height: 5rem;
		font-size: 1rem;
		border-color: transparent;
		box-shadow: 0 6px 14px rgba(80, 55, 20, 0.22);
	}
}

/* ---------- دسته‌بندی‌ها ---------- */

.home-cats__list {
	--home-cols: 4;
	--home-gap: 0.5rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--home-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-cats__item {
	flex: 0 0 calc((100% - (var(--home-cols) - 1) * var(--home-gap)) / var(--home-cols));
	min-width: 0;
}

.home-cat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	height: 100%;
	padding: 0.6rem 0.3rem;
	color: inherit;
	text-align: center;
	text-decoration: none;
	background: #e9f0fb;
	border-radius: 0.9rem;
	transition: transform 0.15s, box-shadow 0.15s;
}

.home-cats__item:nth-child(5n + 2) .home-cat {
	background: #e8f3df;
}

.home-cats__item:nth-child(5n + 3) .home-cat {
	background: #fbe6e8;
}

.home-cats__item:nth-child(5n + 4) .home-cat {
	background: #fbf0d8;
}

.home-cats__item:nth-child(5n + 5) .home-cat {
	background: #ece8f7;
}

.home-cat:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(80, 55, 20, 0.14);
}

.home-cat__media {
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 1;
}

.home-cat__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.home-cat__img--placeholder {
	opacity: 0.5;
}

.home-cat__name {
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

@media (min-width: 640px) {
	.home-cats__list {
		--home-cols: 5;
		--home-gap: 0.75rem;
	}

	.home-cat__name {
		font-size: 0.9rem;
	}
}

@media (min-width: 768px) {
	.home-cats__list {
		--home-cols: 6;
	}

	.home-cats {
		padding: 1.25rem;
		background: #fffdf9;
		border: 1px solid var(--ms-home-line);
		border-radius: 1.2rem;
	}

	.home-cat,
	.home-cats__item:nth-child(n) .home-cat {
		padding: 0.9rem 0.5rem;
		background: var(--ms-home-card);
		border: 1px solid var(--ms-home-line);
		box-shadow: 0 2px 8px rgba(80, 55, 20, 0.06);
	}
}

@media (min-width: 1024px) {
	.home-cats__list {
		--home-cols: 7;
		--home-gap: 1rem;
	}
}

/* ---------- معرفی فروشگاه ---------- */

.home-about {
	display: flex;
	flex-direction: column;
	max-width: none;
	padding-inline: 0;
	overflow: hidden;
	background: var(--ms-home-card);
	border-block: 1px solid var(--ms-home-line);
}

.home-about__media {
	line-height: 0;
}

.home-about__img {
	display: block;
	width: 100%;
	max-height: 18rem;
	object-fit: cover;
}

.home-about__card {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.9rem;
	padding: 1.25rem;
}

.home-about__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.7;
}

.home-about__text {
	font-size: 0.9rem;
	line-height: 2;
	color: #5a4d40;
}

.home-about__text p {
	margin: 0 0 0.6rem;
}

.home-about__text p:last-child {
	margin-block-end: 0;
}

.home-about__text strong,
.home-about__text a {
	font-weight: 700;
	color: var(--ms-home-btn1);
	text-decoration: none;
}

.home-about__features {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.5rem;
	margin: auto 0 0;
	padding: 0.9rem 0 0;
	list-style: none;
	border-block-start: 1px solid var(--ms-home-line);
}

.home-feature {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	text-align: center;
}

.home-feature__icon {
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	color: var(--ms-home-btn1);
	background: color-mix(in srgb, var(--ms-home-btn1) 12%, #fff);
	border-radius: 0.8rem;
}

.home-feature__icon .icon {
	width: 1.5rem;
	height: 1.5rem;
}

.home-feature__text {
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.6;
}

@media (min-width: 768px) {
	.home-about,
	.home-cats {
		width: calc(100% - 2rem);
		max-width: calc(var(--ms-container) - 2rem);
	}

	.home-about {
		border: 1px solid var(--ms-home-line);
		border-radius: 1.2rem;
	}

	.home-about.has-image {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.home-about__media {
		order: 2;
	}

	.home-about__img {
		height: 100%;
		max-height: none;
	}

	.home-about__card {
		order: 1;
		justify-content: center;
		padding: 2rem;
	}

	.home-about__title {
		font-size: 1.4rem;
	}

	.home-about__text {
		font-size: 0.95rem;
	}

	.home-feature__text {
		font-size: 0.82rem;
	}

	.home-feature:not(:first-child) {
		border-inline-start: 1px solid var(--ms-home-line);
	}
}

/* ---------- محصولات پرطرفدار ---------- */

.home-products__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-width: 0;
	padding: 0.6rem;
	background: var(--ms-home-card);
	border: 1px solid var(--ms-home-line);
	border-radius: 0.9rem;
	box-shadow: 0 2px 8px rgba(80, 55, 20, 0.06);
}

.home-card__main {
	display: grid;
	flex: 1;
	grid-template-columns: auto minmax(0, 1fr);
	align-content: start;
	gap: 0.15rem 0.6rem;
	min-width: 0;
}

.home-card__img {
	grid-row: 1 / span 2;
	width: 3.75rem;
	line-height: 0;
}

.home-card__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	border-radius: 0.5rem;
}

.home-card__info {
	display: contents;
}

.home-card__price {
	align-self: end;
}

.home-card__rating {
	align-self: start;
}

.home-card__title {
	grid-column: 1 / -1;
	grid-row: 3;
	margin-block-start: 0.35rem;
}

.home-card__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.7;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}

.home-card__title,
.home-card__price {
	margin-inline: 0;
}

.home-card__title a {
	color: inherit;
	text-decoration: none;
}

.home-card__title a:hover {
	color: var(--ms-home-btn1);
}

.home-card__price {
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.6;
	color: var(--ms-home-btn1);
}

.home-card__price del {
	display: block;
	font-size: 0.72rem;
	font-weight: 400;
	color: #8a7c6c;
}

.home-card__price ins {
	text-decoration: none;
}

.home-card__rating {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.78rem;
	line-height: 1.4;
	color: #5a4d40;
}

.home-stars {
	position: relative;
	display: inline-block;
	font-size: 0.85rem;
	line-height: 1;
	letter-spacing: 1px;
	color: #d6cdbf;
	white-space: nowrap;
}

.home-stars::before,
.home-stars::after {
	content: "★★★★★";
}

.home-stars::after {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: var(--ms-rating, 0%);
	overflow: hidden;
	color: #f59e0b;
}

.home-card__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.5rem 0.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.4;
	color: #fff;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	background: var(--ms-home-btn1);
	border-radius: 0.6rem;
	transition: filter 0.15s;
}

.home-card__btn:hover {
	filter: brightness(1.1);
}

.home-card__btn .icon {
	width: 1rem;
	height: 1rem;
}

@media (min-width: 700px) {
	.home-products__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.9rem;
	}

	.home-card {
		padding: 0.8rem;
	}

	.home-card__main {
		display: flex;
		align-items: flex-start;
		gap: 0.8rem;
	}

	.home-card__img {
		flex: none;
		width: 5.5rem;
	}

	.home-card__info {
		display: flex;
		flex-direction: column;
		gap: 0.2rem;
		min-width: 0;
	}

	.home-card__title {
		margin-block-start: 0;
		font-size: 0.95rem;
	}

	.home-card__price,
	.home-card__rating {
		align-self: auto;
	}

	.home-card__price {
		font-size: 0.92rem;
	}

	.home-card__btn {
		padding: 0.6rem 0.5rem;
		font-size: 0.88rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-btn,
	.home-cat,
	.home-card__btn {
		transition: none;
	}

	.home-btn:hover,
	.home-cat:hover {
		transform: none;
	}
}
