/* رویا رایانه – فروشگاه: لیست محصولات و صفحه‌ی محصول */
:root {
	--rr-s-sort: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d=%22m3%2016%204%204%204-4%22/%3E%3Cpath%20d=%22M7%2020V4%22/%3E%3Cpath%20d=%22m21%208-4-4-4%204%22/%3E%3Cpath%20d=%22M17%204v16%22/%3E%3C/svg%3E");
	--rr-s-filter: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d=%22M21%204h-7M10%204H3M21%2012h-9M8%2012H3M21%2020h-5M12%2020H3M14%202v4M8%2010v4M16%2018v4%22/%3E%3C/svg%3E");
	--rr-s-star: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='black'%20stroke='black'%20stroke-width='1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d=%22M12%202.5l2.9%206%206.6.9-4.8%204.6%201.2%206.5L12%2017.4l-5.9%203.1%201.2-6.5L2.5%209.4l6.6-.9z%22/%3E%3C/svg%3E");
	--rr-s-x: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d=%22M18%206%206%2018M6%206l12%2012%22/%3E%3C/svg%3E");
}

/* ===== عمومی فروشگاه ===== */
html.rr-lock { overflow: hidden; }
.wc-block-breadcrumbs, .woocommerce-breadcrumb { font-size: .8125rem; color: var(--wp--preset--color--muted); }
.woocommerce-breadcrumb a, .wc-block-breadcrumbs a { color: var(--wp--preset--color--muted); }
.rr-archive > *, .rr-single > * { margin-block: 0; }
.rr-archive h1.wp-block-query-title { font-size: clamp(1.25rem, 3vw, 1.75rem); margin: 0; }
.rr-archive .wc-block-product-results-count, .rr-archive .woocommerce-result-count { margin: 0; font-size: .8125rem; color: var(--wp--preset--color--muted); }

/* ===== نوار مرتب‌سازی / فیلتر / دسته‌ها ===== */
.rr-shopbar { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.rr-shopbar::-webkit-scrollbar { display: none; }
.rr-chips { display: contents; }
.rr-chip, .rr-shopbar form.rr-chip {
	display: inline-flex; align-items: center; gap: 6px; flex: none; margin: 0;
	padding: 8px 16px; border-radius: 999px; white-space: nowrap;
	background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--contrast); font-size: .8125rem; line-height: 1.6; text-decoration: none; cursor: pointer;
}
.rr-chip:hover { border-color: var(--wp--preset--color--silver-dark); }
.rr-chip.is-active { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: #fff; }
.rr-chip--sort::before, .rr-chip--filter::before {
	content: ""; width: 16px; height: 16px; background: currentColor;
	-webkit-mask: var(--rr-s-sort) center / contain no-repeat; mask: var(--rr-s-sort) center / contain no-repeat;
}
.rr-chip--filter::before { -webkit-mask-image: var(--rr-s-filter); mask-image: var(--rr-s-filter); }
.rr-chip--sort label { display: block; margin: 0; }
.rr-chip--sort select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; color: inherit; padding: 0; margin: 0; cursor: pointer; max-width: 11em; }
.rr-chip b { background: var(--wp--preset--color--accent); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: .6875rem; padding: 0 4px; }

