/* =========================================================
   Matjari — Hanout-style COD WooCommerce theme
   Uses CSS logical properties → works in RTL and LTR.
   ========================================================= */

:root {
	--mj-primary: #f97316;
	--mj-dark: #0f172a;
	--mj-buy: #16a34a;
	--mj-bg: #f6f7f9;
	--mj-card: #ffffff;
	--mj-text: #1f2937;
	--mj-muted: #6b7280;
	--mj-border: #e5e7eb;
	--mj-radius: 12px;
	--mj-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: 'Cairo', Tahoma, Arial, sans-serif;
	background: var(--mj-bg);
	color: var(--mj-text);
	font-size: 16px;
	line-height: 1.7;
}

img { max-width: 100%; height: auto; }
a { color: var(--mj-primary); text-decoration: none; }
a:hover { opacity: .9; }

.mj-container { max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.mj-center { text-align: center; }

/* ---------------- Topbar */
.mj-topbar {
	background: var(--mj-primary);
	color: #fff;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	padding: 7px 0;
}

/* ---------------- Header */
.mj-header { background: #fff; box-shadow: var(--mj-shadow); position: relative; z-index: 50; }
.mj-header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	padding-block: 14px;
}
.mj-logo-text { font-size: 26px; font-weight: 800; color: var(--mj-dark); }
.mj-logo img { max-height: 56px; width: auto; }

.mj-search {
	flex: 1;
	display: flex;
	border: 2px solid var(--mj-primary);
	border-radius: 999px;
	overflow: hidden;
	background: #fff;
	max-width: 560px;
}
.mj-search select {
	border: 0;
	background: #f3f4f6;
	padding-inline: 12px;
	font-family: inherit;
	font-size: 14px;
	max-width: 150px;
	cursor: pointer;
}
.mj-search input[type="search"] {
	flex: 1;
	border: 0;
	padding: 10px 14px;
	font-family: inherit;
	font-size: 15px;
	outline: none;
	min-width: 0;
}
.mj-search button {
	border: 0;
	background: var(--mj-primary);
	color: #fff;
	padding-inline: 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
}

.mj-header-contact { display: flex; align-items: center; gap: 14px; }
.mj-header-phone {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	color: var(--mj-dark);
	direction: ltr;
}
.mj-header-phone svg { color: var(--mj-primary); }

/* Mobile menu toggle */
.mj-menu-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 6px;
}
.mj-menu-toggle span { width: 24px; height: 3px; background: var(--mj-dark); border-radius: 2px; }

