/**
 * أنماط هيدر وفوتر تَهادُوا — تكمّل عقد الفئات الموجود في tahado-theme.css.
 * تعتمد على متغيرات الهوية: --tahado-purple/-deep، --tahado-gold/-light/-deep،
 * --tahado-ivory/-deep/-card، --tahado-ink/-mute/-line، --tahado-radius/-sm، --tahado-wrap.
 *
 * ملاحظة: Blocksy يغلّف ناتج الهيدر داخل <header id="header"> والفوتر داخل
 * <footer id="footer"> — التثبيت (sticky) يطبَّق على #header لأنه العنصر
 * الذي يملك مسافة تمرير داخل #main-container.
 *
 * @package Tahado
 * @since   1.0.6
 */

/* ============================================================
   أساسيات مشتركة
   ============================================================ */

/* عدم الاعتماد على reset القالب — الحشوة تُحسب ضمن العرض. */
.tahado-header,
.tahado-header *,
.tahado-drawer,
.tahado-drawer *,
.tahado-drawer-scrim,
.tahado-footer,
.tahado-footer * {
	box-sizing: border-box;
}

.tahado-hf-container {
	width: 100%;
	max-width: var(--tahado-wrap);
	margin-inline: auto;
	padding-inline: clamp(1rem, 3vw, 2rem);
}

#header,
#footer {
	min-width: 0;
}

/* التثبيت: #header يملك كامل ارتفاع الصفحة للتمرير داخله. */
#header {
	position: sticky;
	top: 0;
	z-index: 40;
}

body.admin-bar #header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar #header {
		top: 46px;
	}
}

.tahado-header a:focus-visible,
.tahado-header button:focus-visible,
.tahado-drawer a:focus-visible,
.tahado-drawer button:focus-visible,
.tahado-footer a:focus-visible {
	outline: 2px solid var(--tahado-gold);
	outline-offset: 2px;
	border-radius: var(--tahado-radius-sm);
}

/* ============================================================
   الشريط العلوي
   ============================================================ */

.tahado-top-bar {
	background: var(--tahado-purple-deep);
	color: var(--tahado-on-dark);
	max-height: 3rem;
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease;
}

/* عند التمرير للأسفل: تقليص الشريط العلوي لإبقاء الهيدر مدمجاً. */
.tahado-header.is-stuck .tahado-top-bar {
	max-height: 0;
	opacity: 0;
}

.tahado-top-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 2.4rem;
	padding-block: 0.3rem;
	font-size: 0.8rem;
}

.tahado-top-bar__group {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.tahado-top-bar__item {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0;
	opacity: 0.9;
	color: inherit;
	white-space: nowrap;
}

a.tahado-top-bar__item {
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
}

a.tahado-top-bar__item:hover {
	color: var(--tahado-gold-light);
	opacity: 1;
}

.tahado-top-bar__item svg {
	flex-shrink: 0;
}

.tahado-top-bar__sep {
	opacity: 0.4;
}

/* ============================================================
   الصف الرئيسي — الشعار والبحث والأيقونات
   ============================================================ */

.tahado-header__main {
	background: var(--tahado-surface);
	border-bottom: 1px solid var(--tahado-line);
}

.tahado-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 0.75rem;
	min-height: 4.25rem;
}

.tahado-logo a {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--tahado-purple) !important;
	text-decoration: none;
	font-family: var(--tahado-font-heading);
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.2;
}

.tahado-logo__mark {
	color: var(--tahado-gold);
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
}

/* صورة الشعار المرفوعة من التخصيص (افتراضياً assets/img/logo-mark.png). */
.tahado-logo__img {
	width: 44px;
	height: 44px;
	object-fit: contain;
	flex-shrink: 0;
	display: block;
}

.tahado-logo--drawer .tahado-logo__img {
	width: 36px;
	height: 36px;
}

.tahado-logo__text {
	white-space: nowrap;
}

/* البحث */

.tahado-header__search {
	flex: 1 1 auto;
	max-width: 520px;
	margin-inline: auto;
}

.tahado-search {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
	margin: 0;
}

