/* ملاحظة: كلاس rawaj-reveal (fade-in عند السكرول) اتشال بالكامل 2026-08-21 —
   جزء من الاتجاه اللي خالد رفضه ("مفيش موشن ولا fade in"). */

/* ============================================================
   Mega Menu
   ============================================================ */
/* الموضع بيُحسب بالنسبة لشريط التنقل كله مش العنصر الضيق نفسه — عشان مايطلعش برّه الشاشة مهما كان مكان العنصر */
.main-navigation { position: relative; }

.rawaj-mega-panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: var(--rawaj-surface);
	border: 1px solid var(--rawaj-border);
	border-radius: 0 0 var(--rawaj-radius) var(--rawaj-radius);
	box-shadow: var(--rawaj-shadow-hover);
	width: 520px;
	max-width: calc(100vw - 24px);
	padding: 24px;
	z-index: 50;
	gap: 24px;
}

.rawaj-mega-menu-item:hover .rawaj-mega-panel {
	display: flex;
}

.rawaj-mega-cats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 6px 20px;
	flex: 1;
}

.rawaj-mega-panel a.rawaj-mega-cat-link {
	color: var(--rawaj-text) !important;
	padding: 8px 4px !important;
	border-bottom: 1px solid var(--rawaj-border);
	font-weight: 600;
	font-size: 0.92rem;
	display: flex !important;
	justify-content: space-between;
	background: none !important;
}

.rawaj-mega-panel a.rawaj-mega-cat-link:hover { color: var(--rawaj-primary) !important; }
.rawaj-mega-panel .rawaj-mega-cat-count { color: var(--rawaj-text-soft) !important; font-weight: 400; }
.rawaj-mega-panel a.rawaj-mega-feature-name { color: var(--rawaj-text) !important; display: block !important; }

.rawaj-mega-feature {
	width: 180px;
	flex-shrink: 0;
	display: block;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
	background: var(--rawaj-primary-light);
}

.rawaj-mega-feature img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }

.rawaj-mega-feature-label {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--rawaj-accent);
	color: var(--rawaj-text);
	font-size: 0.7rem;
	font-weight: 800;
	padding: 3px 10px;
	border-radius: 999px;
}

.rawaj-mega-feature-name {
	display: block;
	padding: 8px 10px;
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--rawaj-text) !important;
}

@media (max-width: 768px) {
	.rawaj-mega-panel { display: none !important; }
}

/* ============================================================
   بطاقة المنتج — شارات + فئة + معاينة سريعة
   ============================================================ */
.rawaj-badges {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-end;
}

.rawaj-badge {
	font-size: 0.72rem;
	font-weight: 800;
	padding: 4px 10px;
	border-radius: 999px;
	color: #FFFFFF;
}

.rawaj-badge-sale { background: #D64545; }
.rawaj-badge-new { background: var(--rawaj-primary); }
.rawaj-badge-oos { background: #8A8A8A; }

.rawaj-card-category {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--rawaj-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.3px;
	padding: 10px 14px 0;
}

ul.products li.product .woocommerce-loop-product__title {
	padding-top: 2px;
}

.rawaj-quick-view-btn {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #FFFFFF;
	border: none;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	cursor: pointer;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
	ul.products li.product:hover .rawaj-quick-view-btn { opacity: 1; transform: translateY(0); }
}
@media (hover: none) {
	.rawaj-quick-view-btn { opacity: 1; transform: none; }
}

/* ============================================================
   Cart Drawer
   ============================================================ */
#rawaj-cart-drawer-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.45);
	z-index: 998; opacity: 0; visibility: hidden; transition: opacity 0.25s ease;
}
#rawaj-cart-drawer-overlay.is-visible { opacity: 1; visibility: visible; }

#rawaj-cart-drawer {
	position: fixed; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw;
	background: var(--rawaj-bg); z-index: 999; box-shadow: -6px 0 24px rgba(0,0,0,0.15);
	transform: translateX(100%); transition: transform 0.3s ease;
	display: flex; flex-direction: column;
}
#rawaj-cart-drawer.is-open { transform: translateX(0); }

