/*
Theme Name: Bijan Child
Theme URI: https://www.rtl-theme.com/bijan-wordpress-theme/
Author: MohammadJafar Khajeh
Author URI: https://www.rtl-theme.com/author/ironatoms2/
Description: Child theme for Bijan
Version: 1.0.0.6
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: bijan-child
Template: bijan
*/

/* Mobile slide-out menu: keep the search visible and scroll only the menu. */
@media screen and (max-width: 1200px) {
	/* Keep the main header and bottom navigation in sync with side panels. */
	#header-container {
		transition: transform .24s ease, opacity .18s ease, visibility .24s ease;
	}

	body.mobile-menu-opened #header-container {
		visibility: hidden;
		opacity: 0;
		pointer-events: none;
		transform: translateY(calc(-100% - 12px)) !important;
	}

	/* Balanced mobile header: menu at inline-start, support at inline-end. */
	#header {
		min-height: 64px;
		box-sizing: border-box;
	}

	.clz-mobile-support {
		position: absolute;
		z-index: 3;
		inset-inline-end: 0;
		top: 50%;
		display: flex;
		align-items: center;
		gap: 7px;
		min-width: 46px;
		min-height: 46px;
		padding: 5px 7px;
		box-sizing: border-box;
		border: 1px solid color-mix(in srgb, var(--primary-100) 18%, transparent);
		border-radius: 15px;
		background: color-mix(in srgb, var(--primary-100) 8%, #fff);
		color: var(--primary-100);
		box-shadow: 0 6px 18px color-mix(in srgb, var(--primary-100) 12%, transparent);
		transform: translateY(-50%);
		transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
	}

	.clz-mobile-support:active {
		transform: translateY(-50%) scale(.94);
	}

	.clz-mobile-support:focus-visible {
		outline: 3px solid color-mix(in srgb, var(--primary-100) 22%, transparent);
		outline-offset: 2px;
	}

	.clz-mobile-support-icon {
		position: relative;
		display: grid;
		place-items: center;
		width: 32px;
		height: 32px;
		flex: 0 0 32px;
		border-radius: 11px;
		background: var(--primary-100);
		color: #fff;
	}

	.clz-mobile-support-icon svg {
		width: 21px;
		height: 21px;
		stroke: currentColor;
		stroke-width: 1.75;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.clz-mobile-support-status {
		position: absolute;
		top: -2px;
		inset-inline-end: -2px;
		width: 8px;
		height: 8px;
		border: 2px solid #fff;
		border-radius: 50%;
		background: #22c55e;
		box-shadow: 0 0 0 2px rgba(34, 197, 94, .12);
	}

	.clz-mobile-support-label {
		padding-inline-end: 2px;
		font-size: .72rem;
		font-weight: 750;
		line-height: 1.3;
		white-space: nowrap;
	}

	#mobile-menu-container.mobile-menu-container {
		top: 0;
		bottom: 0;
		left: auto;
		right: 0;
		width: min(88vw, 380px);
		height: 100dvh;
		padding: 0;
		gap: 0;
		border-radius: 0;
		border-inline-start: 1px solid rgba(0, 0, 0, 0.06);
		overflow: hidden;
		box-shadow: -12px 0 36px rgba(0, 0, 0, 0.16);
	}

	html[dir="ltr"] #mobile-menu-container.mobile-menu-container {
		left: 0;
		right: auto;
	}

	#mobile-menu-container .mobile-menu-panel-title {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		min-height: 64px;
		padding: env(safe-area-inset-top) 20px 0;
		box-sizing: border-box;
		border-bottom: 1px solid var(--gray-500);
		color: var(--text-100);
		font-size: 1rem;
		font-weight: 700;
	}

	#mobile-menu-container .mobile-menu-search-wrap {
		position: relative;
		z-index: 2;
		flex: 0 0 auto;
		padding: 16px 20px;
		border-bottom: 1px solid var(--gray-500);
		background: #fff;
	}

	#mobile-menu-container .mobile-menu-search-wrap .bijan-search {
		width: 100%;
		min-width: 0;
	}

	#mobile-menu-container .mobile-menu-search-wrap .bijan-search-results,
	#mobile-menu-container .mobile-menu-search-wrap .loading-wrap {
		max-height: min(320px, 45dvh);
	}

	#mobile-menu-container .mobile-menu-scroll {
		flex: 1 1 auto;
		min-height: 0;
		padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	#mobile-menu-container .mobile-menu-wrap ul {
		gap: 4px;
	}

	#mobile-menu-container .mobile-menu-wrap + .mobile-menu-wrap {
		margin-top: 16px;
		padding-top: 16px;
	}

	#mobile-menu-container .mobile-menu-wrap a {
		min-height: 48px;
		padding: 10px 12px;
		box-sizing: border-box;
		border-radius: 12px;
		font-size: .9375rem;
		font-weight: 500;
	}

	#mobile-menu-container .mobile-menu-wrap > .menu > li > a {
		background: #f8f9fb;
	}

	#mobile-menu-container .mobile-menu-wrap li.menu-item-has-children > a::after {
		font-size: .875rem;
	}

	#mobile-menu-container .mobile-menu-wrap ul ul {
		margin: 4px 8px 8px;
		padding-inline-start: 16px;
		border-inline-start: 2px solid var(--gray-500);
	}

	#mobile-menu-container .mobile-menu-wrap ul ul a {
		min-height: 42px;
		padding-block: 8px;
		background: transparent;
		font-size: .875rem;
	}

	#mobile-menu-container .mobile-menu-wrap li.megamenu-wrap {
		margin-inline-start: 0;
	}

	#mobile-menu-container .mobile-menu-wrap li.megamenu-wrap > ul {
		padding-inline-start: 24px;
	}
}

@media screen and (max-width: 420px) {
	.clz-mobile-support {
		width: 46px;
		padding: 6px;
		justify-content: center;
	}

	.clz-mobile-support-label {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	#header-container,
	.clz-mobile-support {
		transition: none;
	}
}

/*
 * Sale prices need two lines on narrow product cards. The parent theme keeps
 * the style-1 card footer at 46px, which lets that second line overflow into
 * the following card on phones.
 */
@media screen and (max-width: 767px) {
	.products .product-bottom .price:has(del) {
		display: grid;
		gap: 2px;
		justify-items: center;
		line-height: 1.35;
	}

	.products .product-bottom .price:has(del) del,
	.products .product-bottom .price:has(del) ins {
		display: block;
		min-width: 0;
	}

	.products-style-1 .product:has(.product-bottom .price del) .product-bottom {
		height: auto;
		min-height: 80px;
	}

	.products-style-1 .product:has(.product-bottom .price del) .shape-curve {
		bottom: 88px;
	}
}
