/*
Theme Name: Injaz Al Fakhr
Theme URI: https://example.invalid/
Author: Injaz Al Fakhr
Description: Lightweight industrial theme for Injaz Al Fakhr (scrap & used equipment). Arabic RTL by default, English LTR via TranslatePress. Requires WooCommerce and the "Injaz Al Fakhr Core" plugin.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: injaz-fakhr
*/

/* ---------- Tokens ---------- */
:root {
	--navy: #062449;
	--navy-2: #0b3566;
	--ink: #0f1b2b;
	--steel: #4f5b6b;
	--line: #d6dce4;
	--bg: #ffffff;
	--bg-alt: #f2f4f7;
	--accent: #f0a202;      /* safety amber, from the equipment photos */
	--accent-ink: #1b1300;
	--ok: #1f8f4e;
	--radius: 8px;
	--shadow: 0 1px 2px rgba(6, 36, 73, .06), 0 6px 20px rgba(6, 36, 73, .06);
	--font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
	--wrap: 1180px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--ink); background: var(--bg); }
img, video { max-width: 100%; height: auto; }
a { color: var(--navy-2); }
a:hover { color: var(--navy); }
h1, h2, h3, h4 { line-height: 1.3; color: var(--navy); margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.center { text-align: center; }
.small { font-size: .875rem; }
.icon { flex: none; vertical-align: middle; }
.skip-link { position: absolute; top: 0; inset-inline-start: 8px; z-index: 100; background: #fff; padding: .5rem 1rem; transform: translateY(-120%); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- Buttons ---------- */
.btn, .button, .wp-element-button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	min-height: 46px; padding: .65rem 1.3rem; border-radius: var(--radius);
	border: 2px solid var(--navy); background: var(--navy); color: #fff;
	font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}
.btn:hover, .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn--lg { min-height: 54px; padding: .8rem 1.6rem; font-size: 1.08rem; }
.btn--light { background: #fff; color: var(--navy); border-color: #fff; }
.btn--light:hover { background: transparent; color: #fff; border-color: #fff; }
.btn--accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--accent:hover { background: #ffb81c; border-color: #ffb81c; color: var(--accent-ink); }
.woocommerce a.button.alt, .woocommerce button.button.alt, .injaz-quote-btn.alt { background: var(--navy); border-color: var(--navy); color: #fff; }
.injaz-quote-btn { background: var(--ok); border-color: var(--ok); color: #fff; }
.woocommerce a.button.injaz-quote-btn, .woocommerce .injaz-quote-btn.alt { background: var(--ok); border-color: var(--ok); }
.link-more { font-weight: 700; text-decoration: none; }
.link-more::after { content: " ←"; }
.dir-ltr .link-more::after { content: " →"; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--ink); color: #dfe6ef; font-size: .875rem; }
.topbar__in { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 1rem; }
.topbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.topbar__contact { display: flex; gap: 1.25rem; }
.lang-switch { font-weight: 700; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 2px 10px; }

.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
.site-header__in { display: flex; align-items: center; gap: 1rem; min-height: 76px; }
.site-brand img { display: block; height: 54px; width: auto; }
.site-nav { margin-inline-start: auto; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav .menu a { display: block; padding: .55rem .65rem; border-radius: 6px; color: var(--ink); font-weight: 500; text-decoration: none; }
.site-nav .menu a:hover, .site-nav .current-menu-item > a { color: var(--navy); background: var(--bg-alt); }
.site-nav .sub-menu { display: none; }
.site-nav__extra { display: none; }
.site-actions { display: flex; align-items: center; gap: .25rem; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--navy); background: transparent; border: 0; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn .icon { width: 22px; height: 22px; }
.cart-count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
	.nav-toggle { display: inline-grid; }
	.site-brand img { height: 44px; }
	.site-header__in { min-height: 64px; }
	.site-nav { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(86vw, 340px); background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,.15); padding: 80px 16px 24px; transform: translateX(110%); transition: transform .22s ease; z-index: 60; overflow-y: auto; margin: 0; }
	.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(6,36,73,.45); z-index: 55; }
	.nav-open .site-header { z-index: 70; }
	.nav-open .nav-toggle { position: relative; z-index: 80; }
	.site-nav .menu { flex-direction: column; }
	.site-nav .menu a { padding: .85rem .75rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
	.site-nav__extra { display: block; margin-top: 1rem; }
	.site-nav__extra .lang-switch { display: inline-block; color: var(--navy); border-color: var(--line); padding: .5rem 1rem; text-decoration: none; }
}
/* Off-canvas direction: RTL panel comes from the left edge (end side). */
@media (max-width: 960px) {
	.dir-rtl .site-nav { inset-inline-end: 0; left: 0; right: auto; transform: translateX(-110%); }
	.dir-ltr .site-nav { right: 0; left: auto; transform: translateX(110%); }
	.nav-open.dir-rtl .site-nav, .nav-open.dir-ltr .site-nav { transform: none; }
}
@media (max-width: 600px) {
	.topbar__contact a:nth-child(2) span { display: none; }
	.admin-bar .site-header { top: 0; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--navy) var(--hero) center / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,36,73,.94) 0%, rgba(6,36,73,.82) 45%, rgba(6,36,73,.45) 100%); }
.dir-rtl .hero::before { background: linear-gradient(270deg, rgba(6,36,73,.94) 0%, rgba(6,36,73,.82) 45%, rgba(6,36,73,.45) 100%); }
.hero__in { position: relative; padding-block: clamp(3rem, 9vw, 6.5rem); max-width: var(--wrap); }
.hero .eyebrow { display: inline-block; font-weight: 700; color: var(--accent); margin-bottom: .75rem; letter-spacing: .02em; }
.hero__title { color: #fff; font-size: clamp(1.9rem, 4.6vw, 3.1rem); max-width: 17ch; margin-bottom: .5em; }
.hero__lead { font-size: clamp(1.02rem, 2vw, 1.2rem); max-width: 46ch; color: #e6edf6; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero__contact { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.5rem; }
.hero__contact a { color: #fff; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; }
@media (max-width: 600px) {
	.hero__ctas .btn { flex: 1 1 100%; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--alt { background: var(--bg-alt); }
.section__title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.2rem; position: relative; padding-bottom: .5rem; }
.section__title::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 56px; height: 4px; background: var(--accent); border-radius: 2px; }
.center .section__title::after, .steps .section__title::after, .services-teaser .section__title::after, .shop-teaser .section__title::after, .contact-cards .section__title::after { inset-inline-start: 50%; transform: translateX(-50%); }
.dir-rtl .steps .section__title::after, .dir-rtl .services-teaser .section__title::after, .dir-rtl .shop-teaser .section__title::after, .dir-rtl .contact-cards .section__title::after { transform: translateX(50%); }
.steps .section__title, .services-teaser .section__title, .shop-teaser .section__title, .contact-cards .section__title, .gallery-teaser .section__title { text-align: center; }
.gallery-teaser .section__title::after { inset-inline-start: 50%; transform: translateX(-50%); }
.dir-rtl .gallery-teaser .section__title::after { transform: translateX(50%); }
.section__sub { font-size: 1.25rem; margin-top: 2rem; }

.steps__list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; counter-reset: s; }
.steps__list li { position: relative; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; counter-increment: s; }
.steps__list li::before { content: counter(s); position: absolute; top: 1rem; inset-inline-end: 1rem; font-size: 2.2rem; font-weight: 700; color: var(--line); line-height: 1; }
.steps__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--navy); color: #fff; margin-bottom: .75rem; }
.steps__icon .icon { width: 24px; height: 24px; }
.steps__list h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.steps__list p { margin: 0; color: var(--steel); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.split__media img { border-radius: var(--radius); display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card__body { padding: 1rem 1.1rem 1.2rem; }
.card__body h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.card__body p { margin: 0; color: var(--steel); font-size: .95rem; }

.cat-tiles { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.cat-tiles a { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--navy); min-height: 140px; text-decoration: none; }
.cat-tiles img { display: block; width: 100%; height: 170px; object-fit: cover; opacity: .55; }
.cat-tiles span { position: absolute; inset-inline: 0; bottom: 0; padding: .8rem 1rem; color: #fff; font-weight: 700; font-size: 1.1rem; background: linear-gradient(0deg, rgba(6,36,73,.9), transparent); }

.cta-band { background: var(--navy); color: #fff; padding-block: 2.5rem; border-top: 4px solid var(--accent); }
.cta-band__in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .25rem; font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
.cta-band p { margin: 0; color: #d5deea; }

.ccards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ccard { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; }
.ccard h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.ccard p { margin: 0 0 .3rem; }
.ccard a { font-weight: 700; text-decoration: none; }
.ccard__icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-alt); color: var(--navy); margin-bottom: .6rem; }
.ccard__icon--wa { background: #e3f5ea; color: var(--ok); }

/* ---------- Inner pages ---------- */
.page-head { background: var(--navy); color: #fff; padding-block: clamp(1.75rem, 4vw, 2.75rem); border-bottom: 4px solid var(--accent); }
.page-head__title { color: #fff; margin: 0; font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.page-body { padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-body--narrow .entry-content { max-width: 820px; }
.entry-content h2 { font-size: 1.45rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.2rem; margin-top: 1.4em; }
.entry-content ul { padding-inline-start: 1.3rem; }
.entry-content li { margin-bottom: .35rem; }
.entry-content .wp-block-columns { gap: 1rem; }
.entry-content .wp-block-column { background: var(--bg-alt); border-radius: var(--radius); padding: 1.25rem; }
.entry-content .wp-block-column h3 { margin-top: 0; }

/* ---------- Forms (scrap form inherits from plugin css) ---------- */
.injaz-form { margin-top: 1rem; }
.injaz-btn--primary { min-width: 220px; }
input, select, textarea { font-family: inherit; }

/* ---------- WooCommerce ---------- */
.shop-wrap .woocommerce-products-header__title { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.woocommerce .woocommerce-breadcrumb { font-size: .875rem; color: var(--steel); margin-bottom: 1rem; }
.woocommerce ul.products, .woocommerce-page ul.products { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 0 0 1.5rem !important; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: 0 0 1rem !important; text-align: start; }
.woocommerce ul.products li.product a img { margin: 0 0 .75rem; aspect-ratio: 1; object-fit: cover; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 1.02rem !important; color: var(--ink); padding: 0 1rem !important; }
.woocommerce ul.products li.product .price { color: var(--navy) !important; font-weight: 700; font-size: 1.05rem !important; padding: 0 1rem; display: block; }
.woocommerce ul.products li.product .button { margin: auto 1rem 0 !important; }
.injaz-price-note { color: var(--steel); font-weight: 500; font-size: .95rem; }
@media (max-width: 900px) { .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(2, 1fr); gap: .75rem; } }
@media (max-width: 420px) {
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: .95rem !important; padding: 0 .6rem !important; }
	.woocommerce ul.products li.product .price { padding: 0 .6rem; font-size: .95rem !important; }
	.woocommerce ul.products li.product .button { margin: auto .6rem 0 !important; font-size: .85rem; padding: .5rem .6rem; }
}
.woocommerce div.product .product_title { font-size: clamp(1.5rem, 3vw, 2rem); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--navy); font-weight: 700; font-size: 1.4rem; }
.woocommerce div.product form.cart { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.woocommerce div.product form.cart div.quantity { margin: 0 !important; }
.woocommerce .quantity .qty { min-height: 46px; width: 4.5em; border: 1px solid var(--line); border-radius: var(--radius); font-size: 1rem; }
.injaz-quote { margin: 1rem 0 1.5rem; }
.injaz-quote__hint { color: var(--steel); font-size: .92rem; margin-top: .6rem; }
.woocommerce span.onsale { background: var(--accent); color: var(--accent-ink); }
.woocommerce-message, .woocommerce-info { border-top-color: var(--navy) !important; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--navy) !important; }
.woocommerce .woocommerce-ordering select, .woocommerce form .form-row input.input-text, .woocommerce form .form-row select, .woocommerce form .form-row textarea { min-height: 46px; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; font-size: 16px; }
.woocommerce-account .woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.woocommerce-account .woocommerce-MyAccount-navigation li a { display: block; padding: .7rem 1rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a { background: var(--navy); color: #fff; }
.page-body--wc .wc-block-components-button:not(.is-link) { background: var(--navy); color: #fff; border-radius: var(--radius); min-height: 50px; }
.page-body--wc .wc-block-components-button:not(.is-link):hover { background: var(--navy-2); }
@media (max-width: 768px) {
	.woocommerce div.product div.images, .woocommerce div.product div.summary { width: 100% !important; float: none !important; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c7d1de; margin-top: 0; }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 2rem; padding-block: 3rem 2rem; }
.site-footer .custom-logo { height: 58px; width: auto; display: block; margin-bottom: 1rem; }
.site-footer__title { color: #fff; font-size: 1.05rem; margin-bottom: .8rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .menu { list-style: none; margin: 0; padding: 0; }
.site-footer .menu li { margin-bottom: .4rem; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: .55rem; }
.contact-list .icon { margin-top: 4px; color: var(--accent); }
.social { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-block: 1rem; font-size: .875rem; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr; } }

.wa-float { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.wa-float .icon { width: 30px; height: 30px; }
.woocommerce-cart .wa-float, .woocommerce-checkout .wa-float { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.page-template-template-contact .contact-cards .section__title { display: none; }
.page-template-template-contact .contact-cards { padding-top: 0; }
.page-body--narrow .entry-content:has(.injaz-gallery) { max-width: none; }
