/**
 * YOKO site-wide synchronization layer.
 * Keeps Rey/WooCommerce/blog/policy pages aligned with the homepage design system.
 */
body.yoko-site-sync {
	--yoko-site-content: 1440px;
	--yoko-site-reading: 920px;
	--yoko-site-gutter: clamp(16px, 4vw, 64px);
	color: var(--yoko-text);
	font-family: var(--yoko-font);
	text-rendering: optimizeLegibility;
}
body.yoko-site-sync *, body.yoko-site-sync *::before, body.yoko-site-sync *::after { box-sizing: border-box; }
body.yoko-site-sync img { max-width: 100%; }
body.yoko-site-sync a { text-underline-offset: 3px; }

/* Header ownership: Rey native.
 * The child theme intentionally does not style, size, position or constrain
 * .rey-siteHeader and its internal containers. Header geometry now follows
 * Rey > Header / Site Settings exactly.
 */
body.yoko-site-sync .rey-siteFooter { font-family: var(--yoko-font); color: var(--yoko-muted); }
body.yoko-site-sync .rey-siteFooter h4,
body.yoko-site-sync .rey-siteFooter h5,
body.yoko-site-sync .rey-siteFooter .elementor-heading-title { color: var(--yoko-heading); font-weight: 700; }
body.yoko-site-sync .rey-siteFooter a { font-size: 14px; line-height: 1.65; }

/* Primary actions must stay white even when Rey supplies link-state colors. */
body.yoko-site-sync :is(.button, button, input[type="submit"], .elementor-button).yoko-primary,
body.yoko-site-sync .woocommerce a.button.alt,
body.yoko-site-sync .woocommerce button.button.alt,
body.yoko-site-sync .woocommerce input.button.alt,
body.yoko-site-sync .rey-button.rey-button--primary {
	border-color: transparent;
	background: linear-gradient(135deg, var(--yoko-primary), var(--yoko-primary-hover));
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
	font-weight: 700;
}

