/** Editorial refinement, Phase 02/04 tokens; approved content remains editor-owned. */

/* Homepage: clear section hierarchy and bounded card summaries. */
.home .rt-section__header.rt-flex--between {
	max-width: none;
	gap: var(--rt-space-3);
	align-items: flex-end;
	flex-wrap: wrap;
}
.home .rt-section__header.rt-flex--between > .rt-button { flex-shrink: 0; }
.home .rt-section__header h2,
.rt-hero__title { text-wrap: balance; }
.home .rt-category-card .rt-card__body { padding: var(--rt-space-3); }
.home .rt-category-card .rt-card__title { font-size: var(--rt-fs-h4); }
.home .rt-category-card .rt-card__meta { line-height: 1.9; margin-bottom: 0; }
.home .rt-card__footer .rt-button { white-space: normal; }
.home .rt-container:not(.rt-hero),
.post-type-archive-product .rt-container,
.tax-fabric_family .rt-container {
	padding-inline: 32px;
}
.rt-header .rt-container,
.rt-footer .rt-container {
	padding-inline: var(--rt-space-2);
}
.home .rt-header .rt-container,
.home .rt-footer .rt-container,
.post-type-archive-product .rt-header .rt-container,
.post-type-archive-product .rt-footer .rt-container,
.tax-fabric_family .rt-header .rt-container,
.tax-fabric_family .rt-footer .rt-container {
	padding-inline: var(--rt-space-2);
}
.rt-hero__actions .rt-button,
.rt-mobile-menu__actions .rt-button {
	text-align: center;
}
.rt-mobile-menu__actions .rt-button {
	align-self: stretch;
	width: 100%;
}

/* Navigation: real disclosure control, with hover/focus fallback without JS. */
.rt-nav__list { gap: var(--rt-space-3); align-items: center; }
.rt-nav__list > li > a { display: inline-flex; align-items: center; min-height: 44px; }
.rt-nav__list > .menu-item-has-children > a::after { content: none; }
.rt-nav__list > .rt-submenu-enhanced { display: flex; align-items: center; }
.rt-submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: var(--rt-space-1);
	border: 0;
	border-radius: var(--rt-radius-sm);
	background: transparent;
	color: var(--rt-color-primary);
	cursor: pointer;
}
.rt-submenu-toggle svg { width: 16px; height: 16px; }
.rt-submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.rt-submenu-toggle:hover { background: var(--rt-color-ghost-hover); }
.rt-nav__list .rt-submenu-enhanced > .sub-menu { display: none !important; }
.rt-nav__list .rt-submenu-enhanced.is-open > .sub-menu { display: grid !important; }
.rt-nav__list .sub-menu a { padding: var(--rt-space-2); border-radius: var(--rt-radius-sm); }
.rt-nav__list .sub-menu a:hover { background: var(--rt-color-background); }
.rt-nav__list a[aria-current="page"],
.rt-mobile-menu__list a[aria-current="page"] { color: var(--rt-color-link); text-decoration: underline; text-underline-offset: .3em; }
.rt-mobile-menu__list > li { margin-bottom: 0; border-bottom: 1px solid var(--rt-color-border); }
.rt-mobile-menu__list > li > a { display: flex; align-items: center; min-height: 48px; padding-block: var(--rt-space-1); }
.rt-mobile-menu__list .sub-menu { margin-block: 0 var(--rt-space-2); }
.rt-mobile-menu__list .sub-menu li { margin-bottom: 0; }
.rt-mobile-menu__list .sub-menu a { min-height: 44px; }
.rt-mobile-menu__list > .rt-mobile-submenu-enhanced {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
}
.rt-mobile-menu__list > .rt-mobile-submenu-enhanced > a {
	grid-column: 1;
	grid-row: 1;
}
.rt-mobile-menu__list > .rt-mobile-submenu-enhanced > .rt-mobile-submenu-toggle {
	grid-column: 2;
	grid-row: 1;
}
.rt-mobile-menu__list > .rt-mobile-submenu-enhanced > .sub-menu {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
}
.rt-mobile-menu__list > .rt-mobile-submenu-enhanced > .sub-menu { display: none; }
.rt-mobile-menu__list > .rt-mobile-submenu-enhanced.is-open > .sub-menu { display: block; }
.rt-mobile-submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-inline-start: 8px;
	border: 0;
	background: transparent;
	color: var(--rt-color-primary);
	cursor: pointer;
	touch-action: manipulation;
}
.rt-mobile-submenu-toggle svg { width: 18px; height: 18px; transition: transform var(--rt-motion-fast); }
.rt-mobile-submenu-enhanced.is-open > .rt-mobile-submenu-toggle svg { transform: rotate(180deg); }
.rt-header__menu-toggle,
.rt-mobile-menu a,
.rt-mobile-menu button { touch-action: manipulation; }
.rt-mobile-menu input[type="search"] { min-width: 0; font-size: var(--rt-fs-body); }

