/* رویا رایانه – صحنه‌ی اسکرولی صفحه‌ی اصلی + نمایش محصول.
   حالت پایه (ایستا) همیشه کار می‌کند: بدون جاوااسکریپت، داخل ویرایشگر، یا با «کاهش حرکت».
   وقتی اسکریپت کلاس is-live را اضافه کند، همین بلوک‌ها با اسکرول جلوه می‌گیرند. */

/* ============ حالت ایستا ============ */
.rr-scene, .rr-stage { margin: 0; position: relative; }
.rr-scene > *, .rr-stage > * { margin-block: 0; }

.rr-frame {
	position: relative; overflow: hidden; color: #fff;
	min-height: min(88svh, 780px); padding-top: var(--rr-hh, 90px);
	background: radial-gradient(60% 65% at 50% 48%, #17399a 0%, #0b1f55 48%, #050d22 100%);
}
.rr-frame > * { margin: 0; }
.rr-shot { margin: 0; }
.rr-shot--rear, .rr-shot--side { display: none; }
.rr-shot--hero { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 4%; }
.rr-shot--hero img { width: min(84%, 1080px); height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); }

.rr-hero-copy { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.rr-hero-copy > * { margin: 0; }
.rr-pill { position: absolute; inset-inline-start: 4%; top: 44%; display: inline-block; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .75rem; color: #fff; }
.rr-hero-copy__p { position: absolute; inset-inline-start: 4%; top: calc(44% + 46px); max-width: min(300px, 40%); font-size: .9375rem; line-height: 1.9; color: #e8edf8; }
.rr-hl { position: absolute; inset-inline-end: 3%; bottom: 6%; display: flex; align-items: flex-end; gap: .45em; }
.rr-hl > * { margin: 0; }
.rr-hl__dim { font-size: clamp(2rem, 6vw, 5.5rem); line-height: 1.2; font-weight: 700; color: rgba(255, 255, 255, .42); }
.rr-hl h1 { font-size: clamp(2rem, 6vw, 5.5rem); line-height: 1.2; font-weight: 700; color: #fff; }
.rr-scrollhint { position: absolute; inset-inline-start: 4%; bottom: 6%; font-size: .8125rem; color: #fff; }

.rr-about { display: grid; gap: 22px; width: min(1100px, 92%); margin: 0 auto !important; padding: 64px 0 32px; }
.rr-about h2 { font-size: clamp(1.5rem, 3.6vw, 2.6rem); line-height: 1.6; font-weight: 600; }
.rr-about > * { margin: 0; }
.rr-brands { overflow: hidden; padding: 16px 0; border-block: 1px solid var(--wp--preset--color--border); }
.rr-brands__track { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 44px; }
.rr-brands__track > * { margin: 0; font-size: .875rem; color: var(--wp--preset--color--silver-dark); }
.rr-brands__track.is-marquee { flex-wrap: nowrap; justify-content: flex-start; width: max-content; direction: ltr; animation: rr-marquee 28s linear infinite; }
@keyframes rr-marquee { to { transform: translateX(-50%); } }

.rr-fleet { padding: 56px 0 24px; }
.rr-fleet > * { margin: 0; }
.rr-fleet h2 { width: min(92%, 860px); margin: 0 auto 24px; font-size: clamp(1.4rem, 3.2vw, 2.4rem); line-height: 1.7; font-weight: 600; }
.rr-cars { display: flex; gap: 2vw; overflow-x: auto; padding: 12px 4%; scrollbar-width: none; direction: ltr; }
.rr-cars::-webkit-scrollbar { display: none; }
.rr-cars > * { margin: 0; }
.rr-car { flex: none; width: clamp(240px, 30vw, 460px); margin: 0; }
.rr-car img { width: 100%; height: auto; display: block; }

/* خوانایی متن هیرو: همیشه سفید روی سرمه‌ای، با سایه‌ی تیره‌ی پایین قاب */
.rr-scene .rr-frame .rr-hl h1.wp-block-heading, .rr-scene .rr-frame .rr-pill, .rr-scene .rr-frame .rr-scrollhint { color: #fff !important; }
.rr-scene .rr-frame .rr-hero-copy__p { color: #e8edf8 !important; }
.rr-scene .rr-frame .rr-hl__dim { color: rgba(255, 255, 255, .62) !important; }
.rr-scene .rr-frame .rr-hl, .rr-scene .rr-frame .rr-hero-copy__p, .rr-scene .rr-frame .rr-scrollhint { text-shadow: 0 2px 14px rgba(3, 8, 22, .75); }
.rr-frame::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46%; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(3, 8, 22, .85), rgba(3, 8, 22, 0)); }
.rr-scene.is-live .rr-frame::after { opacity: calc(1 - var(--s1)); }

/* ============ حالت زنده (با اسکرول) ============ */
.rr-scene.is-live {
	--p: 0;
	--s1: clamp(0, calc((var(--p) - .02) / .16), 1);
	--s2: clamp(0, calc((var(--p) - .05) / .20), 1);
	--k: calc(var(--s2) * var(--s2) * (3 - 2 * var(--s2)));
	--s3: clamp(0, calc((var(--p) - .12) / .10), 1);
	--s4: clamp(0, calc((var(--p) - .24) / .10), 1);
	--s5: clamp(0, calc((var(--p) - .33) / .06), 1);
	--s6: clamp(0, calc((var(--p) - .46) / .12), 1);
	--m: calc(var(--s6) * var(--s6) * (3 - 2 * var(--s6)));
	--s7: clamp(0, calc((var(--p) - .56) / .08), 1);
	--s7o: clamp(0, calc((var(--p) - .52) / .06), 1);
	--s8: clamp(0, calc((var(--p) - .88) / .10), 1);
	--rowx: calc((.56 - var(--p)) * 28vw * (1 - var(--s8)));
	--top: calc(var(--rr-hh, 90px) + 14px);
	height: 620vh;
}
.rr-scene.is-live .rr-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--wp--preset--color--surface); }

/* کارت (قاب) : تمام‌صفحه ← کارت کنار ← کارت کوچک پایین ← محو */
.rr-scene.is-live .rr-frame {
	position: absolute; min-height: 0; padding-top: 0;
	width: calc(100% - var(--k) * 56% - var(--m) * 30%);
	height: calc(100% - var(--k) * 44% - var(--m) * 36%);
	inset-block-start: calc(var(--k) * var(--top) + var(--m) * 60%);
	inset-inline-start: calc(var(--k) * 4% + var(--m) * 39%);
	border-radius: calc(var(--k) * 26px);
	opacity: calc(1 - var(--s7o));
	will-change: width, height, inset-block-start, inset-inline-start;
}
.rr-scene.is-live .rr-shot { position: absolute; inset: 0; padding: 0; display: block; }
.rr-scene.is-live .rr-shot img { width: 100%; height: 100%; object-fit: contain; filter: none; }
.rr-scene.is-live .rr-shot--hero { display: grid; place-items: center; opacity: calc(1 - var(--s3)); }
.rr-scene.is-live .rr-shot--hero img {
	width: min(88%, 1100px); height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45));
	transform: perspective(1600px) rotateY(calc(-16deg * (1 - var(--s2)))) rotateX(calc(6deg * (1 - var(--s2)))) scale(calc(1.06 - .06 * var(--s2)));
}
.rr-scene.is-live .rr-shot--rear { opacity: calc(var(--s3) * (1 - var(--s4))); }
.rr-scene.is-live .rr-shot--rear img { object-fit: cover; }
.rr-scene.is-live .rr-shot--side { display: grid; place-items: center; opacity: var(--s4); }
.rr-scene.is-live .rr-shot--side img { width: 92%; height: auto; }

.rr-scene.is-live .rr-hero-copy { opacity: calc(1 - var(--s1) * 1.3); filter: blur(calc(var(--s1) * 12px)); }

/* متن «درباره» */
.rr-scene.is-live .rr-about {
	position: absolute; inset-inline-end: 4%; inset-block-start: var(--top); width: 44%; height: 56%; margin: 0 !important; padding: 0;
	display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
	opacity: calc(var(--s2) * (1 - var(--s6))); filter: blur(calc(var(--s6) * 10px)); pointer-events: none;
}
.rr-scene.is-live .rr-about h2 { font-size: clamp(1.4rem, 2.7vw, 2.6rem); }
.rr-scene.is-live .rr-about__btn { opacity: var(--s5); pointer-events: auto; }
.rr-scene.is-live .rr-brands { position: absolute; inset-inline: 0; bottom: 6%; border: 0; opacity: calc(var(--s5) * (1 - var(--s6))); }

/* ماشین‌ها */
.rr-scene.is-live .rr-fleet { position: absolute; inset: 0; padding: 0; opacity: var(--s7); pointer-events: none; }
.rr-scene.is-live .rr-fleet h2 {
	position: absolute; inset-inline: 0; inset-block-start: calc(var(--rr-hh, 90px) + 4vh); margin: 0 auto;
	opacity: calc(1 - var(--s8)); filter: blur(calc(var(--s8) * 12px));
}
.rr-scene.is-live .rr-cars {
	position: absolute; left: 50%; bottom: 7%; overflow: visible; padding: 0; gap: 2vw; align-items: flex-end;
	transform: translateX(calc(-50% + var(--rowx)));
}
.rr-scene.is-live .rr-car { opacity: calc(1 - var(--s8) * 1.4); }
.rr-scene.is-live .rr-car--c { opacity: 1; position: relative; z-index: 2; transform: scale(calc(1 + var(--s8) * 1.5)); transform-origin: 50% 100%; }

/* کلمه‌به‌کلمه (اسکریپت کلمه‌ها را می‌سازد) */
.rr-about .rr-reveal { --w0: .17; --wd: .010; --wl: .05; }
.rr-fleet .rr-reveal { --w0: .58; --wd: .0085; --wl: .05; }
.rr-w { display: inline-block; --r: clamp(0, calc((var(--p) - var(--w0) - var(--i) * var(--wd)) / var(--wl)), 1); opacity: calc(.14 + .86 * var(--r)); transform: translateY(calc((1 - var(--r)) * .4em)); }
@media (min-width: 1024px) { .rr-w { filter: blur(calc((1 - var(--r)) * 5px)); } }

/* ============ موبایل و تبلت ============ */
@media (max-width: 1023.98px) {
	.rr-pill { top: 36%; }
	.rr-hero-copy__p { top: calc(36% + 46px); max-width: 62%; font-size: .875rem; }
	.rr-hl { flex-direction: column; align-items: flex-end; gap: 0; bottom: 128px; }
	.rr-hl__dim, .rr-hl h1 { font-size: clamp(2rem, 11vw, 3.6rem); }
	.rr-scrollhint { bottom: 100px; }
	.rr-scene.is-live { height: 520vh; }
}
@media (max-width: 781.98px) {
	.rr-scene.is-live .rr-frame {
		width: calc(100% - var(--k) * 12% - var(--m) * 58%);
		height: calc(100% - var(--k) * 66% - var(--m) * 22%);
		inset-block-start: calc(var(--k) * var(--top) + var(--m) * 52%);
		inset-inline-start: calc(var(--k) * 6% + var(--m) * 29%);
		border-radius: calc(var(--k) * 20px);
	}
	.rr-scene.is-live .rr-about { inset-inline: 6%; width: auto; height: auto; inset-block-start: calc(var(--top) + 34% + 14px); gap: 14px; }
	.rr-scene.is-live .rr-about h2 { font-size: 1.2rem; line-height: 1.8; }
	.rr-scene.is-live .rr-brands { bottom: 104px; }
	.rr-scene.is-live .rr-fleet h2 { font-size: 1.25rem; width: 90%; }
	.rr-scene.is-live .rr-cars { bottom: 120px; }
	.rr-car { width: 62vw; }
	.rr-fleet h2 { font-size: 1.25rem; }
}

/* ============ نمایش محصول (مثل نوار کنترل ماشین در گیف) ============ */
.rr-showcase { position: relative; }
.rr-showcase > * { margin-block: 0; }
.rr-showcase .wc-block-product-template, .rr-showcase .wp-block-woocommerce-product-template {
	display: flex !important; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0 !important; margin: 0; padding: 0; list-style: none;
}
.rr-showcase .wc-block-product-template::-webkit-scrollbar, .rr-showcase .wp-block-woocommerce-product-template::-webkit-scrollbar { display: none; }
.rr-showcase .wc-block-product-template > li, .rr-showcase .wp-block-woocommerce-product-template > li {
	flex: 0 0 100% !important; width: 100% !important; max-width: none !important; margin: 0 !important; scroll-snap-align: start; background: none !important; padding: 0 !important; box-shadow: none !important;
}
.rr-slide-p { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.rr-slide-p > * { margin: 0; }
.rr-slide-p .wc-block-components-product-image { margin: 0 auto; width: min(720px, 92%); }
.rr-slide-p .wc-block-components-product-image img { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 0; background: none; }
.rr-bar-p { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; margin-inline: 60px; }
.rr-bar-p > * { margin: 0; background: var(--wp--preset--color--field); border-radius: 18px; padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.rr-bar-p h3 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.rr-bar-p h3 a { color: var(--wp--preset--color--contrast); }
.rr-bar-p .wp-block-post-excerpt { font-size: .8125rem; color: var(--wp--preset--color--muted); margin: 0; }
.rr-bar-p .wp-block-post-excerpt__excerpt { margin: 0; }
.rr-bar-p .wp-block-post-terms { font-size: .75rem; margin: 0; }
.rr-bar-p .wp-block-post-terms a { display: inline-block; background: #fff; color: var(--wp--preset--color--contrast); padding: 2px 12px; border-radius: 999px; margin: 2px; }
.rr-bar-p__lbl { font-size: .75rem; color: var(--wp--preset--color--muted); margin: 0; }
.rr-bar-p .wc-block-components-product-price { font-size: 1.5rem; font-weight: 700; }
.rr-bar-p .wp-block-woocommerce-product-button { margin: 0; }
.rr-bar-p .wc-block-components-product-button__button, .rr-bar-p .wp-block-button__link { width: 100%; background: var(--wp--preset--color--primary); color: #fff; border-radius: 10px; font-weight: 600; }
.rr-showcase__arrow { position: absolute; bottom: 38px; z-index: 3; width: 46px; height: 46px; background-color: var(--wp--preset--color--field); }
.rr-showcase__arrow--prev { inset-inline-start: 0; }
.rr-showcase__arrow--next { inset-inline-end: 0; }
@media (max-width: 781.98px) {
	.rr-bar-p { grid-template-columns: 1fr; margin-inline: 0; }
	.rr-showcase__arrow { bottom: auto; top: 22%; }
	.rr-bar-p h3 { font-size: 1.25rem; }
}
