/**
 * Derang — single product mobile polish (layout value-4 / detail-product-four).
 * Spacing, sticky action bar, offer badge, gallery surface.
 */

@media (max-width: 991.98px) {
	/*
	 * Product has its own sticky bar — keep only the hamburger (menu host)
	 * so the mobile menu still opens without a full duplicate header.
	 */
	body.single-product .derang-mobile-header {
		justify-content: flex-start !important;
		margin-top: 12px !important;
		margin-bottom: 0 !important;
		z-index: 70;
	}

	body.single-product .derang-mobile-header > .flex,
	body.single-product .derang-mobile-header > a {
		display: none !important;
	}

	/* ── Sticky product action bar ── */
	body.single-product .detail-product-four-header {
		position: sticky;
		top: 0;
		z-index: 60;
		padding: 10px 0 8px;
		margin: 0;
		background: linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.96) 55%,
			rgba(255, 255, 255, 0.72) 100%
		);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
	}

	body.single-product .detail-product-four-header .container {
		padding-inline: 14px;
	}

	body.single-product .detail-product-four-header .back-home {
		gap: 8px !important;
	}

	body.single-product .detail-product-four-header .back-home li a {
		width: 40px;
		height: 40px;
		border: 1px solid #eeebe6;
		box-shadow: 0 6px 18px rgba(16, 17, 14, 0.08);
		color: #10110e;
		background: #fff;
		transition: transform 0.2s ease, box-shadow 0.2s ease;
	}

	body.single-product .detail-product-four-header .back-home li a:active {
		transform: scale(0.96);
	}

	body.single-product .detail-product-four-header .icons-detail-product > button {
		width: 40px;
		height: 40px;
		background-color: #95b193;
		box-shadow: 0 6px 16px rgba(149, 177, 147, 0.35);
		font-size: 11px;
		letter-spacing: 0.5px;
	}

	body.single-product .detail-product-four-header .icons-detail-product ul {
		height: 40px;
		padding: 0 12px;
		background-color: #10110e;
		border-radius: 999px;
		box-shadow: 0 8px 22px rgba(16, 17, 14, 0.22);
	}

	body.single-product .detail-product-four-header .icons-detail-product ul li {
		font-size: 17px;
		line-height: 1;
	}

	/* ── Section top rhythm ── */
	body.single-product .detail-product-four > .container {
		padding-top: 4px;
	}

	/* ── Breadcrumb (match site-wide 14px) ── */
	body.single-product .detail-product-four .breadcrumb-nk {
		margin: 2px 0 10px !important;
		padding: 0 2px;
	}

	body.single-product .detail-product-four .breadcrumb-nk > ul > li {
		font-size: 14px;
		line-height: 20px;
		font-weight: 500;
		color: rgba(0, 0, 0, 0.48);
	}

	body.single-product .detail-product-four .breadcrumb-nk > ul > li a {
		color: #000;
	}

	body.single-product .detail-product-four .breadcrumb-nk > ul > li:last-child,
	body.single-product .detail-product-four .breadcrumb-nk > ul > li:last-child a {
		color: #10110e;
	}

	body.single-product .detail-product-four .breadcrumb-nk > ul > li:not(:last-child)::after {
		margin: 0 8px;
		color: rgba(0, 0, 0, 0.3);
	}

	/* ── Amazing offer ── */
	body.single-product .detail-product-four .timear-proposal {
		margin: 0 0 12px;
		min-height: 0;
		gap: 10px;
	}

	body.single-product .detail-product-four .timear-proposal .proposal {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		margin: 0;
		padding: 6px 12px;
		font-size: 12px;
		font-weight: 600;
		line-height: 1.2;
		color: #2f4a31;
		background: linear-gradient(135deg, #eef4ee 0%, #f6f8f4 100%);
		border: 1px solid rgba(149, 177, 147, 0.45);
		border-radius: 999px;
		box-shadow: 0 4px 12px rgba(149, 177, 147, 0.12);
	}

	body.single-product .detail-product-four .timear-proposal .proposal::before {
		content: "";
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: #95b193;
		box-shadow: 0 0 0 3px rgba(149, 177, 147, 0.25);
		flex-shrink: 0;
	}

	/* Empty offer row (no sale) — collapse leftover space */
	body.single-product .detail-product-four .timear-proposal:not(:has(.proposal)):not(:has(.timear-detail-product)) {
		display: none !important;
	}

	/*
	 * Gallery — clean, simple, light
	 */
	body.single-product .detail-product-four-gallery {
		margin: 0 0 16px;
	}

	body.single-product .detail-product-four-gallery-origin {
		padding: 0 !important;
		margin: 0;
		overflow: hidden;
		border-radius: 20px;
		border: 1px solid #eeeef0;
		background: #f6f6f4;
		box-shadow: none;
	}

	body.single-product .detail-product-four-gallery-origin::before,
	body.single-product .detail-product-four-gallery-origin::after {
		content: none !important;
		display: none !important;
	}

	body.single-product .detail-product-four-gallery-origin .swiper,
	body.single-product .detail-product-four-gallery-origin .woocommerce-product-gallery {
		border-radius: 20px;
		overflow: hidden;
		background: transparent !important;
	}

	body.single-product .detail-product-four-gallery-origin .swiper-slide {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 300px;
		padding: 20px 16px 36px;
		box-sizing: border-box;
		background: transparent;
	}

	body.single-product .detail-product-four-gallery-origin .swiper-slide > div,
	body.single-product .detail-product-four-gallery-origin .woocommerce-product-gallery__image,
	body.single-product .detail-product-four-gallery-origin .woocommerce-product-gallery__wrapper {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		background: transparent !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	body.single-product .detail-product-four-gallery-origin .swiper-slide img,
	body.single-product .detail-product-four-gallery-origin .detail4-img,
	body.single-product .detail-product-four-gallery-origin .wp-post-image {
		width: auto !important;
		max-width: 82% !important;
		max-height: 320px !important;
		height: auto !important;
		margin: 0 auto;
		object-fit: contain;
		border-radius: 0 !important;
		filter: drop-shadow(0 10px 22px rgba(16, 17, 14, 0.1));
	}

	body.single-product .detail-product-four-gallery-origin .swiper-button-next,
	body.single-product .detail-product-four-gallery-origin .swiper-button-prev {
		display: none !important;
	}

	body.single-product .swiper-detail-product-four-gallery .swiper-pagination.gall4,
	body.single-product .swiper-detail-product-four-gallery .swiper-pagination {
		bottom: 12px !important;
		left: 50% !important;
		right: auto !important;
		width: auto !important;
		min-width: 0;
		max-width: none;
		padding: 0;
		transform: translateX(-50%) !important;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 6px;
		background: transparent !important;
		border: 0;
		border-radius: 0;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		box-shadow: none;
	}

	body.single-product .swiper-detail-product-four-gallery .swiper-pagination-bullet {
		width: 6px;
		height: 6px;
		margin: 0 !important;
		opacity: 1;
		background: #d5d5d0;
		border-radius: 999px;
		transition: width 0.25s ease, background 0.25s ease;
	}

	body.single-product .swiper-detail-product-four-gallery .swiper-pagination-bullet-active {
		width: 16px;
		background: #95b193;
	}

	body.single-product .detail-product-four-gallery .woocommerce-product-gallery {
		opacity: 1 !important;
	}
}

@media (max-width: 575.98px) {
	body.single-product .detail-product-four-gallery-origin .swiper-slide {
		min-height: 280px;
		padding: 16px 12px 32px;
	}

	body.single-product .detail-product-four-gallery-origin .swiper-slide img,
	body.single-product .detail-product-four-gallery-origin .detail4-img,
	body.single-product .detail-product-four-gallery-origin .wp-post-image {
		max-width: 88% !important;
		max-height: 300px !important;
	}
}

/* ── Sticky bottom bar: price + qty + cart ── */
@media (max-width: 991.98px) {
	body.single-product .detail-product-four-bottom {
		right: 12px;
		left: 12px;
		bottom: 12px;
		min-height: 64px;
		padding: 10px 12px;
		border-radius: 16px;
		border: 1px solid #ecece8;
		background: #fff !important;
		box-shadow: 0 10px 28px rgba(16, 17, 14, 0.1) !important;
		pointer-events: none;
	}

	/*
	 * Price — amount stack + currency beside it.
	 *   ۳۰۰,۰۰۰
	 *   ۲۹۵,۰۰۰  تومان
	 */
	body.single-product .detailfourprice .price {
		position: fixed !important;
		left: 26px !important;
		right: auto !important;
		bottom: 22px !important;
		top: auto !important;
		transform: none !important;
		z-index: 16;
		display: block !important;
		width: auto !important;
		max-width: 46%;
		margin: 0 !important;
		padding: 0 !important;
		line-height: 1.2;
		font-weight: 400;
		color: #10110e;
		background: transparent !important;
	}

	body.single-product .detailfourprice .price .screen-reader-text {
		display: none !important;
	}

	body.single-product .detailfourprice .main-product-price,
	body.single-product .detailfourprice .derang-sp,
	body.single-product .detailfourprice .main-product-price.derang-sp {
		display: block !important;
		width: auto !important;
		margin: 0;
		padding: 0;
	}

	body.single-product .detailfourprice .main-product-price > .price,
	body.single-product .detailfourprice .price > span.price {
		display: block !important;
		margin: 0;
	}

	body.single-product .detailfourprice .derang-sp__row {
		display: inline-flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: flex-end !important;
		gap: 6px;
		margin: 0;
		padding: 0;
		white-space: nowrap;
	}

	body.single-product .detailfourprice .derang-sp__stack {
		display: inline-flex !important;
		flex-direction: column !important;
		align-items: flex-end !important; /* RTL: numbers stack on the right (reading start) */
		justify-content: flex-end;
		gap: 3px;
		margin: 0;
		padding: 0;
	}

	body.single-product .detailfourprice .derang-sp__old,
	body.single-product .detailfourprice .price del,
	body.single-product .detailfourprice .price del .woocommerce-Price-amount,
	body.single-product .detailfourprice .price del bdi {
		display: block !important;
		margin: 0 !important;
		padding: 0 !important;
		font-size: 14px !important;
		font-weight: 500 !important;
		line-height: 1.2 !important;
		letter-spacing: 0.01em;
		color: #a8a8a2 !important;
		text-decoration: line-through !important;
		text-decoration-color: #c0c0ba !important;
		background: transparent !important;
		text-align: end;
	}

	body.single-product .detailfourprice .price del .woocommerce-Price-currencySymbol,
	body.single-product .detailfourprice .derang-sp__old .woocommerce-Price-currencySymbol {
		display: none !important;
	}

	body.single-product .detailfourprice .price ins {
		display: block !important;
		margin: 0 !important;
		padding: 0 !important;
		background: transparent !important;
		text-decoration: none !important;
	}

	body.single-product .detailfourprice .derang-sp__from {
		display: block !important;
		margin: 0;
		font-size: 10px !important;
		font-weight: 500 !important;
		line-height: 1.2 !important;
		color: #8a8a84 !important;
		text-align: end;
	}

	body.single-product .detailfourprice .kaveh-price-from {
		display: none !important;
	}

	body.single-product .detailfourprice .derang-sp__new,
	body.single-product .detailfourprice .price ins .woocommerce-Price-amount,
	body.single-product .detailfourprice .price ins bdi,
	body.single-product .detailfourprice .main-product-price > .woocommerce-Price-amount,
	body.single-product .detailfourprice .main-product-price > .woocommerce-Price-amount bdi,
	body.single-product .detailfourprice span.woocommerce-Price-amount.amount {
		display: block !important;
		margin: 0 !important;
		font-size: 20px !important;
		font-weight: 700 !important;
		line-height: 1.15 !important;
		color: #10110e !important;
		letter-spacing: -0.02em;
		text-align: end;
	}

	body.single-product .detailfourprice .derang-sp__cur,
	body.single-product .detailfourprice .price .woocommerce-Price-currencySymbol,
	body.single-product .detailfourprice .price ins .woocommerce-Price-currencySymbol {
		display: inline-block !important;
		margin: 0 0 1px !important;
		padding: 0 !important;
		font-size: 11px !important;
		font-weight: 500 !important;
		line-height: 1.15 !important;
		color: #7a7a74 !important;
		vertical-align: baseline;
		align-self: flex-end;
		padding-bottom: 1px !important;
	}

	/* Cart / qty — same bottom band as price */
	body.single-product .det4simple form.cart,
	body.single-product .detailfouradd .woocommerce-variation-add-to-cart {
		position: fixed !important;
		right: 26px !important;
		left: auto !important;
		bottom: 24px !important;
		top: auto !important;
		transform: none !important;
		z-index: 16;
		display: flex !important;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		gap: 8px;
		margin: 0 !important;
		font-size: 13px;
	}

	body.single-product .detailfouradd .quantity,
	body.single-product .det4simple .quantity,
	body.single-product .detail-product-four-bottom .quantity {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: space-evenly;
		align-self: center !important;
		width: 96px !important;
		min-width: 96px;
		height: 40px !important;
		margin: 0 !important;
		padding: 0 4px !important;
		border: 1px solid #e4e4de !important;
		border-radius: 12px !important;
		background: #fafaf8;
		box-shadow: none !important;
		overflow: visible;
		position: relative !important;
		top: 0 !important;
	}

	body.single-product .detailfouradd .quantity .screen-reader-text,
	body.single-product .det4simple .quantity .screen-reader-text {
		display: none !important;
	}

	body.single-product .detailfouradd .quantity .input-text.qty.text,
	body.single-product .det4simple .quantity .input-text.qty.text,
	body.single-product .detail-product-four-bottom .quantity input {
		display: block !important;
		width: 28px !important;
		min-width: 28px;
		height: 40px !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
		text-align: center !important;
		font-size: 14px !important;
		font-weight: 600 !important;
		line-height: 40px !important;
		color: #10110e !important;
		position: relative !important;
		top: 0 !important;
		/* optical align Persian digits with SVG icons */
		transform: translateY(1px);
		-moz-appearance: textfield;
	}

	body.single-product .detailfouradd .quantity .input-text.qty.text::-webkit-outer-spin-button,
	body.single-product .detailfouradd .quantity .input-text.qty.text::-webkit-inner-spin-button,
	body.single-product .det4simple .quantity .input-text.qty.text::-webkit-outer-spin-button,
	body.single-product .det4simple .quantity .input-text.qty.text::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}

	body.single-product .detailfouradd .quantity .kminus-button,
	body.single-product .detailfouradd .quantity .kplus-button,
	body.single-product .det4simple .quantity .kminus-button,
	body.single-product .det4simple .quantity .kplus-button {
		display: block !important;
		flex: 0 0 32px;
		width: 32px !important;
		height: 40px !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 8px;
		box-shadow: none !important;
		color: transparent !important;
		font-size: 0 !important;
		line-height: 0 !important;
		text-indent: -999px;
		overflow: hidden;
		position: relative !important;
		top: 0 !important;
		cursor: pointer;
		appearance: none;
		-webkit-appearance: none;
		background-color: transparent !important;
		background-repeat: no-repeat !important;
		background-position: center center !important;
		background-size: 12px 12px !important;
	}

	body.single-product .detailfouradd .quantity .kminus-button,
	body.single-product .det4simple .quantity .kminus-button {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Crect x='1' y='5.25' width='10' height='1.5' rx='0.75' fill='%2310110E'/%3E%3C/svg%3E") !important;
	}

	body.single-product .detailfouradd .quantity .kplus-button,
	body.single-product .det4simple .quantity .kplus-button {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Crect x='1' y='5.25' width='10' height='1.5' rx='0.75' fill='%2310110E'/%3E%3Crect x='5.25' y='1' width='1.5' height='10' rx='0.75' fill='%2310110E'/%3E%3C/svg%3E") !important;
	}

	body.single-product .detailfouradd .quantity .kminus-button::before,
	body.single-product .detailfouradd .quantity .kminus-button::after,
	body.single-product .detailfouradd .quantity .kplus-button::before,
	body.single-product .detailfouradd .quantity .kplus-button::after,
	body.single-product .det4simple .quantity .kminus-button::before,
	body.single-product .det4simple .quantity .kminus-button::after,
	body.single-product .det4simple .quantity .kplus-button::before,
	body.single-product .det4simple .quantity .kplus-button::after {
		content: none !important;
		display: none !important;
	}

	body.single-product .detailfouradd .single_add_to_cart_button,
	body.single-product .det4simple .single_add_to_cart_button,
	body.single-product .detailfouradd button.button.alt,
	body.single-product .detail-product-four-bottom .btn,
	body.single-product .woocommerce button.single_add_to_cart_button.button.alt {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		align-self: center !important;
		flex: 0 1 auto;
		width: auto !important;
		height: 40px !important;
		min-height: 40px !important;
		max-height: 40px !important;
		margin: 0 !important;
		padding: 0 14px !important;
		border: 0 !important;
		border-radius: 12px !important;
		background: #95b193 !important;
		color: #fff !important;
		font-size: 12px !important;
		font-weight: 600 !important;
		line-height: 1 !important;
		white-space: nowrap;
		box-shadow: none !important;
		position: relative !important;
		top: 0 !important;
		transform: none !important;
	}

	body.single-product .detailfouradd .single_add_to_cart_button:hover,
	body.single-product .det4simple .single_add_to_cart_button:hover,
	body.single-product .detailfouradd button.button.alt:hover {
		background: #7d937a !important;
	}

	/*
	 * Variations card — collapse empty shells left when price / ATC are
	 * fixed into the sticky bottom bar (was leaving a large white gap).
	 */
	body.single-product .detail-product-four-sidebar {
		padding: 18px 16px 16px !important;
	}

	body.single-product .detailfouradd table.variations,
	body.single-product .variations_form > table.variations,
	body.single-product.woo-variation-swatches table.variations {
		margin-top: 16px !important;
		margin-bottom: 0 !important;
	}

	body.single-product .detailfouradd .single_variation_wrap {
		margin: 0 !important;
		padding: 0 !important;
		min-height: 0 !important;
		border: 0 !important;
	}

	body.single-product .detailfouradd .woocommerce-variation.single_variation:empty {
		display: none !important;
		margin: 0 !important;
		padding: 0 !important;
		min-height: 0 !important;
	}

	body.single-product .detailfourprice {
		margin: 0 !important;
		padding: 0 !important;
		min-height: 0 !important;
		height: 0 !important;
		overflow: visible !important;
		border: 0 !important;
	}

	body.single-product .detailfouradd .variations_form a.reset_variations {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}
}

