/*
 * استایل پایه هدر/فوتر قالب. از همان متغیرهای رنگی افزونه استفاده می‌کند
 * (--rse-color-primary و ...) تا کل سایت یکدست باشد (تزریق در wp_head
 * توسط RecipeSearchEngine\Frontend\Assets::print_theme_variables).
 */

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	background: var(--rse-color-bg, #faf9fc);
	color: var(--rse-color-text, #2b2338);
}

a { color: inherit; }

/* ---------- هدر ---------- */
.rst-site-header {
	background: #fff;
	border-bottom: 1px solid var(--rse-color-border, #ece8f3);
	position: sticky;
	top: 0;
	z-index: 100;
}
.rst-site-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 24px;
}
.rst-site-header__brand { display: flex; align-items: center; min-width: 0; }
.rst-site-header__brand img,
.rst-site-header__brand .custom-logo { max-height: 44px; width: auto; display: block; }
.rst-site-header__brand-text { font-size: 20px; font-weight: 700; text-decoration: none; color: var(--rse-color-primary, #8a4fff); white-space: nowrap; }
.rst-site-header__logo-link { display: inline-flex; align-items: center; }
.rst-site-header__logo-img { max-height: 48px; width: auto; display: block; }
.rst-site-header__menu { flex: 1 1 100%; order: 3; }
.rst-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; }
.rst-menu a { text-decoration: none; font-size: 14px; display: block; padding: 6px 0; }
.rst-menu a:hover { color: var(--rse-color-primary, #8a4fff); }

/* --- منو چندسطحی (زیرمنو تا چند رده، به‌صورت dropdown روی هاور) --- */
.rst-menu li { position: relative; }
.rst-menu ul.sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: 100%;
	right: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--rse-color-border, #ece8f3);
	border-radius: 10px;
	box-shadow: var(--rse-shadow-hover, 0 8px 24px rgba(43,35,56,0.12));
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 200;
}
.rst-menu li:hover > ul.sub-menu,
.rst-menu li:focus-within > ul.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.rst-menu ul.sub-menu ul.sub-menu { top: 0; right: 100%; margin-inline-end: 6px; } /* رده سوم به بعد: کنار زیرمنو باز شود */
.rst-menu ul.sub-menu li { white-space: nowrap; }
.rst-menu ul.sub-menu a { padding: 8px 12px; border-radius: 6px; font-size: 13.5px; }
.rst-menu ul.sub-menu a:hover { background: var(--rse-color-bg, #faf9fc); }
.rst-menu li.menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	border-inline-end: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	margin-inline-start: 6px;
	opacity: 0.6;
}

.rst-site-header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.rst-social-icons__list { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.rst-social-icons__list a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--rse-color-bg, #faf9fc);
}
.rst-account-link {
	text-decoration: none;
	font-size: 12.5px;
	white-space: nowrap;
	padding: 7px 12px;
	border-radius: 999px;
	background: var(--rse-color-primary, #8a4fff);
	color: #fff !important;
}

/* ---------- فوتر ---------- */
.rst-site-footer { background: #ffffff; border-top: 1px solid var(--rse-color-border, #ece8f3); margin-top: 60px; }
.rst-site-footer__widgets {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
}
.rst-widget__title { font-size: 15px; margin: 0 0 12px; }
.rst-site-footer__bottom {
	text-align: center;
	padding: 16px 20px;
	border-top: 1px solid var(--rse-color-border, #ece8f3);
	font-size: 13px;
	color: var(--rse-color-muted, #756f82);
}

/* ---------- محتوای عمومی (index.php fallback) ---------- */
.rst-generic-content { max-width: 800px; margin: 0 auto; padding: 40px 20px; line-height: 2; }

/* ====================================================================
 * ووکامرس: حساب کاربری، سبد خرید، تسویه‌حساب
 * ==================================================================== */
.woocommerce,
.woocommerce-page {
	max-width: 1100px;
	margin: 0 auto;
	padding: 32px 20px 60px;
}

/* دکمه‌ها */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	background: var(--rse-color-primary, #8a4fff) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 10px 24px !important;
	font-family: inherit !important;
	font-size: 14px !important;
	cursor: pointer;
	transition: transform 0.15s ease;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover { transform: translateY(-1px); opacity: 0.92; }
.woocommerce a.button.alt,
.woocommerce #payment #place_order {
	background: var(--rse-color-secondary, #ffb020) !important;
	color: #2b2338 !important;
}

/* فرم‌ها و اینپوت‌ها */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce table.shop_table select,
.woocommerce-additional-fields select {
	border: 1px solid var(--rse-color-border, #ece8f3);
	border-radius: 10px;
	padding: 10px 12px;
	font-family: inherit;
	width: 100%;
	box-sizing: border-box;
}

/* حساب کاربری - منوی کنار صفحه */
.woocommerce-MyAccount-navigation {
	background: #fff;
	border: 1px solid var(--rse-color-border, #ece8f3);
	border-radius: var(--rse-radius, 14px);
	padding: 12px;
	margin-bottom: 24px;
}
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }
.woocommerce-MyAccount-navigation li { border-bottom: 1px solid var(--rse-color-border, #ece8f3); }
.woocommerce-MyAccount-navigation li:last-child { border-bottom: none; }
.woocommerce-MyAccount-navigation a { display: block; padding: 10px 12px; text-decoration: none; border-radius: 8px; }
.woocommerce-MyAccount-navigation a:hover { background: var(--rse-color-bg, #faf9fc); color: var(--rse-color-primary, #8a4fff); }
.woocommerce-MyAccount-navigation .is-active a { background: var(--rse-color-primary, #8a4fff); color: #fff; }
.woocommerce-MyAccount-content { background: #fff; border: 1px solid var(--rse-color-border, #ece8f3); border-radius: var(--rse-radius, 14px); padding: 24px; }

@media (min-width: 782px) {
	.woocommerce-account .woocommerce-MyAccount-navigation { float: right; width: 220px; margin-inline-end: 24px; }
	.woocommerce-account .woocommerce-MyAccount-content { overflow: hidden; }
}

/* سبد خرید و جدول‌های ووکامرس */
.woocommerce table.shop_table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid var(--rse-color-border, #ece8f3);
	border-radius: var(--rse-radius, 14px);
	overflow: hidden;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td { padding: 12px 14px; border-bottom: 1px solid var(--rse-color-border, #ece8f3); text-align: right; }
.woocommerce table.shop_table th { background: var(--rse-color-bg, #faf9fc); font-weight: 700; font-size: 13.5px; }

.woocommerce-cart-form .quantity input { width: 60px; border: 1px solid var(--rse-color-border, #ece8f3); border-radius: 8px; padding: 6px; text-align: center; }
.cart-collaterals .cart_totals {
	background: #fff;
	border: 1px solid var(--rse-color-border, #ece8f3);
	border-radius: var(--rse-radius, 14px);
	padding: 20px;
	margin-top: 20px;
}

/* تسویه‌حساب */
.woocommerce-checkout #order_review,
#customer_details {
	background: #fff;
	border: 1px solid var(--rse-color-border, #ece8f3);
	border-radius: var(--rse-radius, 14px);
	padding: 20px;
}
.woocommerce-checkout h3 { font-size: 16px; margin-top: 0; }

/* پیام‌های خطا/موفقیت */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-radius: 10px !important;
	padding: 14px 18px !important;
	border-top: 3px solid var(--rse-color-primary, #8a4fff) !important;
	background: #fff !important;
}

@media (max-width: 780px) {
	.woocommerce-account .woocommerce-MyAccount-navigation { float: none; width: 100%; margin-inline-end: 0; }
}

@media (max-width: 780px) {
	.rst-site-footer__widgets { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
	.rst-site-header__brand img,
	.rst-site-header__brand .custom-logo { max-height: 34px; }
	.rst-site-header__brand-text { font-size: 17px; }
	.rst-account-link { padding: 6px 10px; }
}
