/* ==========================================================================
   Moshkfam Product Showcase — Frontend
   Minimal + Premium + Glassmorphism. A "product showcase application" feel:
   glass navigation, live search, subcategory sidebar, drawer-style cards.
   ========================================================================== */

.mfc-showcase {
	--mfc-bg: #0b0d10;
	--mfc-bg-elevated: #12151a;
	--mfc-surface: rgba(255, 255, 255, 0.04);
	--mfc-surface-hover: rgba(255, 255, 255, 0.08);
	--mfc-border: rgba(255, 255, 255, 0.09);
	--mfc-metal: linear-gradient(135deg, #c9d3dc 0%, #7c8894 45%, #aeb8c2 70%, #dfe4e8 100%);
	--mfc-accent: #8fb8c9;
	--mfc-accent-strong: #c7d8de;
	--mfc-text: #f2f4f6;
	--mfc-text-dim: rgba(242, 244, 246, 0.62);
	--mfc-radius: 16px;
	--mfc-glass-bg: rgba(255, 255, 255, 0.06);
	--mfc-glass-bg-strong: rgba(255, 255, 255, 0.1);
	--mfc-glass-blur: blur(18px) saturate(160%);
	--mfc-transition: 420ms cubic-bezier(0.16, 1, 0.3, 1);
	--mfc-drawer-transition: 520ms cubic-bezier(0.16, 1, 0.3, 1);

	position: relative;
	background:
		radial-gradient(1100px 480px at 10% -15%, rgba(143, 184, 201, 0.16), transparent 60%),
		radial-gradient(900px 460px at 105% 0%, rgba(199, 216, 222, 0.10), transparent 55%),
		radial-gradient(1000px 600px at 50% 115%, rgba(124, 136, 148, 0.12), transparent 60%),
		linear-gradient(165deg, #0b0d10 0%, #12151a 45%, #171b21 100%);
	color: var(--mfc-text);
	font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	padding-bottom: 60px;
	overflow: hidden;
	border-radius: 8px;
	box-sizing: border-box;
}

.mfc-showcase * {
	box-sizing: border-box;
}

.mfc-showcase img {
	max-width: 100%;
	display: block;
}

/* ---------------- Hero (compact header bar) ---------------- */
/* Redesigned to be a slim, minimal strip instead of a tall banner, so the
   product grid is visible almost immediately without scrolling. */

.mfc-hero {
	position: relative;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: linear-gradient(120deg, rgba(143, 184, 201, 0.18) 0%, rgba(255, 255, 255, 0.05) 45%, rgba(124, 136, 148, 0.16) 100%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	backdrop-filter: blur(20px) saturate(160%);
	border-bottom: 1px solid var(--mfc-border);
	overflow: hidden;
}

.mfc-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 60% 120% at 12% 0%, rgba(255, 255, 255, 0.16), transparent 65%);
	pointer-events: none;
}

.mfc-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 0%, rgba(11, 13, 16, 0.3) 100%);
	pointer-events: none;
}

.mfc-hero-content {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 8px 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 12px;
	animation: mfc-hero-in 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mfc-hero-title {
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.1;
	margin: 0;
	background: var(--mfc-metal);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-shadow: none;
	white-space: nowrap;
}

.mfc-hero-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.mfc-hero-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border: 1px solid var(--mfc-border);
	background: var(--mfc-glass-bg);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--mfc-text-dim);
	font-family: inherit;
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	padding: 4px 10px;
	border-radius: 999px;
	cursor: pointer;
	transition: all var(--mfc-transition);
	white-space: nowrap;
}

.mfc-hero-btn svg {
	width: 11px;
	height: 11px;
	flex-shrink: 0;
}

.mfc-hero-btn:hover {
	background: var(--mfc-glass-bg-strong);
	border-color: rgba(255, 255, 255, 0.26);
	color: var(--mfc-text);
}

@keyframes mfc-hero-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------------- Nav bar (glass, sticky) ---------------- */

.mfc-navbar-sticky {
	position: sticky;
	top: 0;
	z-index: 30;
	margin-top: 6px;
	padding: 0 20px;
}

.mfc-navbar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	max-width: 1400px;
	margin: 0 auto;
	padding: 10px 14px;
	background: var(--mfc-glass-bg);
	-webkit-backdrop-filter: var(--mfc-glass-blur);
	backdrop-filter: var(--mfc-glass-blur);
	border: 1px solid var(--mfc-border);
	border-radius: 999px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
	.mfc-navbar {
		border-radius: 22px;
		justify-content: center;
	}
}