/* ---------------- Nav */
.mj-nav { background: var(--mj-dark); }
.mj-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.mj-nav-list li a {
	display: block;
	color: #e2e8f0;
	padding: 12px 18px;
	font-weight: 600;
	font-size: 15px;
}
.mj-nav-list li a:hover,
.mj-nav-list li.current-menu-item a { color: #fff; background: rgba(255, 255, 255, .08); }
.mj-nav-list .sub-menu { display: none; position: absolute; background: var(--mj-dark); list-style: none; padding: 0; min-width: 200px; z-index: 60; }
.mj-nav-list li { position: relative; }
.mj-nav-list li:hover > .sub-menu { display: block; }

/* ---------------- Sections */
.mj-home-section { padding-block: 48px; }
.mj-home-section-alt { background: #fff; }
.mj-section-head { text-align: center; margin-bottom: 32px; }
.mj-section-head h2 {
	font-size: 28px;
	font-weight: 800;
	margin: 0 0 6px;
	color: var(--mj-dark);
	position: relative;
	display: inline-block;
	padding-bottom: 10px;
}
.mj-section-head h2::after {
	content: "";
	position: absolute;
	inset-inline-start: 50%;
	transform: translateX(50%);
	bottom: 0;
	width: 64px;
	height: 4px;
	border-radius: 4px;
	background: var(--mj-primary);
}
html[dir="ltr"] .mj-section-head h2::after { transform: translateX(-50%); }
.mj-section-head p { margin: 6px 0 0; color: var(--mj-muted); }

.mj-btn-outline {
	display: inline-block;
	margin-top: 24px;
	border: 2px solid var(--mj-primary);
	color: var(--mj-primary);
	border-radius: 999px;
	padding: 10px 32px;
	font-weight: 700;
	transition: .2s;
}
.mj-btn-outline:hover { background: var(--mj-primary); color: #fff; opacity: 1; }

/* ---------------- Category cards */
.mj-cats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}
.mj-cat-card {
	position: relative;
	border-radius: var(--mj-radius);
	overflow: hidden;
	background-size: cover;
	background-position: center;
	min-height: 200px;
	display: flex;
	box-shadow: var(--mj-shadow);
}
.mj-cat-overlay {
	margin-top: auto;
	width: 100%;
	padding: 40px 16px 16px;
	background: linear-gradient(to top, rgba(15, 23, 42, .85), transparent);
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.mj-cat-name { color: #fff; font-weight: 800; font-size: 18px; }
.mj-cat-btn {
	align-self: flex-start;
	background: var(--mj-primary);
	color: #fff;
	border-radius: 999px;
	padding: 4px 16px;
	font-size: 13px;
	font-weight: 700;
}

/* ---------------- Features strip */
.mj-features-strip { background: var(--mj-dark); color: #fff; padding-block: 32px; }
.mj-features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.mj-feature { display: flex; flex-direction: column; gap: 2px; }
.mj-feature span { font-size: 30px; }
.mj-feature small { color: #94a3b8; }

/* =========================================================
   WooCommerce
   ========================================================= */
.mj-shop { padding-block: 32px; }

.woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
	margin: 0 0 32px !important;
	padding: 0;
	list-style: none;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	background: var(--mj-card);
	border-radius: var(--mj-radius);
	box-shadow: var(--mj-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-align: center;
	transition: transform .15s, box-shadow .15s;
	position: relative;
	padding-bottom: 16px !important;
}
.woocommerce ul.products li.product:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}
.woocommerce ul.products li.product img { margin: 0 !important; aspect-ratio: 1; object-fit: contain; padding: 12px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 15px !important;
	font-weight: 700;
	padding: 4px 12px !important;
	color: var(--mj-text);
	min-height: 48px;
}
.woocommerce ul.products li.product .price {
	color: var(--mj-primary) !important;
	font-weight: 800;
	font-size: 17px !important;
	margin-bottom: 10px !important;
}
.woocommerce ul.products li.product .price del { color: var(--mj-muted); font-weight: 400; font-size: 14px; }
.woocommerce ul.products li.product .star-rating { margin: 4px auto 6px !important; }

.woocommerce ul.products li.product .button.mj-loop-buy,
.mj-loop-buy {
	margin: 4px auto 0 !important;
	background: var(--mj-buy) !important;
	color: #fff !important;
	border-radius: 999px !important;
	font-weight: 700 !important;
	padding: 9px 28px !important;
	transition: .15s;
}
.mj-loop-buy:hover { filter: brightness(1.08); }

.woocommerce span.onsale {
	background: #dc2626 !important;
	border-radius: 6px !important;
	font-weight: 800;
	min-height: 0 !important;
	min-width: 0 !important;
	line-height: 1 !important;
	padding: 6px 10px !important;
	inset-inline-start: 10px;
	inset-inline-end: auto;
	top: 10px !important;
	z-index: 5;
}

/* ---------------- Single product */
.woocommerce div.product div.summary { margin-bottom: 32px; }
.woocommerce div.product .product_title { font-size: 26px; font-weight: 800; color: var(--mj-dark); }
.woocommerce div.product p.price { color: var(--mj-primary) !important; font-size: 26px !important; font-weight: 800; }
.woocommerce div.product p.price del { font-size: 18px; color: var(--mj-muted); }

/* ---------------- COD order form */
.mj-order-box {
	background: #fff;
	border: 2px solid var(--mj-primary);
	border-radius: var(--mj-radius);
	padding: 20px;
	margin-block: 20px;
	box-shadow: var(--mj-shadow);
}
.mj-order-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: -20px -20px 18px;
	padding: 14px 20px;
	background: var(--mj-primary);
	color: #fff;
	font-size: 17px;
	font-weight: 800;
	border-radius: 9px 9px 0 0;
}
.mj-field { margin-bottom: 14px; }
.mj-field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.mj-field .req { color: #dc2626; }
.mj-field input,
.mj-field select {
	width: 100%;
	border: 1.5px solid var(--mj-border);
	border-radius: 8px;
	padding: 11px 12px;
	font-family: inherit;
	font-size: 15px;
	background: #fafafa;
	transition: border-color .15s;
}
.mj-field input:focus,
.mj-field select:focus { outline: none; border-color: var(--mj-primary); background: #fff; }
.mj-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mj-hp { position: absolute !important; inset-inline-start: -9999px; }

/* Quantity stepper */
.mj-qty { display: inline-flex; border: 1.5px solid var(--mj-border); border-radius: 8px; overflow: hidden; }
.mj-qty button {
	width: 42px;
	border: 0;
	background: #f3f4f6;
	font-size: 20px;
	cursor: pointer;
	font-family: inherit;
}
.mj-qty input {
	width: 64px;
	border: 0;
	text-align: center;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	-moz-appearance: textfield;
}
.mj-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Quantity offers */
.mj-offers { margin-bottom: 14px; }
.mj-offers-title { font-weight: 800; margin: 0 0 8px; }
.mj-offer {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1.5px solid var(--mj-border);
	border-radius: 8px;
	padding: 10px 12px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: .15s;
	background: #fafafa;
}
.mj-offer.selected { border-color: var(--mj-buy); background: #f0fdf4; box-shadow: 0 0 0 1px var(--mj-buy); }
.mj-offer-label { flex: 1; font-weight: 600; font-size: 14px; }
.mj-offer-price { font-weight: 800; color: var(--mj-buy); }

/* Order summary */
.mj-summary { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 15px; }
.mj-summary td { padding: 7px 4px; border-bottom: 1px dashed var(--mj-border); }
.mj-summary td:last-child { text-align: end; font-weight: 700; }
.mj-sum-total-row td { font-size: 18px; font-weight: 800; color: var(--mj-primary); border-bottom: 0; }

/* Submit */
.mj-submit-btn {
	width: 100%;
	border: 0;
	background: var(--mj-buy);
	color: #fff;
	font-family: inherit;
	font-size: 18px;
	font-weight: 800;
	border-radius: 999px;
	padding: 15px;
	cursor: pointer;
	transition: .15s;
	animation: mj-pulse 2s infinite;
}
.mj-submit-btn:hover { filter: brightness(1.08); }
.mj-submit-btn:disabled { opacity: .6; cursor: wait; animation: none; }
@keyframes mj-pulse {
	0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); }
	70% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); }
	100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.mj-cod-note { text-align: center; font-size: 13px; color: var(--mj-muted); margin: 10px 0 0; }
.mj-form-msg { display: none; margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.mj-form-msg.error { display: block; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Trust badges */
.mj-trust { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.mj-trust-item {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--mj-border);
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 13px;
	font-weight: 600;
}
.mj-trust-item span { font-size: 20px; }

/* ---------------- Success modal */
.mj-modal {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, .6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 16px;
}
.mj-modal[hidden] { display: none; }
.mj-modal-card {
	background: #fff;
	border-radius: 16px;
	max-width: 420px;
	width: 100%;
	padding: 32px 24px;
	text-align: center;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
}
.mj-modal-check {
	width: 70px;
	height: 70px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--mj-buy);
	color: #fff;
	font-size: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.mj-modal-card h3 { margin: 0 0 8px; font-size: 22px; color: var(--mj-dark); }
.mj-modal-card p { color: var(--mj-muted); margin: 0 0 12px; }
.mj-modal-summary { background: #f8fafc; border-radius: 8px; padding: 10px; font-weight: 700; margin-bottom: 16px; }
.mj-modal-summary:empty { display: none; }
.mj-modal-close {
	border: 0;
	background: var(--mj-dark);
	color: #fff;
	border-radius: 999px;
	padding: 10px 36px;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
}

/* ---------------- Sticky buy bar */
.mj-sticky-buy {
	position: fixed;
	bottom: 0;
	inset-inline: 0;
	background: #fff;
	box-shadow: 0 -4px 16px rgba(15, 23, 42, .12);
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 16px;
	z-index: 900;
}
.mj-sticky-buy[hidden] { display: none; }
.mj-sticky-info { display: flex; flex-direction: column; min-width: 0; }
.mj-sticky-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mj-sticky-price { color: var(--mj-primary); font-weight: 800; }
.mj-sticky-price del { color: var(--mj-muted); font-weight: 400; font-size: 13px; }
.mj-sticky-btn {
	margin-inline-start: auto;
	border: 0;
	background: var(--mj-buy);
	color: #fff;
	font-family: inherit;
	font-weight: 800;
	font-size: 16px;
	border-radius: 999px;
	padding: 12px 28px;
	cursor: pointer;
	white-space: nowrap;
}

/* ---------------- WhatsApp button */
.mj-whatsapp {
	position: fixed;
	bottom: 84px;
	inset-inline-end: 18px;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: #25d366;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	z-index: 901;
}

/* ---------------- Footer */
.mj-footer { background: var(--mj-dark); color: #cbd5e1; margin-top: 48px; }
.mj-footer a { color: #e2e8f0; }
.mj-footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
	padding-block: 40px 24px;
}
.footer-widget-title { color: #fff; font-size: 17px; margin: 0 0 12px; }
.mj-footer-social { border-top: 1px solid rgba(255, 255, 255, .08); }
.mj-footer-social .mj-container { display: flex; justify-content: center; gap: 18px; padding-block: 16px; }
.mj-footer-social a { color: #94a3b8; }
.mj-footer-social a:hover { color: #fff; }
.mj-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); text-align: center; font-size: 14px; padding-block: 16px; }

/* ---------------- Pages & posts */
.mj-page { padding-block: 32px; }
.mj-article { background: #fff; border-radius: var(--mj-radius); box-shadow: var(--mj-shadow); padding: 28px; margin-bottom: 24px; }
.mj-page-title { margin-top: 0; color: var(--mj-dark); }

/* ---------------- Landing template */
body.mj-landing { background: #fff; }
.mj-landing-main { max-width: 100%; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
	.woocommerce ul.products { grid-template-columns: repeat(3, 1fr); }
	.mj-cats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.mj-header-inner { flex-wrap: wrap; gap: 12px; }
	.mj-logo { order: 1; }
	.mj-header-contact { order: 2; margin-inline-start: auto; }
	.mj-search { order: 3; flex-basis: 100%; max-width: none; }
	.mj-header-phone span { display: none; }
	.mj-menu-toggle { display: flex; }

	.mj-nav { display: none; }
	.mj-nav.open { display: block; }
	.mj-nav-list { flex-direction: column; }
	.mj-nav-list .sub-menu { position: static; display: block; padding-inline-start: 16px; }

	.woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.mj-features-grid { grid-template-columns: repeat(2, 1fr); }
	.mj-field-row { grid-template-columns: 1fr; }
	.mj-section-head h2 { font-size: 22px; }

	.mj-sticky-info { display: none; }
	.mj-sticky-btn { flex: 1; }
}

@media (max-width: 420px) {
	.mj-cats-grid { grid-template-columns: 1fr; }
}