.tahado-search__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 2.875rem; /* 46px — هدف لمس مريح */
	padding-inline: 1rem;
	font-family: var(--tahado-font-body);
	font-size: 0.95rem;
	color: var(--tahado-text);
	background: var(--tahado-bg);
	border: 1px solid var(--tahado-line);
	border-radius: 999px;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tahado-search__input::placeholder {
	color: var(--tahado-mute);
}

.tahado-search__input:focus {
	outline: none;
	border-color: var(--tahado-purple);
	background: var(--tahado-surface);
	box-shadow: 0 0 0 3px rgb(var(--tahado-purple-rgb) / 0.12);
}

.tahado-search__submit {
	display: grid;
	place-items: center;
	width: 2.875rem;
	flex: 0 0 auto;
	border: none;
	cursor: pointer;
	color: var(--tahado-on-dark);
	background: var(--tahado-purple);
	border-radius: 999px;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.tahado-search__submit:hover {
	background: var(--tahado-purple-deep);
}

.tahado-search__submit:active {
	transform: scale(0.96);
}

/* أيقونات الحساب والسلة */

.tahado-header__icons {
	display: flex;
	align-items: center;
	gap: 0.875rem;
}

.tahado-header__icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	transition: background-color 0.2s ease;
	margin: 0;
}

.tahado-header__icon:hover {
	background: var(--tahado-surface-2);
}

.tahado-header__icon a {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--tahado-text);
	text-decoration: none;
	border-radius: 50%;
}

.tahado-cart-count {
	position: absolute;
	top: 1px;
	inset-inline-end: -1px;
	min-width: 19px;
	height: 19px;
	padding-inline: 4px;
	display: grid;
	place-items: center;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	color: var(--tahado-on-dark);
	background: var(--tahado-gold-deep);
	border: 2px solid var(--tahado-ivory-card);
	border-radius: 999px;
}

/* زر قائمة الجوال — مخفي على سطح المكتب */

.tahado-header__menu-toggle {
	display: none;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	cursor: pointer;
	color: var(--tahado-text);
	background: transparent;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.tahado-header__menu-toggle:hover {
	background: var(--tahado-surface-2);
}

.tahado-header__menu-toggle-open,
.tahado-header__menu-toggle-close {
	display: grid;
	place-items: center;
}

.tahado-header__menu-toggle-close {
	display: none;
}

.tahado-header__menu-toggle[aria-expanded="true"] .tahado-header__menu-toggle-open {
	display: none;
}

.tahado-header__menu-toggle[aria-expanded="true"] .tahado-header__menu-toggle-close {
	display: grid;
}

/* ============================================================
   صف التنقل
   ============================================================ */

.tahado-header__navrow {
	background: var(--tahado-surface);
	border-bottom: 1px solid var(--tahado-line);
}

.tahado-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	font-size: 0.95rem;
	font-weight: 500;
}

.tahado-nav .tahado-nav__list {
	display: flex;
	align-items: center;
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tahado-nav .wp-block-navigation-item a {
	position: relative;
	display: inline-block;
	padding: 0.625rem 0.125rem;
	color: var(--tahado-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

/* خط ذهبي سفلي يظهر عند التحويم أو النشاط. */
.tahado-nav .wp-block-navigation-item a::after {
	content: "";
	position: absolute;
	inset-inline: 0.125rem;
	bottom: 0.375rem;
	height: 2px;
	background: var(--tahado-gold);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.2s ease;
}

.tahado-nav .wp-block-navigation-item a:hover::after,
.tahado-nav .wp-block-navigation-item.current-menu-item a::after,
.tahado-nav .wp-block-navigation-item.is-active a::after {
	transform: scaleX(1);
}

/* ============================================================
   درج قائمة الجوال
   ============================================================ */

.tahado-drawer-scrim {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgb(var(--tahado-ink-rgb) / 0.55);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	-webkit-tap-highlight-color: transparent;
}

.tahado-drawer-scrim[hidden] {
	display: block;
}

body.tahado-drawer-open .tahado-drawer-scrim {
	opacity: 1;
	pointer-events: auto;
}

body.tahado-drawer-open {
	overflow: hidden;
}

.tahado-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	inset-inline-start: 0;
	z-index: 100;
	display: flex;
	flex-direction: column;
	width: min(380px, 88vw);
	padding: 1.25rem;
	background: var(--tahado-bg);
	box-shadow: 0 10px 40px rgb(var(--tahado-ink-rgb) / 0.25);
}

/* الإزاحة الافتراضية للخارج: يساراً في LTR (الدرج مثبت على الحافة اليسرى)،
   وتُعكس يميناً في RTL لأن inset-inline-start يمثّل الحافة اليمنى هناك. */
.tahado-drawer {
	transform: translateX(var(--tahado-drawer-off, -105%));
	visibility: hidden;
	transition: transform 0.28s ease, visibility 0s linear 0.28s;
	overscroll-behavior: contain;
	overflow-y: auto;
}

[dir="rtl"] .tahado-drawer {
	--tahado-drawer-off: 105%;
}

body.tahado-drawer-open .tahado-drawer {
	transform: translateX(0);
	visibility: visible;
	transition: transform 0.28s ease;
}

.tahado-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--tahado-line);
}