@media (min-width: 768px) {
	.rt-header .rt-container,
	.rt-footer .rt-container {
		padding-inline: var(--rt-space-3);
	}
	.home .rt-header .rt-container,
	.home .rt-footer .rt-container,
	.post-type-archive-product .rt-header .rt-container,
	.post-type-archive-product .rt-footer .rt-container,
	.tax-fabric_family .rt-header .rt-container,
	.tax-fabric_family .rt-footer .rt-container {
		padding-inline: var(--rt-space-3);
	}
}

/* Footer: compact groupings without compromising contact or legal access. */
.rt-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--rt-space-4); }
.rt-footer__brand, .rt-footer__contact { grid-column: 1 / -1; }
.rt-footer__heading { font-size: var(--rt-fs-body); letter-spacing: normal; }
.rt-footer__list li { margin-bottom: var(--rt-space-1); }
.rt-footer__list a:not(.rt-button) { display: inline-flex; align-items: center; min-height: 32px; }
.rt-footer a[dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
.rt-footer__contact .rt-footer__list { line-height: 1.9; }
.rt-footer .rt-button--outline { color: var(--rt-color-white); border-color: var(--rt-color-outline-on-dark); margin-top: var(--rt-space-1); }
.rt-footer .rt-button--outline:hover { color: var(--rt-color-primary); background: var(--rt-color-white); border-color: var(--rt-color-white); }
.rt-footer__bottom { align-items: center; font-size: var(--rt-fs-small); gap: var(--rt-space-2); }
.rt-footer__legal-links { gap: var(--rt-space-1) var(--rt-space-3); }
.rt-footer__legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
.rt-footer :focus-visible { outline-color: var(--rt-color-white); }

/* Shop: native, usable without JS; mobile enhancement only changes initial state. */
.rt-filter-panel { border-block: 1px solid var(--rt-color-border); padding-block: var(--rt-space-2); }
.rt-filter-panel > summary { cursor: pointer; font-weight: 400; color: var(--rt-color-primary); min-height: 44px; align-content: center; }
.rt-filter-panel > summary:focus-visible { outline: 2px solid var(--rt-color-secondary); outline-offset: 2px; }
.rt-filter-panel[open] > summary { margin-bottom: var(--rt-space-2); }
.rt-shop-filters .rt-field__select { min-height: 48px; font-size: var(--rt-fs-body); }
.rt-shop-results__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--rt-space-2); margin-bottom: var(--rt-space-3); font-size: var(--rt-fs-small); }
.rt-shop-results__bar p { margin: 0; }
.rt-shop-results__bar a { color: var(--rt-color-link); text-decoration: underline; text-underline-offset: .2em; min-height: 44px; align-content: center; }