.mfc-nav-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.mfc-nav-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--mfc-border);
	background: rgba(255, 255, 255, 0.05);
	color: var(--mfc-text-dim);
	cursor: pointer;
	transition: all var(--mfc-transition);
	flex-shrink: 0;
}

.mfc-nav-icon-btn:hover {
	background: var(--mfc-surface-hover);
	color: var(--mfc-text);
	border-color: rgba(255, 255, 255, 0.24);
	transform: translateY(-1px);
}

[dir='rtl'] .mfc-nav-back svg {
	transform: scaleX(-1);
}

.mfc-nav-categories {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	flex: 1 1 auto;
	justify-content: center;
}

.mfc-nav-pill {
	appearance: none;
	border: 1px solid transparent;
	background: rgba(255, 255, 255, 0.04);
	color: var(--mfc-text-dim);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 500;
	padding: 8px 16px;
	border-radius: 999px;
	cursor: pointer;
	transition: all var(--mfc-transition);
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.mfc-nav-pill:hover {
	background: var(--mfc-surface-hover);
	color: var(--mfc-text);
	border-color: rgba(255, 255, 255, 0.18);
}

.mfc-nav-pill.is-active {
	background: var(--mfc-metal);
	color: #14181d;
	font-weight: 700;
	box-shadow: 0 6px 18px rgba(143, 184, 201, 0.3);
}

.mfc-nav-search {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 1 220px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--mfc-border);
	border-radius: 999px;
	padding: 8px 14px;
	transition: border-color var(--mfc-transition), background var(--mfc-transition);
}

.mfc-nav-search:focus-within {
	background: rgba(255, 255, 255, 0.09);
	border-color: rgba(255, 255, 255, 0.28);
}

.mfc-nav-search-icon {
	flex-shrink: 0;
	color: var(--mfc-text-dim);
}

.mfc-search-input {
	appearance: none;
	border: none;
	outline: none;
	background: transparent;
	color: var(--mfc-text);
	font-family: inherit;
	font-size: 13px;
	width: 100%;
	min-width: 0;
}

.mfc-search-input::placeholder {
	color: var(--mfc-text-dim);
}

.mfc-search-input::-webkit-search-cancel-button {
	filter: invert(0.7);
}

/* ---------------- Body layout: subcategory sidebar + grid ---------------- */

.mfc-body {
	max-width: 1400px;
	margin: 0 auto;
	padding: 14px 28px 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.mfc-showcase:has(.mfc-subcats[data-has-content="1"]) .mfc-body {
	grid-template-columns: 220px minmax(0, 1fr);
}

[dir='rtl'] .mfc-showcase:has(.mfc-subcats[data-has-content="1"]) .mfc-body {
	direction: rtl;
}

@media (max-width: 860px) {
	.mfc-showcase:has(.mfc-subcats[data-has-content="1"]) .mfc-body {
		grid-template-columns: minmax(0, 1fr);
	}
}

.mfc-subcats {
	display: none;
}

.mfc-subcats[data-has-content="1"] {
	display: block;
	position: sticky;
	top: 76px;
}

@media (max-width: 860px) {
	.mfc-subcats[data-has-content="1"] {
		position: static;
	}
}

.mfc-subcats-inner {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--mfc-surface);
	border: 1px solid var(--mfc-border);
	border-radius: var(--mfc-radius);
	padding: 14px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

@media (max-width: 860px) {
	.mfc-subcats-inner {
		flex-direction: row;
		flex-wrap: wrap;
		overflow-x: auto;
	}
}

.mfc-subcats-title {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--mfc-text-dim);
	margin: 0 0 8px;
	padding: 0 8px;
}

@media (max-width: 860px) {
	.mfc-subcats-title {
		display: none;
	}
}

.mfc-subcat-btn {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 9px;
	border: none;
	background: transparent;
	color: var(--mfc-text-dim);
	font-family: inherit;
	font-size: 13px;
	text-align: start;
	padding: 9px 10px;
	border-radius: 10px;
	cursor: pointer;
	transition: all var(--mfc-transition);
	white-space: nowrap;
}

.mfc-subcat-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.5;
	flex-shrink: 0;
	transition: all var(--mfc-transition);
}