.rawaj-cart-drawer-header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 18px 20px; border-bottom: 1px solid var(--rawaj-border); background: var(--rawaj-surface);
}
.rawaj-cart-drawer-header h2 { margin: 0; font-size: 1.1rem; }
#rawaj-cart-drawer-close {
	background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--rawaj-text-soft); line-height: 1;
}

#rawaj-cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.rawaj-cart-empty { text-align: center; padding: 60px 10px; }

.rawaj-cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rawaj-border); }
.rawaj-cart-item-img img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; }
.rawaj-cart-item-info { flex: 1; }
.rawaj-cart-item-name { color: var(--rawaj-text) !important; font-weight: 700; font-size: 0.9rem; display: block; margin-bottom: 4px; }
.rawaj-cart-item-price { color: var(--rawaj-primary); font-weight: 700; font-size: 0.88rem; margin-bottom: 8px; }

.rawaj-cart-item-qty { display: flex; align-items: center; gap: 8px; }
.rawaj-qty-btn {
	width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rawaj-border);
	background: #FFFFFF; cursor: pointer; font-weight: 700; line-height: 1;
}
.rawaj-qty-val { min-width: 18px; text-align: center; font-weight: 700; }
.rawaj-cart-remove { background: none; border: none; color: #D64545; font-size: 0.8rem; cursor: pointer; margin-right: auto; }

.rawaj-cart-summary { padding-top: 16px; }
.rawaj-cart-subtotal { display: flex; justify-content: space-between; font-size: 1rem; margin-bottom: 14px; }
.rawaj-cart-view-btn { width: 100%; text-align: center; margin-bottom: 8px !important; background: var(--rawaj-surface) !important; color: var(--rawaj-text) !important; border: 1px solid var(--rawaj-border) !important; }
.rawaj-cart-checkout-btn { width: 100%; text-align: center; display: block; }

body.rawaj-no-scroll { overflow: hidden; }

/* ============================================================
   Quick View Modal
   ============================================================ */
#rawaj-qv-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.5);
	z-index: 998; opacity: 0; visibility: hidden; transition: opacity 0.25s ease;
}
#rawaj-qv-overlay.is-visible { opacity: 1; visibility: visible; }

#rawaj-qv-modal {
	position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%);
	width: 720px; max-width: 92vw; max-height: 86vh; overflow-y: auto;
	background: var(--rawaj-surface); border-radius: var(--rawaj-radius);
	z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.25s ease, transform 0.25s ease;
	padding: 32px;
}
#rawaj-qv-modal.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }

#rawaj-qv-close {
	position: absolute; top: 16px; left: 16px; background: none; border: none;
	font-size: 1.6rem; cursor: pointer; color: var(--rawaj-text-soft);
}

.rawaj-qv-content { display: flex; gap: 28px; }
.rawaj-qv-image { flex: 1; }
.rawaj-qv-image img { width: 100%; border-radius: 10px; aspect-ratio: 1/1; object-fit: cover; }
.rawaj-qv-info { flex: 1; }
.rawaj-qv-info h2 { margin: 6px 0 10px; font-size: 1.4rem; }
.rawaj-qv-full-link { display: inline-block; margin-top: 14px; font-weight: 700; }
.rawaj-qv-loading { text-align: center; padding: 60px; }

@media (max-width: 700px) {
	.rawaj-qv-content { flex-direction: column; }
	#rawaj-qv-modal { padding: 20px; }
}

/* ============================================================
   Back to top
   ============================================================ */
#rawaj-back-to-top {
	position: fixed; bottom: 24px; left: 24px; width: 44px; height: 44px; border-radius: 50%;
	background: var(--rawaj-primary); color: #FFFFFF; border: none; font-size: 1.2rem; cursor: pointer;
	opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.25s ease; z-index: 500;
	box-shadow: var(--rawaj-shadow-hover);
}
#rawaj-back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ============================================================
   Shop Filters — تصنيف + سعر
   ============================================================ */
