/*
Theme Name:   Ketabfay Child
Theme URI:    https://ketabfay.ir
Description:  قالب فرزند کتابفای — راست‌به‌چپ، فونت فارسی و اجزای فروشگاه کتاب.
Author:       Ketabfay
Template:     blocksy
Version:      0.3.0
Text Domain:  ketabfay-child
*/

:root {
	--kf-font-body: "IRANYekan", "Vazirmatn", Tahoma, sans-serif;
	--kf-radius: 10px;
}

body {
	font-family: var( --kf-font-body );
	direction: rtl;
	text-align: right;
}

/* اعداد در قیمت‌ها همیشه با فاصلهٔ خوانا و بدون شکستن خط */
.kf-price,
.woocommerce-Price-amount {
	white-space: nowrap;
	unicode-bidi: plaintext;
}

/* کارت کتاب */
.kf-book-card {
	border-radius: var( --kf-radius );
	overflow: hidden;
}

.kf-book-card__meta {
	font-size: 0.875rem;
	line-height: 1.9;
}

.kf-book-card__meta dt {
	color: #6b7280;
}

/* اصلاح جهت اجزای وارداتی که چپ‌به‌راست فرض شده‌اند */
.woocommerce ul.products li.product,
.wcfm-container,
.wcfm_menu {
	direction: rtl;
	text-align: right;
}

/* ---------- فاز ۱: پایهٔ راست‌به‌چپ روی Blocksy ---------- */

/* ارقام و شناسه‌های لاتین (شابک، شمارهٔ سفارش) در متن فارسی */
.kf-latin,
.kf-isbn,
.woocommerce-order-overview__order strong {
	direction: ltr;
	unicode-bidi: isolate;
	font-variant-numeric: tabular-nums;
}

/* فرم‌ها: متن راست‌چین، فیلدهای ایمیل/تلفن/کدپستی چپ‌چین */
input[type="email"],
input[type="tel"],
input[type="url"],
input#billing_postcode,
input#shipping_postcode {
	direction: ltr;
	text-align: left;
}

/* داشبورد WCFM (پلاگین چپ‌به‌راست طراحی شده) */
.wcfm-container,
.wcfm_menu,
#wcfm-main-contentainer,
.wcfm-collapse,
.wcfm_dashboard_stats {
	direction: rtl;
	text-align: right;
}

#wcfm-content .wcfm_title,
#wcfm-content label,
#wcfm-content th {
	text-align: right;
}

/* برچسب «فروشنده:» زیر محصول */
.wcfmmp_sold_by_container {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
}

/* نشان «به‌زودی» و پیام‌های ووکامرس */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-right-width: 3px;
	border-left-width: 0;
	padding-right: 3.5em;
	padding-left: 1em;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
	right: 1.5em;
	left: auto;
}

/* صفحهٔ اصلی: عنوان تکراری «خانه» بالای صفحه نمایش داده نشود */
.home.page .hero-section {
	display: none;
}

/* --- Phase 2b: shop filters, book byline, editions strip, specs --- */
.kf-shop-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	align-items: flex-end;
	margin: 0 0 24px;
	padding: 14px 16px;
	background: var( --kf-surface, #f6f6f7 );
	border-radius: var( --kf-radius );
}
.kf-filter { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 130px; }
.kf-filter select, .kf-filter input { min-height: 38px; font-size: 14px; }
.kf-filter--price { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 6px; }
.kf-filter--price .kf-filter__label { width: 100%; }
.kf-filter--price input { width: 110px; }
.kf-filter__submit { min-height: 38px; }
.kf-filter__reset { font-size: 13px; align-self: center; }
.kf-byline { margin: 0 0 12px; font-size: 14px; color: var( --kf-muted, #555 ); }
.kf-byline__item + .kf-byline__item::before { content: "·"; margin: 0 8px; }
.kf-byline__label { font-weight: 600; }
.kf-loop-byline { margin: 2px 0 6px; font-size: 13px; color: var( --kf-muted, #666 ); }
.kf-editions { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kf-editions__item { padding: 6px 12px; border: 1px solid var( --kf-border, #e0e0e0 ); border-radius: 999px; font-size: 14px; }
.kf-editions__name { font-weight: 600; margin-inline-end: 6px; }
.kf-specs th { width: 32%; text-align: right; font-weight: 600; }
@media ( max-width: 640px ) { .kf-filter { min-width: calc( 50% - 8px ); } }