.tahado-logo--drawer a {
	font-size: 1.25rem;
}

.tahado-drawer__close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	cursor: pointer;
	color: var(--tahado-text);
	background: var(--tahado-surface-2);
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.tahado-drawer__close:hover {
	background: var(--tahado-line);
}

.tahado-drawer__search {
	padding-block: 1rem;
	border-bottom: 1px solid var(--tahado-line);
}

.tahado-drawer__nav {
	padding-block: 0.5rem;
}

.tahado-drawer__nav .tahado-nav__list,
.tahado-drawer__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tahado-drawer__nav .wp-block-navigation-item a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding-block: 0.625rem;
	font-size: 1.05rem;
	font-weight: 500;
	color: var(--tahado-text);
	text-decoration: none;
	border-bottom: 1px solid var(--tahado-line);
	transition: color 0.2s ease, padding-inline-start 0.2s ease;
}

.tahado-drawer__nav .wp-block-navigation-item a:hover {
	color: var(--tahado-purple);
	padding-inline-start: 0.375rem;
}

.tahado-drawer__nav .wp-block-navigation-item.current-menu-item a,
.tahado-drawer__nav .wp-block-navigation-item.is-active a {
	color: var(--tahado-purple);
	font-weight: 700;
}

.tahado-drawer__contact {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: auto;
	padding-top: 1.25rem;
	border-top: 1px solid var(--tahado-line);
}

.tahado-drawer__contact-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	color: var(--tahado-purple);
	font-size: 0.95rem;
	text-decoration: none;
}

.tahado-drawer__contact-item:hover {
	color: var(--tahado-gold-deep);
}

/* ============================================================
   الفوتر
   ============================================================ */

.tahado-footer {
	background: var(--tahado-purple-deep);
	color: rgba(251, 248, 242, 0.78);
	margin-top: auto;
}

.tahado-footer__grid {
	display: grid;
	grid-template-columns: 2.2fr 1fr 1fr 1.4fr;
	gap: 2.5rem;
	padding-block: 3.5rem 3rem;
	padding-bottom: 3rem;
}

.tahado-footer__logo {
	margin: 0 0 1rem;
}

.tahado-footer__logo a {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: #fff !important;
	text-decoration: none;
	font-family: var(--tahado-font-heading);
	font-size: 1.6rem;
	font-weight: 700;
}

.tahado-footer__logo .tahado-logo__mark {
	color: var(--tahado-gold-light);
}

