/*
Theme Name: النور الباهر
Theme URI: https://www.alnoor-albaher.com
Author: النور الباهر
Description: قالب مخصص لشركة النور الباهر للمعدات والمواد الزراعية. عرض المنتجات وأقسامها، صفحة تواصل بنموذج رسائل، متجاوب مع الحاسوب والموبايل والأجهزة القابلة للطي.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: alnoor
*/

:root {
	--blue: #008FD5;
	--navy: #014463;
	--light: #E3F3FC;
	--pale: #F4FAFE;
	--line: #D5E7F3;
	--text: #33475B;
	--muted: #4A5D70;
	--warn-bg: #FFF4E5;
	--warn: #8A4B00;
	--radius: 22px;
	--wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
	color: var(--navy);
	background: #fff;
	direction: rtl;
	line-height: 1.7;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
h1, h2, h3 { line-height: 1.35; margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; right: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: #fff; padding: 10px 16px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border-radius: 14px; font-weight: 800; font-size: 17px; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--light); color: var(--navy); }
.btn-outline-white { border-color: #fff; color: #fff; }
.btn-outline-white:hover { background: #fff; color: var(--navy); }
.btn-outline { border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 14px; font-size: 14px; font-weight: 700; background: var(--light); color: var(--navy); text-decoration: none; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }

/* Top bar + header */
.topbar { background: var(--blue); color: #fff; font-size: 14px; }
.topbar .wrap { padding-block: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; }
.topbar a { color: #fff; }
.site-header { border-bottom: 3px solid var(--blue); background: #fff; position: relative; z-index: 20; }
.site-header .wrap { padding-block: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; line-height: 1.3; }
.brand img, .brand .custom-logo { width: auto; height: 62px; }
.brand-name { display: block; font-size: 34px; font-weight: 800; color: var(--blue); }
.brand-tag { display: block; font-size: 15px; color: var(--text); font-weight: 600; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav a { display: block; padding: 10px 18px; border-radius: 999px; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 16px; }
.main-nav a:hover { background: var(--light); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a, .main-nav .current-menu-ancestor > a, .main-nav a[aria-current="page"] { background: var(--blue); color: #fff; }
.nav-toggle { display: none; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 2px solid var(--blue); border-radius: 14px; background: #fff; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
	.brand-name { font-size: 26px; }
	.brand img, .brand .custom-logo { height: 50px; }
	.nav-toggle { display: inline-flex; }
	.main-nav { flex-basis: 100%; display: none; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 2px; padding-bottom: 6px; }
	.main-nav a { border-radius: 12px; padding: 12px 16px; }
}

/* Hero */
.hero { background: var(--blue); color: #fff; border-radius: 0 0 48px 48px; }
.hero .wrap { padding-block: 56px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 800; }
.hero p { margin: 0; font-size: 18px; line-height: 1.9; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-side { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hero-img { width: 100%; max-height: 380px; object-fit: contain; }
.agency-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.agency-card { background: #fff; color: var(--navy); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.agency-card small { color: var(--blue); font-weight: 700; font-size: 13px; }
.agency-card strong { font-size: 18px; }
.agency-card span { font-size: 13px; color: var(--muted); }

/* Sections */
.section { padding-block: 56px 24px; }
.section-title { font-size: clamp(26px, 2.8vw, 34px); font-weight: 800; border-right: 6px solid var(--blue); border-radius: 3px; padding-right: 14px; margin-bottom: 20px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; }
.section-head .section-title { margin-bottom: 0; }

/* Category table -> cards on small screens */
.cat-table { border: 2px solid var(--blue); border-radius: var(--radius); overflow: hidden; }
.cat-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 2fr); border-top: 1px solid var(--line); text-decoration: none; color: var(--navy); font-size: 16px; }
.cat-row:nth-child(odd) { background: var(--pale); }
.cat-row > * { padding: 16px 12px; }
.cat-row > * + * { border-right: 1px solid var(--line); }
.cat-row .num { text-align: center; font-weight: 800; color: var(--blue); }
.cat-row strong { font-size: 18px; }
.cat-row .desc { color: var(--muted); }
a.cat-row:hover { background: var(--light); }
.cat-head { background: var(--blue) !important; color: #fff; font-weight: 800; border-top: 0; }
.cat-head > * + * { border-right-color: rgba(255,255,255,.3); }
@media (max-width: 640px) {
	.cat-table { border: 0; border-radius: 0; overflow: visible; display: grid; gap: 12px; }
	.cat-head { display: none; }
	.cat-row { grid-template-columns: 48px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 18px; background: #fff !important; }
	.cat-row > * + * { border-right: 0; }
	.cat-row .num { grid-row: span 2; display: flex; align-items: center; justify-content: center; background: var(--light); border-radius: 0 16px 16px 0; }
	.cat-row strong { padding-bottom: 0; }
	.cat-row .desc { padding-top: 0; font-size: 15px; }
}

/* Product cards */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: var(--radius); box-shadow: 0 2px 12px rgba(1, 68, 99, .08); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.product-card .thumb { display: block; border-radius: 16px; overflow: hidden; background: var(--light); aspect-ratio: 4 / 3; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .meta { font-size: 13px; color: var(--blue); font-weight: 700; }
.product-card h3 { font-size: 18px; font-weight: 800; }
.product-card h3 a { color: var(--navy); text-decoration: none; }
.product-card .more { margin-top: auto; font-weight: 700; font-size: 15px; }

/* About */
.about { background: var(--pale); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 40px; }
.about .wrap { padding-block: 56px; display: flex; flex-wrap: wrap; gap: 40px; }
.about-text { flex: 2 1 420px; min-width: 0; }
.about-text p { font-size: 17px; line-height: 2; color: var(--text); }
.stats { flex: 1 1 280px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.stat { background: #fff; border-radius: 18px; padding: 18px; }
.stat strong { display: block; font-size: 30px; color: var(--blue); line-height: 1.3; }
.stat span { font-size: 14px; color: var(--muted); }

/* Contact strip */
.cta-strip { border: 2px solid var(--blue); border-radius: 28px; overflow: hidden; display: flex; flex-wrap: wrap; }
.cta-strip h2 { background: var(--blue); color: #fff; padding: 22px 28px; font-size: 22px; font-weight: 800; display: flex; align-items: center; }
.cta-strip .body { flex: 1 1 320px; padding: 22px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta-strip p { margin: 0; font-size: 17px; color: var(--text); }

/* Footer */
.site-footer { border-top: 3px solid var(--blue); margin-top: 56px; }
.site-footer .wrap { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer nav a { color: var(--muted); text-decoration: none; }

/* Page header (inner pages) */
.page-hero { background: var(--blue); color: #fff; border-radius: 0 0 48px 48px; }
.page-hero .wrap { padding-block: 44px 88px; display: flex; flex-direction: column; gap: 10px; }
.page-hero h1 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; }
.page-hero p { margin: 0; font-size: 18px; max-width: 680px; line-height: 1.9; }
.page-hero.small .wrap { padding-block: 36px 40px; }
.breadcrumbs { font-size: 14px; color: var(--muted); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs a { text-decoration: none; }

/* Single product */
.product-top { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-block: 24px 48px; }
.gallery { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gallery-main { border-radius: 28px; overflow: hidden; background: var(--light); aspect-ratio: 5 / 4; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.thumbs button { padding: 0; border: 3px solid transparent; border-radius: 14px; overflow: hidden; background: var(--light); cursor: pointer; aspect-ratio: 1 / 1; }
.thumbs button[aria-pressed="true"] { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.product-info h1 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; }
.product-info .content { font-size: 17px; line-height: 2; color: var(--text); }
.inquiry-box { background: var(--pale); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.inquiry-box p { margin: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.specs { border: 2px solid var(--blue); border-radius: var(--radius); overflow: hidden; max-width: 820px; }
.specs div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); font-size: 16px; }
.specs div + div { border-top: 1px solid var(--line); }
.specs dt, .specs dd { margin: 0; padding: 14px 18px; }
.specs dt { background: var(--pale); font-weight: 700; }
.specs dd { color: var(--text); }
.related { background: var(--pale); border-top: 1px solid var(--line); margin-top: 48px; padding-block: 48px; }

/* Archive filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--navy); font-weight: 700; }
.filters a.active, .filters a:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }
.empty { background: var(--pale); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

/* Contact page */
.contact-layout { margin-top: -64px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; position: relative; }
.contact-card { flex: 2 1 480px; min-width: 0; background: #fff; border-radius: 28px; box-shadow: 0 6px 28px rgba(1, 68, 99, .12); padding: clamp(22px, 3.5vw, 40px); }
.contact-aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.contact-aside .box { background: var(--light); border-radius: 24px; padding: 24px; }
.contact-aside .box strong { display: block; font-size: 18px; margin-bottom: 6px; }
.contact-aside .box p { margin: 0; color: var(--text); line-height: 1.9; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 700; }
.field input, .field select, .field textarea { min-height: 50px; border: 1px solid #BFDCEE; border-radius: 14px; padding: 10px 16px; font: inherit; font-size: 16px; color: var(--navy); background: #F7FBFE; width: 100%; }
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.form-foot small { color: var(--muted); font-size: 14px; }
.hp-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); opacity: 0; pointer-events: none; }
.notice { border-radius: 16px; padding: 16px 18px; font-weight: 700; margin-bottom: 18px; }
.notice-ok { background: #E3F3FC; color: var(--navy); }
.notice-err { background: #FDECEC; color: #8A1C1C; }

/* Generic content */
.entry { font-size: 17px; line-height: 2; color: var(--text); padding-block: 32px; }
.entry h2, .entry h3 { color: var(--navy); margin: 1.2em 0 .4em; }