.rawaj-shop-layout { display: flex; gap: 32px; align-items: flex-start; }
.rawaj-shop-main { flex: 1; min-width: 0; }

.rawaj-filters-toggle {
	display: none; align-items: center; gap: 6px; background: var(--rawaj-surface); border: 1px solid var(--rawaj-border);
	border-radius: var(--rawaj-radius); padding: 10px 16px; font-family: inherit; font-weight: 600; font-size: 0.95rem;
	cursor: pointer; margin-bottom: 16px; position: relative;
}
.rawaj-filters-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rawaj-accent); display: inline-block; }

.rawaj-shop-filters {
	width: 260px; flex-shrink: 0; background: var(--rawaj-surface); border: 1px solid var(--rawaj-border);
	border-radius: var(--rawaj-radius); padding: 20px; position: sticky; top: 20px;
}
.rawaj-filters-head { display: none; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rawaj-filters-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--rawaj-text); }
.rawaj-shop-filters h3 { margin: 0 0 16px; font-size: 1.1rem; }
.rawaj-filter-group { margin-bottom: 24px; }
.rawaj-filter-group h4 { font-size: 0.95rem; margin: 0 0 10px; color: var(--rawaj-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.rawaj-filter-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; font-size: 0.92rem; }
.rawaj-filter-check em { font-style: normal; color: var(--rawaj-text-muted); font-size: 0.85em; }
.rawaj-price-range { display: flex; align-items: center; gap: 8px; }
.rawaj-price-range input { width: 0; flex: 1; padding: 8px 10px; border: 1px solid var(--rawaj-border); border-radius: 6px; font-family: inherit; }
.rawaj-filters-apply { width: 100%; margin-top: 4px; text-align: center; display: block; }
.rawaj-filters-clear { display: block; text-align: center; margin-top: 10px; font-size: 0.88rem; color: var(--rawaj-text-muted); text-decoration: underline; }
.rawaj-filters-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999; }

@media (max-width: 900px) {
	.rawaj-shop-layout { display: block; }
	.rawaj-filters-toggle { display: inline-flex; }
	.rawaj-filters-head { display: flex; }
	.rawaj-shop-filters {
		position: fixed; top: 0; right: 0; height: 100vh; width: min(320px, 85vw); z-index: 1000;
		border-radius: 0; transform: translateX(100%); transition: transform 0.3s ease; overflow-y: auto;
	}
	.rawaj-shop-filters.is-open { transform: translateX(0); }
	.rawaj-filters-overlay.is-visible { display: block; }
}

/* ============================================================
   Homepage — راجع inc/layout.php + style.css لكل أقسام الرئيسية الجديدة
   (هيرو/فئات/تابات/بانرات/سبوتلايت) — القسم القديم هنا (ماركي مستمر +
   .rawaj-home-products-head) اتشال بالكامل 2026-08-21 مع إعادة البناء.
   ============================================================ */