/* Article: readable Persian prose; semantic tables keep their structure. */
.rt-article { padding-top: var(--rt-space-4); }
.rt-article__header { margin-bottom: var(--rt-space-4); }
.rt-article__header h1 { font-size: var(--rt-fs-h2); line-height: 1.5; text-wrap: balance; margin-bottom: 0; }
.rt-article__header time { letter-spacing: normal; }
.rt-article .rt-post-thumbnail-wrap { margin-block: 0 var(--rt-space-5); }
.rt-article .rt-featured-image { width: 100%; height: auto; border-radius: var(--rt-radius-lg); }
.rt-article .rt-page-content { max-width: 70ch; margin-inline: auto; line-height: 2; overflow-wrap: anywhere; }
.rt-article .rt-page-content p { color: var(--rt-color-primary); margin-bottom: var(--rt-space-3); }
.rt-article .rt-page-content :is(h2, h3, h4) { margin-block: var(--rt-space-5) var(--rt-space-2); line-height: 1.6; scroll-margin-top: 160px; text-wrap: balance; }
.rt-article .rt-page-content h2 { font-size: var(--rt-fs-h3); }
.rt-article .rt-page-content h3 { font-size: var(--rt-fs-h4); }
.rt-article .rt-page-content :is(ul, ol) { padding-inline-start: var(--rt-space-3); margin-block: var(--rt-space-2) var(--rt-space-3); }
.rt-article .rt-page-content ul { list-style: disc; }
.rt-article .rt-page-content ol { list-style: decimal; }
.rt-article .rt-page-content li { margin-block: var(--rt-space-1); }
.rt-article .rt-page-content li::marker { color: var(--rt-color-secondary); }
.rt-article .rt-page-content blockquote { margin: var(--rt-space-4) 0; padding: var(--rt-space-2) var(--rt-space-3); border-inline-start: 2px solid var(--rt-color-secondary); background: var(--rt-color-surface); }
.rt-article .rt-page-content blockquote p:last-child { margin-bottom: 0; }
.rt-article .rt-page-content figure { margin: var(--rt-space-4) 0; max-width: 100%; }
.rt-article .rt-page-content figcaption { font-size: var(--rt-fs-small); color: var(--rt-color-text-secondary); margin-top: var(--rt-space-1); }
.rt-article .rt-table-scroll,
.rt-article .wp-block-table { overflow-x: auto; max-width: 100%; margin-block: var(--rt-space-4); }
.rt-article .rt-page-content table { border-collapse: collapse; width: 100%; font-size: var(--rt-fs-small); line-height: 1.9; }
.rt-article .rt-page-content :is(th, td) { padding: var(--rt-space-2); border: 1px solid var(--rt-color-border); text-align: start; vertical-align: top; }
.rt-article .rt-page-content th { background: var(--rt-color-primary); color: var(--rt-color-white); font-weight: 700; }
.rt-article .rt-page-content td { background: var(--rt-color-surface); }

/* Keep WooCommerce's own button rules within the owner-approved Regular weight. */
body .woocommerce :is(a.button, button.button, input.button),
body.woocommerce-page :is(a.button, button.button, input.button) { font-weight: 400; }