@media (max-width: 399.98px) {
	body.single-product .detailfourprice .price {
		left: 20px !important;
		bottom: 22px !important;
		max-width: 38%;
	}

	body.single-product .detailfourprice .derang-sp__old {
		font-size: 14px !important;
	}

	body.single-product .detailfourprice .derang-sp__new,
	body.single-product .detailfourprice .price ins .woocommerce-Price-amount,
	body.single-product .detailfourprice span.woocommerce-Price-amount.amount {
		font-size: 14px !important;
	}

	body.single-product .det4simple form.cart,
	body.single-product .detailfouradd .woocommerce-variation-add-to-cart {
		right: 18px !important;
		bottom: 22px !important;
		gap: 6px;
	}

	body.single-product .detailfouradd .quantity,
	body.single-product .det4simple .quantity {
		width: 96px !important;
		min-width: 96px;
		height: 40px !important;
	}

	body.single-product .detailfouradd .single_add_to_cart_button,
	body.single-product .det4simple .single_add_to_cart_button,
	body.single-product .detailfouradd button.button.alt,
	body.single-product .woocommerce button.single_add_to_cart_button.button.alt {
		padding: 0 10px !important;
		font-size: 11px !important;
		height: 40px !important;
		min-height: 40px !important;
		max-height: 40px !important;
		top: 0 !important;
	}
}