/* Standard pages that are not rendered by the custom PHP templates. */
body.yoko-site-sync.page:not(.home):not(.page-template-page-seasonal-collection):not([class*="page-template-page-bst-"]):not(.page-template-page-chinh-sach-dai-ly-php):not(.page-template-page-dealer-policy-php) .rey-siteContent,
body.yoko-site-sync.blog .rey-siteContent,
body.yoko-site-sync.archive:not(.post-type-archive-product):not(.tax-product_cat) .rey-siteContent,
body.yoko-site-sync.single-post .rey-siteContent {
	padding-block: clamp(40px, 5vw, 76px);
}
body.yoko-site-sync.page:not(.home) .entry-content,
body.yoko-site-sync.single-post .entry-content {
	font-size: 18px;
	line-height: 1.75;
}
body.yoko-site-sync.page:not(.home) .entry-content > :where(h1,h2,h3,h4,p,ul,ol,blockquote,table,.wp-block-group),
body.yoko-site-sync.single-post .entry-content > :where(h1,h2,h3,h4,p,ul,ol,blockquote,table,.wp-block-group) {
	max-width: var(--yoko-site-reading);
	margin-inline: auto;
}
body.yoko-site-sync.page:not(.home) .entry-content h1,
body.yoko-site-sync.single-post .entry-content h1 { color: var(--yoko-heading); font-size: clamp(36px, 4vw, 58px); line-height: 1.08; letter-spacing: -.035em; }
body.yoko-site-sync.page:not(.home) .entry-content h2,
body.yoko-site-sync.single-post .entry-content h2 { margin-top: 1.7em; color: var(--yoko-heading); font-size: clamp(28px, 2.8vw, 38px); line-height: 1.2; }
body.yoko-site-sync.page:not(.home) .entry-content h3,
body.yoko-site-sync.single-post .entry-content h3 { margin-top: 1.5em; color: var(--yoko-heading); font-size: 23px; line-height: 1.3; }
body.yoko-site-sync .entry-content blockquote { padding: 22px 26px; border-left: 4px solid var(--yoko-primary); border-radius: 0 var(--yoko-radius-md) var(--yoko-radius-md) 0; background: var(--yoko-primary-soft); }
body.yoko-site-sync .entry-content :is(table,.wp-block-table) { width: 100%; overflow: hidden; border: 1px solid var(--yoko-border); border-radius: var(--yoko-radius-md); background: #fff; }
body.yoko-site-sync .entry-content :is(th,td) { padding: 13px 15px; border-color: var(--yoko-border); }

/* WooCommerce shop/category/archive system. */
body.yoko-site-sync:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .rey-siteContent { padding-block: clamp(36px, 4vw, 68px); }
body.yoko-site-sync:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .woocommerce-products-header {
	width: min(calc(100% - (var(--yoko-site-gutter) * 2)), var(--yoko-site-content));
	margin: 0 auto clamp(28px, 4vw, 52px);
	text-align: center;
}
body.yoko-site-sync:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .woocommerce-products-header__title { color: var(--yoko-heading); font-size: clamp(34px, 4vw, 54px); line-height: 1.1; }
body.yoko-site-sync:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px 18px;
	width: min(calc(100% - (var(--yoko-site-gutter) * 2)), var(--yoko-site-content));
	margin-inline: auto !important;
}
body.yoko-site-sync .woocommerce ul.products li.product {
	width: auto !important;
	margin: 0 !important;
	overflow: hidden;
	border: 1px solid var(--yoko-border);
	border-radius: 14px;
	background: #fff;
	box-shadow: var(--yoko-shadow-sm);
	transition: transform var(--yoko-transition), box-shadow var(--yoko-transition), border-color var(--yoko-transition);
}
body.yoko-site-sync .woocommerce ul.products li.product:hover { transform: translateY(-4px); border-color: #dac9e4; box-shadow: var(--yoko-shadow-md); }
body.yoko-site-sync .woocommerce ul.products li.product img { width: 100%; aspect-ratio: 4 / 5; margin: 0 !important; object-fit: cover; background: #f7f4f8; }
body.yoko-site-sync .woocommerce ul.products li.product :is(.woocommerce-loop-product__title,.rey-productLoop-title) { min-height: 2.8em; padding: 14px 14px 0 !important; color: var(--yoko-heading); font-size: 15px !important; font-weight: 600; line-height: 1.4; }
body.yoko-site-sync .woocommerce ul.products li.product .price { display: block; padding: 8px 14px 16px; color: var(--yoko-primary) !important; font-size: 17px !important; font-weight: 700; }
body.yoko-site-sync .woocommerce-result-count,
body.yoko-site-sync .woocommerce-ordering { color: var(--yoko-muted); font-size: 14px; }

/* Blog/archive cards. */
body.yoko-site-sync:is(.blog,.category,.tag,.archive:not(.woocommerce-page)) .site-main,
body.yoko-site-sync:is(.blog,.category,.tag,.archive:not(.woocommerce-page)) .rey-siteContent > .container {
	width: min(calc(100% - (var(--yoko-site-gutter) * 2)), var(--yoko-site-content));
	margin-inline: auto;
}
body.yoko-site-sync :is(.rey-postsGrid,.posts-grid,.blog-grid) { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px 22px; }
body.yoko-site-sync :is(.rey-postsGrid,.posts-grid,.blog-grid) article { overflow: hidden; border: 1px solid var(--yoko-border); border-radius: 16px; background: #fff; box-shadow: var(--yoko-shadow-sm); }
body.yoko-site-sync :is(.rey-postsGrid,.posts-grid,.blog-grid) article img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
body.yoko-site-sync :is(.rey-postsGrid,.posts-grid,.blog-grid) article :is(h2,h3) { color: var(--yoko-heading); font-size: 20px; line-height: 1.35; }

/* Inputs and forms across contact/policy/account pages. */
body.yoko-site-sync :is(input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="search"],input[type="password"],select,textarea) {
	min-height: 52px;
	border: 1px solid var(--yoko-border);
	border-radius: 9px;
	background: #fff;
	color: var(--yoko-text);
	font: 15px/1.4 var(--yoko-font);
}
body.yoko-site-sync textarea { min-height: 130px; }
body.yoko-site-sync :is(input,select,textarea,button,a):focus-visible { outline: 3px solid rgba(112,37,135,.22); outline-offset: 2px; }

@media (max-width: 1199px) {
	body.yoko-site-sync:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0,1fr)); }
	body.yoko-site-sync :is(.rey-postsGrid,.posts-grid,.blog-grid) { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 767px) {
	body.yoko-site-sync { --yoko-site-gutter: 14px; }
	body.yoko-site-sync.page:not(.home) .entry-content,
	body.yoko-site-sync.single-post .entry-content { font-size: 16px; line-height: 1.7; }
	body.yoko-site-sync.page:not(.home) .entry-content h1,
	body.yoko-site-sync.single-post .entry-content h1 { font-size: clamp(30px, 9vw, 40px); }
	body.yoko-site-sync.page:not(.home) .entry-content h2,
	body.yoko-site-sync.single-post .entry-content h2 { font-size: 25px; }
	body.yoko-site-sync.page:not(.home) .entry-content h3,
	body.yoko-site-sync.single-post .entry-content h3 { font-size: 19px; }
	body.yoko-site-sync:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 10px; }
	body.yoko-site-sync .woocommerce ul.products li.product :is(.woocommerce-loop-product__title,.rey-productLoop-title) { padding: 10px 10px 0 !important; font-size: 13px !important; }
	body.yoko-site-sync .woocommerce ul.products li.product .price { padding: 6px 10px 12px; font-size: 15px !important; }
	body.yoko-site-sync :is(.rey-postsGrid,.posts-grid,.blog-grid) { grid-template-columns: 1fr; gap: 18px; }
	body.yoko-site-sync .entry-content .wp-block-table { overflow-x: auto; }
	body.yoko-site-sync .rey-siteFooter { font-size: 13px; }
}