/* ===== پنل فیلتر (از پایین) ===== */
.rr-sheet { display: none; position: fixed; inset: 0; z-index: 100000; }
.rr-sheet:target, .rr-sheet.is-open { display: block; }
.rr-sheet__scrim { position: absolute; inset: 0; background: rgba(10, 20, 30, .5); animation: rr-fade .2s ease-out; }
.rr-sheet__panel {
	position: absolute; inset-inline: 0; bottom: 0; margin: 0;
	display: flex; flex-direction: column; gap: 14px;
	background: #fff; border-radius: 26px 26px 0 0; max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
	padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
	animation: rr-sheet-up .28s cubic-bezier(.2, .8, .2, 1);
}
.rr-sheet__head { display: flex; align-items: center; justify-content: space-between; font-size: 1.0625rem; }
.rr-sheet__x { width: 36px; height: 36px; border-radius: 12px; background: var(--wp--preset--color--field); position: relative; }
.rr-sheet__x::before { content: ""; position: absolute; inset: 9px; background: var(--wp--preset--color--contrast); -webkit-mask: var(--rr-s-x) center / contain no-repeat; mask: var(--rr-s-x) center / contain no-repeat; }
.rr-sheet__grp { border: 0; margin: 0; padding: 0; }
.rr-sheet__grp legend { font-weight: 700; font-size: .9375rem; padding: 0; margin-bottom: 8px; }
.rr-sheet__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rr-sheet__row input { width: 100%; border: 1px solid var(--wp--preset--color--border); border-radius: 12px; padding: .65rem .9rem; font: inherit; background: var(--wp--preset--color--field); }
.rr-check { display: flex; align-items: center; gap: 10px; font-size: .9375rem; }
.rr-check input { width: 20px; height: 20px; accent-color: var(--wp--preset--color--primary); }
.rr-sheet__cats { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-sheet__cat { padding: 6px 14px; border-radius: 999px; background: var(--wp--preset--color--field); font-size: .8125rem; color: var(--wp--preset--color--contrast); text-decoration: none; }
.rr-sheet__cat.is-active { background: var(--wp--preset--color--primary); color: #fff; }
.rr-sheet__act { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 4px; }
.rr-btn { display: inline-flex; justify-content: center; align-items: center; padding: .8em 1em; border: 0; border-radius: 10px; background: var(--wp--preset--color--primary); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.rr-btn--soft { background: var(--wp--preset--color--field); color: var(--wp--preset--color--contrast); }
@media (min-width: 1024px) {
	.rr-sheet__panel { inset-inline: auto; left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(520px, 92%); border-radius: 22px; animation: none; }
}

/* ===== امتیاز عددی (اسکریپت اضافه می‌کند) ===== */
.rr-rate { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--wp--preset--color--muted); }
.rr-rate::before { content: ""; width: 16px; height: 16px; background: #f5a623; -webkit-mask: var(--rr-s-star) center / contain no-repeat; mask: var(--rr-s-star) center / contain no-repeat; }
.rr-rate-done .wc-block-components-product-rating__stars, .rr-rate-done .wc-block-components-product-rating__reviews_count { display: none; }
.rr-prow .wc-block-components-product-rating { margin: 0; }

/* ===== لیست محصولات: دسکتاپ = کاشی ===== */
.rr-prow { display: flex; flex-direction: column; gap: 10px; }
.rr-prow > * { margin: 0 !important; }
.rr-prow__info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rr-prow__info > * { margin: 0 !important; }
.rr-prow .wc-block-components-product-price { font-size: .9375rem; font-weight: 700; }
.rr-archive .wp-block-query-pagination { margin-top: 28px; gap: 8px; }
.rr-archive .wp-block-query-pagination a, .rr-archive .wp-block-query-pagination .page-numbers { padding: 6px 12px; border-radius: 10px; background: var(--wp--preset--color--field); color: var(--wp--preset--color--contrast); text-decoration: none; }
.rr-archive .wp-block-query-pagination .current { background: var(--wp--preset--color--primary); color: #fff; }

/* ===== لیست محصولات: موبایل = ردیفی (عکس راست، عنوان، امتیاز، قیمت چپ) ===== */
@media (max-width: 781.98px) {
	.rr-archive .rr-products .wc-block-product-template, .rr-archive .rr-products .wp-block-woocommerce-product-template { grid-template-columns: 1fr !important; gap: 0 !important; }
	.rr-archive .rr-products .wc-block-product-template > li, .rr-archive .rr-products .wp-block-woocommerce-product-template > li {
		display: block; background: none; border-radius: 0; padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--border);
	}
	.rr-prow { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: center; }
	.rr-prow .wc-block-components-product-image { width: 104px; margin: 0; }
	.rr-prow .wc-block-components-product-image img { width: 104px; height: 104px; border-radius: 14px; background: #fff; object-fit: contain; }
	.rr-prow__info { gap: 4px; }
	.rr-prow .wp-block-post-title {
		padding: 0; border: 0; font-size: .875rem; font-weight: 600; line-height: 1.9;
		display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	}
	.rr-prow .wp-block-post-title::before { display: none; }
	.rr-prow .wp-block-woocommerce-product-price { align-self: flex-end; text-align: end; margin-top: 4px !important; }
	.rr-archive .rr-shopbar { margin-inline: calc(var(--wp--style--root--padding-right, 1rem) * -1); padding-inline: var(--wp--style--root--padding-right, 1rem); }
}

/* =====================================================================
   صفحه‌ی محصول: عکس‌ها | توضیح کوتاه | خرید  +  تب‌ها و بخش‌ها
   ===================================================================== */
.wp-block-group.rr-pdp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.rr-pdp > *, .rr-pdp__summary > *, .rr-pdp__buy > * { min-width: 0; max-width: 100%; }
.rr-pdp > * { margin: 0 !important; }
.rr-pdp__gallery { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: 20px; padding: 12px; }
.rr-pdp__gallery .woocommerce-product-gallery { width: 100% !important; float: none !important; margin: 0 !important; }
.rr-pdp__gallery img { border-radius: 12px; }
.rr-pdp__summary { display: flex; flex-direction: column; gap: 12px; }
.rr-pdp__summary > * { margin: 0 !important; }
.rr-pdp__summary h1 { font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.7; }
.rr-pdp__summary .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: .9375rem; line-height: 2; }
.rr-pdp__summary .wp-block-post-excerpt__excerpt { margin: 0; }
.rr-pdp__summary .wp-block-post-terms { font-size: .8125rem; color: var(--wp--preset--color--muted); }
.rr-pdp__summary .wp-block-post-terms a { display: inline-block; background: var(--wp--preset--color--field); color: var(--wp--preset--color--contrast); padding: 2px 12px; border-radius: 999px; margin: 2px; }

.rr-pdp__buy { display: flex; flex-direction: column; gap: 14px; background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: 20px; padding: 18px; }
.rr-pdp__buy > * { margin: 0 !important; }
.rr-pdp__buy .wc-block-components-product-price { font-size: 1.5rem; font-weight: 700; }
.rr-pdp__buy .wc-block-components-product-price del { color: var(--wp--preset--color--muted); font-size: 1rem; }
.rr-pdp__buy form.cart { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.rr-pdp__buy .quantity { display: flex; }
.rr-pdp__buy .quantity input.qty { width: 100%; border: 1px solid var(--wp--preset--color--border); border-radius: 10px; padding: .6rem; text-align: center; background: var(--wp--preset--color--field); }
.rr-pdp__buy .single_add_to_cart_button, .rr-pdp__buy .wp-element-button { width: 100%; background: var(--wp--preset--color--primary); color: #fff; border: 0; border-radius: 10px; padding: .9em 1em; font-weight: 600; font-size: 1rem; cursor: pointer; }
.rr-pdp__buy .variations select { width: 100%; border: 1px solid var(--wp--preset--color--border); border-radius: 10px; padding: .6rem; background: var(--wp--preset--color--field); }
.rr-pdp__buy .stock { margin: 0; font-size: .875rem; color: var(--wp--preset--color--steel); }

@media (min-width: 640px) {
	.wp-block-group.rr-pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
	.rr-pdp__buy { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
	.wp-block-group.rr-pdp { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .8fr); gap: 24px; }
	.rr-pdp__buy { grid-column: auto; position: sticky; top: calc(var(--rr-hh, 90px) + 14px); }
}

/* تب‌های لنگری (چسبنده) و بخش‌ها */
.rr-psec { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.rr-ptabs {
	position: sticky; top: calc(var(--rr-hh, 90px) + 6px); z-index: 40;
	display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none;
	background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: 16px; padding: 0 20px;
}
.rr-ptabs::-webkit-scrollbar { display: none; }
.rr-ptabs a { flex: none; padding: 14px 2px; font-size: .875rem; font-weight: 600; white-space: nowrap; color: var(--wp--preset--color--muted); border-bottom: 2px solid transparent; text-decoration: none; }
.rr-ptabs a.is-active { color: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); }
.rr-psec__item { scroll-margin-top: calc(var(--rr-hh, 90px) + 70px); background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: 20px; padding: clamp(16px, 3vw, 26px); }
.rr-psec__h { display: inline-block; margin: 0 0 16px; padding-bottom: 10px; font-size: 1.125rem; font-weight: 700; border-bottom: 2px solid var(--wp--preset--color--accent); }
.rr-psec__body { font-size: .9375rem; line-height: 2.1; }
.rr-psec__body > :first-child { margin-top: 0; }

/* جدول مشخصات */
.rr-psec__body table.woocommerce-product-attributes { width: 100%; border-collapse: collapse; margin: 0; }
.rr-psec__body table.woocommerce-product-attributes th, .rr-psec__body table.woocommerce-product-attributes td { padding: 12px 8px; border: 0; border-bottom: 1px solid var(--wp--preset--color--border); text-align: start; vertical-align: top; }
.rr-psec__body table.woocommerce-product-attributes th { width: 30%; font-weight: 500; color: var(--wp--preset--color--muted); }
.rr-psec__body table.woocommerce-product-attributes td p { margin: 0; }
.rr-psec__body table.woocommerce-product-attributes tr:last-child th, .rr-psec__body table.woocommerce-product-attributes tr:last-child td { border-bottom: 0; }

/* دیدگاه‌ها */
.rr-psec__body #reviews .commentlist { list-style: none; margin: 0; padding: 0; }
.rr-psec__body #reviews .commentlist li { padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.rr-psec__body #reviews .comment-form input[type="text"], .rr-psec__body #reviews .comment-form input[type="email"], .rr-psec__body #reviews .comment-form textarea { width: 100%; border: 1px solid var(--wp--preset--color--border); border-radius: 12px; padding: .65rem .9rem; background: var(--wp--preset--color--field); font: inherit; }
.rr-psec__body #reviews .comment-form .submit { background: var(--wp--preset--color--primary); color: #fff; border: 0; border-radius: 10px; padding: .75em 1.6em; font-weight: 600; cursor: pointer; }
.rr-psec__body .woocommerce-Reviews-title { font-size: 1rem; }

/* محصولات مرتبط */
.rr-related { margin-top: 8px; }
.rr-rel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.rr-rel li { display: flex; flex-direction: column; gap: 8px; background: var(--wp--preset--color--field); border-radius: 18px; padding: 12px; margin: 0; }
.rr-rel__img img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #fff; display: block; }
.rr-rel__t { font-size: .8125rem; font-weight: 500; line-height: 1.8; color: var(--wp--preset--color--contrast); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rr-rel__p { font-size: .875rem; font-weight: 700; margin-top: auto; }
@media (min-width: 782px) { .rr-rel { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; } }


/* =====================================================================
   جلوگیری از اسکرول چپ/راست در موبایل (صفحه‌ی محصول، سبد، پرداخت، حساب)
   ===================================================================== */
.rr-pdp__gallery, .rr-pdp__gallery .woocommerce-product-gallery, .rr-pdp__gallery .woocommerce-product-gallery__wrapper { max-width: 100%; overflow: hidden; }
.rr-pdp__gallery .woocommerce-product-gallery { opacity: 1 !important; position: relative; }
.rr-pdp__gallery .woocommerce-product-gallery__image { position: relative; overflow: hidden; max-width: 100%; }
.rr-pdp__gallery .woocommerce-product-gallery__image img { max-width: 100%; height: auto; }
.rr-pdp__gallery .flex-viewport { overflow: hidden !important; max-width: 100%; }
.rr-pdp__gallery .woocommerce-product-gallery__trigger { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 5; }
.rr-pdp__gallery .flex-control-thumbs { display: flex; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.rr-pdp__gallery .flex-control-thumbs li { flex: 0 0 22%; margin: 0; float: none; width: auto; }
.rr-pdp__gallery .flex-control-thumbs img { cursor: pointer; opacity: .6; border-radius: 10px; }
.rr-pdp__gallery .flex-control-thumbs img.flex-active { opacity: 1; }
.rr-psec__body :where(img, iframe, video, embed) { max-width: 100%; height: auto; }
.rr-psec__body { overflow-wrap: break-word; }

@media (max-width: 781.98px) {
	.rr-pdp__buy table.variations, .rr-pdp__buy table.variations tbody, .rr-pdp__buy table.variations tr, .rr-pdp__buy table.variations th, .rr-pdp__buy table.variations td { display: block; width: 100%; padding: 0; }
	.rr-pdp__buy table.variations td { margin-bottom: 10px; }
	.rr-pdp__buy .variations select { max-width: 100%; }
	.rr-psec__body table.woocommerce-product-attributes th { width: 38%; }

	.woocommerce table.shop_table_responsive { border: 0; width: 100%; table-layout: auto; }
	.woocommerce table.shop_table_responsive thead { display: none; }
	.woocommerce table.shop_table_responsive tbody, .woocommerce table.shop_table_responsive tfoot, .woocommerce table.shop_table_responsive tr, .woocommerce table.shop_table_responsive td, .woocommerce table.shop_table_responsive th { display: block; width: 100%; box-sizing: border-box; }
	.woocommerce table.shop_table_responsive tr { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: 16px; padding: 8px 14px; margin-bottom: 12px; }
	.woocommerce table.shop_table_responsive td, .woocommerce table.shop_table_responsive th { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; padding: 8px 0; text-align: end; }
	.woocommerce table.shop_table_responsive td::before { content: attr(data-title); flex: none; font-weight: 600; text-align: start; }
	.woocommerce table.shop_table_responsive td.product-remove::before, .woocommerce table.shop_table_responsive td.product-thumbnail::before, .woocommerce table.shop_table_responsive td.actions::before { display: none; }
	.woocommerce table.shop_table_responsive td.product-thumbnail img { width: 72px; height: auto; border-radius: 10px; }
	.woocommerce table.shop_table_responsive td.product-name { text-align: start; }
	.woocommerce table.shop_table_responsive td.actions { display: block; }
	.woocommerce-cart-form .coupon { display: flex; gap: 8px; flex-wrap: wrap; }
	.woocommerce-cart-form .coupon input.input-text { flex: 1 1 140px; min-width: 0; width: auto; }
	.woocommerce-cart-form button, .woocommerce .cart_totals .button, .woocommerce #place_order { width: 100%; }
	.woocommerce .cart-collaterals, .woocommerce .cart_totals, .woocommerce-page .cart-collaterals .cart_totals { float: none !important; width: 100% !important; }

	.woocommerce-checkout .col2-set .col-1, .woocommerce-checkout .col2-set .col-2, .woocommerce-checkout #order_review, .woocommerce-checkout #order_review_heading { float: none; width: 100%; }
	.woocommerce form .form-row-first, .woocommerce form .form-row-last, .woocommerce form .form-row-wide { float: none; width: 100%; }
	.woocommerce form .form-row input.input-text, .woocommerce form .form-row select, .woocommerce form .form-row textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
	.woocommerce-checkout-review-order-table { width: 100%; table-layout: fixed; word-break: break-word; }
	.woocommerce-checkout #payment ul.payment_methods { padding: 0; }
	.woocommerce-MyAccount-navigation, .woocommerce-MyAccount-content { float: none !important; width: 100% !important; }

	.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout, .wc-block-cart, .wc-block-checkout { max-width: 100%; min-width: 0; }
	.wc-block-components-sidebar-layout { display: block; }
	.wc-block-components-sidebar-layout .wc-block-components-main, .wc-block-components-sidebar-layout .wc-block-components-sidebar { width: 100% !important; max-width: 100%; padding-inline: 0 !important; box-sizing: border-box; }
	.wc-block-components-sidebar-layout *, .wc-block-checkout *, .wc-block-cart * { min-width: 0; }
	.wc-block-components-product-name, .wc-block-components-order-summary-item__description { overflow-wrap: anywhere; }
	.wc-block-components-text-input input, .wc-block-components-combobox input, .wc-block-components-select-input select, .wc-block-components-textarea { width: 100%; max-width: 100%; }
	.wc-block-checkout__actions_row, .wc-block-cart__submit-container { flex-wrap: wrap; }
}