@media (max-width: 767px) {
	.rt-hero { padding-block: var(--rt-space-3); }
	.rt-hero__title { line-height: 1.5; }
	.rt-hero__image { max-width: 480px; width: 100%; margin-inline: auto; }
	.home .rt-category-card .rt-card__body { padding: var(--rt-space-2); }
	.rt-shop-filters form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rt-shop-filters .rt-field { min-width: 0; }
	.rt-shop-filters .rt-field__label { font-size: var(--rt-fs-small); }
	.rt-shop-results { margin-top: var(--rt-space-3); }
	.rt-article__header h1 { font-size: var(--rt-fs-h4); }
	.rt-article .rt-page-content h2 { font-size: var(--rt-fs-h4); }
	.rt-article .rt-page-content h3 { font-size: var(--rt-fs-body); font-weight: 700; }
	.rt-article :is(.rt-table-scroll, .wp-block-table) table { min-width: 560px; }
}
@media (min-width: 768px) {
	.rt-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); }
	.rt-footer__brand, .rt-footer__contact { grid-column: auto; }
}
@media (min-width: 1024px) {
	.rt-hero { gap: var(--rt-space-5); padding-block: var(--rt-space-5); }
	.rt-hero__image { width: 100%; max-width: 480px; margin-inline: auto; }
	.rt-hero__title { line-height: 1.45; }
	.rt-article { padding-top: var(--rt-space-5); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
	.rt-header__inner { gap: var(--rt-space-2); }
	.rt-nav__list { gap: var(--rt-space-2); }
	.rt-header__actions { gap: var(--rt-space-1); }
	.rt-header .rt-header__phone { display: none; }
}

/* Approved shop refinement: compact B2B catalog cards and a centered mobile mark. */
.rt-shop-layout {
	display: grid;
	grid-template-columns: minmax(180px, 0.8fr) minmax(0, 3fr);
	gap: var(--rt-space-4);
	align-items: start;
}
.rt-shop-filters {
	position: sticky;
	top: 7rem;
}
.rt-shop-results { min-width: 0; }
.rt-shop-results .rt-grid--products { gap: var(--rt-space-4) var(--rt-space-3); }
.rt-shop-results .rt-product-card {
	border-radius: var(--rt-radius-card);
	box-shadow: none;
}
.rt-shop-results .rt-product-card:hover {
	box-shadow: var(--rt-shadow-md);
}
.rt-shop-results .rt-product-card .rt-card__image-wrap {
	aspect-ratio: 1 / 1;
}
.rt-shop-results .rt-product-card .rt-card__body {
	padding: var(--rt-space-3);
	gap: var(--rt-space-1);
}
.rt-shop-results .rt-product-card__family {
	color: var(--rt-color-link);
	font-size: var(--rt-fs-caption);
}
.rt-shop-results .rt-product-card__identity {
	margin-top: 0;
}
.rt-shop-results .rt-product-card__specs {
	margin-top: var(--rt-space-1);
	padding-block: var(--rt-space-1);
	border-block: 1px solid var(--rt-color-border);
}
.rt-shop-results .rt-product-card__spec {
	font-size: var(--rt-fs-caption);
}
.rt-shop-results .rt-product-card__stock {
	margin-top: var(--rt-space-1);
}
.rt-shop-results .rt-card__footer {
	align-items: stretch;
	gap: var(--rt-space-2);
	flex-wrap: wrap;
	margin-top: var(--rt-space-2);
	padding-top: var(--rt-space-2);
	border-top: 1px solid var(--rt-color-border);
}
.rt-shop-results .rt-card__price {
	flex: 1 1 100%;
	min-width: 0;
}
.rt-shop-results .rt-product-card__details {
	width: 100%;
	min-height: 44px;
	color: var(--rt-color-primary);
	border-color: var(--rt-color-primary);
	text-align: center;
}
.rt-shop-results .rt-product-card__details:hover {
	background: var(--rt-color-primary);
	color: var(--rt-color-white);
}

/* Menu links stay clean; prose links retain the approved underline treatment. */
.rt-header .rt-nav a,
.rt-header .rt-nav a:hover,
.rt-header .rt-nav a:focus-visible,
.rt-mobile-menu a,
.rt-mobile-menu a:hover,
.rt-mobile-menu a:focus-visible {
	text-decoration: none;
}
.rt-nav__list a[aria-current="page"],
.rt-mobile-menu__list a[aria-current="page"] {
	text-decoration: none;
	color: var(--rt-color-link);
}

/* Keep the homepage editorial cards calm at desktop widths. */
.rt-home-blog .rt-grid--products {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 768px) and (max-width: 1279px) {
	.rt-home-blog .rt-grid--products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.rt-home-blog .rt-grid--products {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 1023px) {
	.rt-header__inner {
		position: relative;
		min-height: 80px;
	}
	.rt-header__logo {
		position: absolute;
		inset-inline-start: 50%;
		transform: translateX(50%);
		z-index: 1;
		width: max-content;
		max-width: 42vw;
	}
	html[dir="rtl"] .rt-header__logo { transform: translateX(50%); }
	.rt-header__logo img {
		max-width: 72px;
		max-height: 38px;
	}
	.rt-header__logo .rt-brand-name {
		margin-top: 2px;
		font-size: var(--rt-fs-caption);
	}
	.rt-header__actions {
		margin-inline-start: auto;
	}
	.rt-shop-layout {
		grid-template-columns: minmax(160px, 0.8fr) minmax(0, 3fr);
		gap: var(--rt-space-3);
	}
}
html[dir="ltr"] .rt-header__logo { transform: translateX(-50%); }
@media (max-width: 767px) {
	.rt-shop-layout { display: block; }
	.rt-shop-filters { position: static; }
	.rt-shop-results { margin-top: var(--rt-space-3); }
	.rt-shop-results .rt-grid--products { grid-template-columns: 1fr; }
	.rt-shop-results .rt-product-card .rt-card__image-wrap { aspect-ratio: 4 / 3; }
	.rt-shop-results .rt-product-card .rt-card__body { padding: var(--rt-space-3); }
	.rt-shop-results .rt-product-card .rt-card__title {
		font-size: var(--rt-fs-h4);
		min-height: 0;
	}
	.rt-header__logo { max-width: 38vw; }
	.rt-header__logo img { max-width: 64px; }
}