.mfc-subcat-btn:hover {
	background: var(--mfc-surface-hover);
	color: var(--mfc-text);
}

.mfc-subcat-btn.is-active {
	background: rgba(143, 184, 201, 0.14);
	color: var(--mfc-accent-strong);
	font-weight: 600;
}

.mfc-subcat-btn.is-active .mfc-subcat-dot {
	background: var(--mfc-accent-strong);
	opacity: 1;
	box-shadow: 0 0 0 3px rgba(143, 184, 201, 0.2);
}

/* ---------------- Grid ---------------- */

.mfc-grid-wrap {
	position: relative;
	min-height: 200px;
	padding-bottom: 40px;
}

.mfc-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
	transition: opacity 260ms ease;
}

.mfc-grid.is-loading {
	opacity: 0.25;
	pointer-events: none;
}

@media (max-width: 1100px) {
	.mfc-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 620px) {
	.mfc-grid {
		grid-template-columns: 1fr;
	}
	.mfc-body {
		padding: 12px 16px 0;
	}
}

.mfc-empty {
	text-align: center;
	color: var(--mfc-text-dim);
	padding: 60px 20px;
	font-size: 15px;
	grid-column: 1 / -1;
}

.mfc-card-hidden {
	display: none !important;
}

.mfc-grid.mfc-no-results::after {
	content: '';
}

/* Loader */
.mfc-loader {
	position: absolute;
	top: 40px;
	left: 50%;
	transform: translateX(-50%);
	display: none;
	gap: 6px;
	z-index: 5;
}

.mfc-loader.is-visible {
	display: flex;
}

.mfc-loader span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mfc-accent-strong);
	animation: mfc-bounce 900ms infinite ease-in-out;
}

.mfc-loader span:nth-child(2) {
	animation-delay: 120ms;
}

.mfc-loader span:nth-child(3) {
	animation-delay: 240ms;
}

@keyframes mfc-bounce {
	0%, 80%, 100% {
		transform: scale(0.6);
		opacity: 0.4;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* ---------------- Card — collapsed glass bar that opens into two drawers ---------------- */

.mfc-card {
	position: relative;
	background: var(--mfc-surface);
	border: 1px solid var(--mfc-border);
	border-radius: var(--mfc-radius);
	overflow: hidden;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	transform: translateY(36px);
	filter: blur(6px);
	transition-property: transform, box-shadow, border-color, opacity, filter;
	transition-duration: var(--mfc-transition), var(--mfc-transition), var(--mfc-transition), 700ms, 700ms;
	transition-delay: var(--mfc-delay, 0ms);
}

.mfc-card.mfc-in-view {
	opacity: 1;
	transform: translateY(0);
	filter: blur(0);
}

.mfc-card:hover,
.mfc-card:focus-within {
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
	border-color: rgba(255, 255, 255, 0.22);
}

/* Drawer 1: image — collapses to 0 height, slides open from the top on hover */
.mfc-card-media {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--mfc-drawer-transition);
}

.mfc-card-media-inner {
	overflow: hidden;
	min-height: 0;
}

.mfc-card-image {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	transform: scale(1.06);
	transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
	.mfc-card:hover .mfc-card-media,
	.mfc-card:focus-within .mfc-card-media {
		grid-template-rows: 1fr;
	}
	.mfc-card:hover .mfc-card-image,
	.mfc-card:focus-within .mfc-card-image {
		transform: scale(1);
	}
}

/* Always-visible glass bar with the product name */
.mfc-card-bar {
	position: relative;
	z-index: 2;
	width: 100%;
	appearance: none;
	border: none;
	background: var(--mfc-glass-bg);
	color: var(--mfc-text);
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 16px 20px;
	transition: background var(--mfc-transition);
}

.mfc-card:hover .mfc-card-bar,
.mfc-card:focus-within .mfc-card-bar {
	background: var(--mfc-glass-bg-strong);
}

.mfc-card-name {
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-align: start;
}

.mfc-card-chevrons {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
}

.mfc-card-chevrons i {
	display: block;
	width: 9px;
	height: 9px;
	border-inline-end: 2px solid var(--mfc-accent-strong);
	border-bottom: 2px solid var(--mfc-accent-strong);
	transform: rotate(45deg);
	opacity: 0.35;
	animation: mfc-chevron-bounce 1600ms ease-in-out infinite;
}

.mfc-card-chevrons i:nth-child(2) {
	animation-delay: 140ms;
}

.mfc-card-chevrons i:nth-child(3) {
	animation-delay: 280ms;
}

[dir='rtl'] .mfc-card-chevrons i,
[dir='ltr'] .mfc-card-chevrons i {
	transform: rotate(45deg);
}

@keyframes mfc-chevron-bounce {
	0%, 100% {
		opacity: 0.25;
		transform: rotate(45deg) translateY(-2px);
	}
	50% {
		opacity: 0.9;
		transform: rotate(45deg) translateY(2px);
	}
}

/* Drawer 2: short description — collapses to 0 height, slides open from the bottom on hover */
.mfc-card-desc {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--mfc-drawer-transition);
}