/* الشعار الكامل في الفوتر (افتراضياً assets/img/logo.png) داخل بلاطة عاجية. */
.tahado-footer__logo-img {
	display: block;
	width: 96px;
	height: auto;
	padding: 9px;
	background: var(--tahado-bg);
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.tahado-footer__logo a:hover .tahado-footer__logo-img {
	transform: translateY(-2px);
	transition: transform 0.25s ease;
}

.tahado-footer__desc {
	margin: 0;
	max-width: 34ch;
	font-size: 0.95rem;
	line-height: 1.8;
	color: rgba(251, 248, 242, 0.72);
}

.tahado-footer__social {
	display: flex;
	gap: 10px;
	margin-top: 1.25rem;
}

.tahado-footer__social a {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: rgba(255, 255, 255, 0.08);
	color: var(--tahado-gold-light);
	font-size: 0.85rem;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tahado-footer__social a:hover {
	background: var(--tahado-gold);
	color: var(--tahado-on-gold);
	transform: translateY(-2px);
}

.tahado-footer__col {
	min-width: 0;
}

.tahado-footer__col h4 {
	color: #fff;
	margin: 0 0 1.125rem;
	font-family: var(--tahado-font-heading);
	font-size: 1.1rem;
}

.tahado-footer__col a,
.tahado-footer__menu .wp-block-navigation-item a {
	/* عاجي فاتح — روابط واضحة على الكحلي الغامق. */
	color: rgba(251, 248, 242, 0.88);
	font-size: 0.9rem;
	text-decoration: none;
	transition: color 0.2s ease;
}

.tahado-footer__col a:hover,
.tahado-footer__menu .wp-block-navigation-item a:hover {
	color: var(--tahado-gold-light);
}

.tahado-footer__list,
.tahado-footer__menu .wp-block-navigation__container {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tahado-footer__contact li {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.9rem;
	line-height: 1.6;
}

.tahado-footer__contact svg {
	flex-shrink: 0;
	margin-top: 0.2rem;
	color: var(--tahado-gold-light);
}

/* وسائل الدفع — شارات بأيقونات (دفع عند الاستلام / انستا باي / محافظ إلكترونية). */
.tahado-footer__pay {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

.tahado-footer__pay-item {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.8rem;
	line-height: 1.4;
	color: rgba(251, 248, 242, 0.92);
	background: rgba(255, 255, 255, 0.09);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: var(--tahado-radius-sm);
}

.tahado-footer__pay-item svg {
	flex-shrink: 0;
	color: var(--tahado-gold-light);
}

/* شارة انستا باي — خلفية بيضاء في الوضعَين عمداً (وضوح شعارها البنفسجي/البرتقالي)،
   ولذا نصّها حبرٌ داكن ثابت لا يتبع رمز النص المتبدل. */
.tahado-footer__pay-item--instapay {
	gap: 0.5rem;
	color: var(--tahado-ink);
	background: #fff;
	border-color: #fff;
	font-weight: 700;
}

.tahado-footer__pay-logo {
	display: block;
	flex-shrink: 0;
	height: 21px;
	width: auto;
}

.tahado-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tahado-footer__bottom-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding-block: 1.1rem;
	font-size: 0.82rem;
}

.tahado-footer__bottom-inner p {
	margin: 0;
	color: rgba(251, 248, 242, 0.6);
}

.tahado-footer__credit {
	color: var(--tahado-gold-light) !important;
}

/* ============================================================
   استجابة الشاشات
   ============================================================ */

@media (max-width: 991px) {
	.tahado-header__navrow {
		display: none;
	}

	.tahado-header__menu-toggle {
		display: grid;
	}

	.tahado-header__inner {
		gap: 0.625rem;
	}

	.tahado-logo a {
		font-size: 1.25rem;
	}

	.tahado-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: 2rem;
		padding-block: 2.5rem 2rem;
	}
}

@media (max-width: 767px) {
	.tahado-header__search {
		display: none;
	}

	.tahado-top-bar__group--contact {
		display: none;
	}

	.tahado-top-bar__sep {
		display: none;
	}

	/* الإعلانات تلتف على سطرين في المنتصف — تمنع الفائض الأفقي على الشاشات الضيقة. */
	.tahado-top-bar__inner {
		justify-content: center;
	}

	.tahado-top-bar__group {
		flex-wrap: wrap;
		justify-content: center;
		row-gap: 0.1rem;
	}

	.tahado-top-bar__item {
		white-space: normal;
		text-align: center;
	}

	.tahado-header__inner {
		min-height: 3.75rem;
	}
}

@media (max-width: 560px) {
	.tahado-footer__grid {
		grid-template-columns: 1fr;
		gap: 2.25rem;
	}

	.tahado-footer__bottom-inner {
		justify-content: center;
		text-align: center;
	}
}

/* ============================================================
   تقليل الحركة
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

	.tahado-top-bar,
	.tahado-drawer,
	.tahado-drawer-scrim,
	.tahado-nav .wp-block-navigation-item a::after,
	.tahado-search__input,
	.tahado-search__submit,
	.tahado-header__icon,
	.tahado-footer__social a {
		transition: none;
	}
}