.rawaj-home-products { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   Recently Viewed
   ============================================================ */
/* 🔴 كان `.rawaj-recently-viewed` بعرض مستقل (max-width:1200px) + `.rawaj-rv-grid`
   بـauto-fill/minmax (عدد أعمدة متغيّر حسب المساحة) — على صفحة المتجر (فيها سايدبار)
   ده بيخليه أعرض من شبكة المنتجات الرئيسية فوقيه (اللي بتاخد عرض العمود الرئيسي بس)
   وبكروت مقاس مختلف تماماً، فبيحس المستخدم إن "شوهد مؤخراً" مش متناسق مع الباقي —
   بالظبط ملاحظة خالد 18 أغسطس. الحل: ياخد عرض حاويته الفعلية (100%، مش عرض مستقل)،
   وعدد أعمدة ثابت يطابق شبكة ووكومرس الرئيسية بالظبط في كل سياق (بسايدبار / من غيره). */
.rawaj-recently-viewed { width: 100%; margin: 48px auto; padding: 0 20px; }
body:not(.right-sidebar):not(.left-sidebar) .rawaj-recently-viewed { max-width: 1200px; }
.rawaj-recently-viewed h2 { font-size: 1.5rem; margin-bottom: 20px; }

/* 🔴 تصحيح خالد 18 أغسطس: التقسيم لصفحات (Grid+pagination) يفضل خاص بصفحة "المتجر"
   بس — أي قسم بيعرض عدد متغيّر من المنتجات (شوهد مؤخراً هنا) الأنسب له سكرول أفقي،
   مش Grid ثابت (مفيش "خانة فاضية" ممكنة مهما كان عدد المنتجات المعروضة: 1 أو 8). */
.rawaj-rv-grid {
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	gap: 16px;
	padding-bottom: 10px;
	-webkit-overflow-scrolling: touch;
}
.rawaj-rv-card {
	display: block;
	flex: 0 0 180px;
	scroll-snap-align: start;
	background: var(--rawaj-surface); border: 1px solid var(--rawaj-border); border-radius: var(--rawaj-radius); padding: 12px; text-decoration: none; color: inherit; transition: box-shadow 0.2s ease;
}
.rawaj-rv-card:hover { box-shadow: var(--rawaj-shadow-hover); }
.rawaj-rv-img img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; }
.rawaj-rv-name { font-size: 0.88rem; margin: 8px 0 4px; line-height: 1.4; }
.rawaj-rv-price { font-weight: 700; color: var(--rawaj-primary); font-size: 0.9rem; }

.rawaj-rv-grid::-webkit-scrollbar { height: 6px; }
.rawaj-rv-grid::-webkit-scrollbar-thumb { background: var(--rawaj-border); border-radius: 3px; }
.rawaj-rv-grid { scrollbar-width: thin; scrollbar-color: var(--rawaj-border) transparent; }

/* ============================================================
   أسهم شرائط السكرول (شوهد مؤخراً + منتجات ذات صلة) — طلب خالد 18 أغسطس
   ============================================================ */
.rawaj-scroll-wrap { position: relative; }

.rawaj-scroll-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--rawaj-surface);
	border: 1px solid var(--rawaj-border);
	box-shadow: var(--rawaj-shadow-hover);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: var(--rawaj-primary);
	cursor: pointer;
	z-index: 5;
	transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.rawaj-scroll-arrow:hover { background: var(--rawaj-primary); color: #FFFFFF; }
.rawaj-scroll-arrow.is-disabled { opacity: 0; pointer-events: none; }

/* السهم بيوضّح اتجاه الحركة الفعلي بصرياً: "السابق" (--start) على الطرف اليمين
   بيشاور يمين (برّه، للخلف)، و"التالي" (--end) على الطرف الشمال بيشاور شمال
   (برّه، لقدام) — الـSVG الأساسي بيشاور يمين، فـ--end بس محتاج rotate. */
.rawaj-scroll-arrow--start { right: -8px; }
.rawaj-scroll-arrow--end { left: -8px; transform: translateY(-50%) rotate(180deg); }
.rawaj-scroll-arrow--end:hover { transform: translateY(-50%) rotate(180deg); }

@media (max-width: 700px) {
	/* على الموبايل السحب باللمس هو المتوقَّع، والزرارين بياخدوا مساحة من عرض شاشة ضيق أصلاً */
	.rawaj-scroll-arrow { display: none; }
}

/* ============================================================
   Live Search
   ============================================================ */
.rawaj-search-results {
	display: none; position: absolute; top: 100%; right: 0; left: 0; margin-top: 6px; background: var(--rawaj-surface);
	border: 1px solid var(--rawaj-border); border-radius: var(--rawaj-radius); box-shadow: var(--rawaj-shadow-hover);
	max-height: 400px; overflow-y: auto; z-index: 200;
}
.rawaj-search-results.is-open { display: block; }
.rawaj-search-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--rawaj-border); }
.rawaj-search-item:hover { background: var(--rawaj-bg); }
.rawaj-search-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.rawaj-search-info { display: flex; flex-direction: column; gap: 2px; }
.rawaj-search-name { font-size: 0.9rem; }
.rawaj-search-price { font-size: 0.82rem; color: var(--rawaj-primary); font-weight: 700; }
.rawaj-search-empty { padding: 16px; text-align: center; color: var(--rawaj-text-muted); font-size: 0.9rem; }
.rawaj-search-viewall { display: block; text-align: center; padding: 10px; font-size: 0.88rem; font-weight: 600; color: var(--rawaj-primary); text-decoration: none; }