.mfc-card-desc-inner {
	overflow: hidden;
	min-height: 0;
}

.mfc-card-desc-inner p {
	margin: 0;
	padding: 4px 20px 18px;
	font-size: 13.5px;
	line-height: 1.65;
	color: var(--mfc-text-dim);
}

@media (hover: hover) {
	.mfc-card:hover .mfc-card-desc,
	.mfc-card:focus-within .mfc-card-desc {
		grid-template-rows: 1fr;
	}
}

/* Touch devices have no hover — keep the description reachable at a glance. */
@media (hover: none) {
	.mfc-card-desc {
		grid-template-rows: 1fr;
	}
}

/* ---------------- Modal ---------------- */

.mfc-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	visibility: hidden;
	opacity: 0;
	transition: opacity var(--mfc-transition), visibility var(--mfc-transition);
}

.mfc-modal.is-open {
	visibility: visible;
	opacity: 1;
}

.mfc-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 8, 10, 0.78);
	-webkit-backdrop-filter: blur(22px) saturate(140%);
	backdrop-filter: blur(22px) saturate(140%);
}

.mfc-modal-dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1040px;
	max-height: 88vh;
	overflow-y: auto;
	background: var(--mfc-bg-elevated);
	border: 1px solid var(--mfc-border);
	border-radius: 22px;
	box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
	transform: translateY(30px) scale(0.97);
	opacity: 0;
	transition: transform var(--mfc-transition), opacity var(--mfc-transition);
}

.mfc-modal.is-open .mfc-modal-dialog {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.mfc-modal-close {
	position: absolute;
	top: 18px;
	inset-inline-end: 18px;
	z-index: 3;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--mfc-border);
	background: rgba(255, 255, 255, 0.06);
	color: var(--mfc-text);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--mfc-transition), transform var(--mfc-transition);
}

.mfc-modal-close:hover {
	background: rgba(255, 255, 255, 0.16);
	transform: rotate(90deg);
}

.mfc-modal-body {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
}

@media (max-width: 780px) {
	.mfc-modal-body {
		grid-template-columns: 1fr;
	}
}

.mfc-modal-image {
	background-color: #14181d;
	background-size: cover;
	background-position: center;
	min-height: 320px;
	border-radius: 22px 0 0 22px;
}

@media (max-width: 780px) {
	.mfc-modal-image {
		border-radius: 22px 22px 0 0;
		min-height: 240px;
	}
}

[dir='rtl'] .mfc-modal-image {
	border-radius: 0 22px 22px 0;
}

@media (max-width: 780px) {
	[dir='rtl'] .mfc-modal-image {
		border-radius: 22px 22px 0 0;
	}
}

.mfc-modal-info {
	padding: 40px 40px 44px;
}

.mfc-modal-title {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
}

.mfc-modal-short {
	font-size: 15px;
	color: var(--mfc-text-dim);
	line-height: 1.7;
	margin: 0 0 26px;
	padding-bottom: 26px;
	border-bottom: 1px solid var(--mfc-border);
}

.mfc-modal-section {
	margin-bottom: 22px;
}

.mfc-modal-section:last-child {
	margin-bottom: 0;
}

.mfc-modal-section h4 {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--mfc-accent-strong);
	margin: 0 0 8px;
}

.mfc-modal-section-content {
	font-size: 14px;
	line-height: 1.75;
	color: var(--mfc-text);
}

.mfc-modal-section-content p:first-child {
	margin-top: 0;
}

.mfc-modal-section-content:empty {
	display: none;
}

.mfc-modal-section:has(.mfc-modal-section-content:empty) {
	display: none;
}

body.mfc-modal-open {
	overflow: hidden;
}