/* ============================================================
   FAQ Accordion
   ============================================================ */
.rawaj-faq-section { max-width: 800px; margin: 48px auto; padding: 0 20px; }
.rawaj-faq-section h2 { font-size: 1.5rem; margin-bottom: 20px; text-align: center; }
.rawaj-faq-item { border-bottom: 1px solid var(--rawaj-border); }
.rawaj-faq-q {
	width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none;
	padding: 16px 4px; font-family: inherit; font-size: 1rem; font-weight: 600; text-align: right; cursor: pointer; color: var(--rawaj-text);
}
.rawaj-faq-icon { font-size: 1.3rem; color: var(--rawaj-accent); transition: transform 0.2s ease; flex-shrink: 0; margin-right: 12px; }
.rawaj-faq-item.is-open .rawaj-faq-icon { transform: rotate(45deg); }
.rawaj-faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.rawaj-faq-item.is-open .rawaj-faq-a { max-height: 200px; }
.rawaj-faq-a p { padding: 0 4px 16px; margin: 0; color: var(--rawaj-text-muted); line-height: 1.7; }

/* ============================================================
   Newsletter
   ============================================================ */
.rawaj-newsletter { max-width: 600px; margin: 48px auto; padding: 32px 20px; text-align: center; background: var(--rawaj-primary); border-radius: var(--rawaj-radius); color: #fff; }
.rawaj-newsletter h2 { color: #fff; margin: 0 0 8px; font-size: 1.4rem; }
.rawaj-newsletter p { color: rgba(255,255,255,0.8); margin: 0 0 20px; font-size: 0.92rem; }
.rawaj-newsletter form { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.rawaj-newsletter input[type="email"] { flex: 1; padding: 12px 14px; border-radius: 8px; border: none; font-family: inherit; }
.rawaj-newsletter-msg { margin-top: 12px; font-size: 0.9rem; min-height: 1.2em; }
.rawaj-newsletter-msg.is-success { color: #B7EFC5; }
.rawaj-newsletter-msg.is-error { color: #FFB4B4; }
@media (max-width: 480px) { .rawaj-newsletter form { flex-direction: column; } }

/* ============================================================
   Overrides — قاعدة button العامة (style.css) بتفرض أخضر !important
   على كل <button> بالموقع، لازم نلغيها صراحة للعناصر اللي مفروض تبقى نص/غير مصمّتة
   ============================================================ */
.rawaj-faq-q,
.rawaj-faq-q:hover,
.rawaj-filters-toggle,
.rawaj-filters-toggle:hover,
.rawaj-filters-close,
.rawaj-filters-close:hover {
	background: none !important; color: var(--rawaj-text) !important; border-radius: 0 !important; font-weight: 600 !important;
}
.rawaj-filters-toggle, .rawaj-filters-toggle:hover {
	background: var(--rawaj-surface) !important; border: 1px solid var(--rawaj-border) !important; border-radius: var(--rawaj-radius) !important;
}
.rawaj-filters-close, .rawaj-filters-close:hover { font-size: 1.5rem !important; }
