:root { --blue: #0022EE; --blue-dark: #0018b3; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc; }
.furnado-page *, .furnado-page *::before, .furnado-page *::after { box-sizing: border-box; margin: 0; padding: 0; }
body.furnado-page { margin: 0; font-family: 'Cairo', sans-serif; background: var(--bg); color: var(--ink); direction: rtl; text-align: right; overflow-x: hidden; }
.furnado-page :is(input, select, textarea, button) { font-family: inherit; }
.furnado-page [hidden] { display: none !important; }
.furnado-page img { max-width: 100%; display: block; }
.furnado-page :focus-visible { outline: 3px solid rgba(0,34,238,.45); outline-offset: 2px; }
[class*="whatsapp"], [id*="whatsapp"], .joinchat, .qlwapp { display: none !important; visibility: hidden !important; }

/* الهيدر */
.furnado-nav { position: sticky; top: 0; z-index: 999; display: flex; justify-content: space-between; align-items: center; padding: 15px 6%; background: #fff; box-shadow: 0 2px 15px rgba(0,0,0,.05); }
.admin-bar .furnado-nav { top: 32px; }
.furnado-brand { font-size: 24px; font-weight: 900; color: var(--blue); text-decoration: none; }
.furnado-links { display: flex; gap: 22px; align-items: center; }
.furnado-links a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.furnado-links a:hover, .furnado-links a.active { color: var(--blue); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; font-size: 28px; color: var(--blue); cursor: pointer; }

.section-hero { min-height: 320px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; color: #fff; background: linear-gradient(rgba(9,13,22,.7), rgba(9,13,22,.7)), url('https://images.unsplash.com/photo-1556911220-e15b29be8c8f?auto=format&fit=crop&w=1920&q=80') center/cover; }
.hero-content { animation: fadeUp .8s ease both; }
.hero-content h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 900; line-height: 1.5; }
.hero-content p { max-width: 640px; color: #cbd5e1; line-height: 1.9; }
.container { max-width: 1200px; margin: 0 auto; padding: 36px 20px 80px; }

/* الأزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer; transition: background .25s, transform .25s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { background: #eff6ff; }
.btn-danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.admin-actions .btn { width: 100%; }
.notice { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-weight: 700; line-height: 1.8; }
.notice-success { background: #d1fae5; color: #065f46; }
.notice-error { background: #fee2e2; color: #991b1b; }

/* لوحة الأدمن */
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 40px rgba(15,23,42,.06); margin-bottom: 40px; overflow: hidden; scroll-margin-top: 110px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; padding: 22px 28px; background: linear-gradient(270deg, #eef2ff, #fff); }
.panel-head h2 { font-size: 22px; font-weight: 900; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; }
#product-fields { padding: 8px 28px 28px; animation: fadeUp .4s ease both; }
.admin-panel fieldset { border: 0; border-bottom: 1px solid var(--line); padding: 22px 0 8px; min-width: 0; }
.admin-panel legend { float: right; width: 100%; font-size: 16px; font-weight: 800; margin-bottom: 18px; }
.admin-panel legend + * { clear: both; }
.admin-panel legend b { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 8px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: block; font-size: 13px; font-weight: 700; margin-bottom: 16px; min-width: 0; }
.field em { color: #dc2626; font-style: normal; }
.field input:not([type="radio"]):not([type="file"]), .field select, .field textarea { display: block; width: 100%; height: auto; margin-top: 7px; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; }
.field textarea { resize: vertical; line-height: 1.8; }
.field :is(input, select, textarea):focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,34,238,.12); outline: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip { cursor: pointer; position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip > span { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 18px; border: 1px solid #cbd5e1; border-radius: 30px; transition: .2s; }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(0,34,238,.45); outline-offset: 2px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); background-size: cover; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 130px; margin-top: 8px; padding: 18px; text-align: center; border: 2px dashed #a5b4fc; border-radius: 14px; background: #f8faff; cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--blue); background: #eef2ff; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone small { color: var(--muted); font-weight: 400; }
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.thumb { position: relative; width: 112px; font-size: 12px; }
.thumb img { width: 112px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumb label { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.thumb .remove { color: #b91c1c; }
.thumb:has(.remove input:checked) img { opacity: .35; }
.thumb button { position: absolute; top: -8px; left: -8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: #dc2626; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.btn-save { width: 100%; min-height: 52px; margin-top: 24px; font-size: 16px; }

/* الفلاتر */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 34px; }
.filter { padding: 10px 20px; border-radius: 30px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: .25s; }
.filter:hover { border-color: var(--blue); color: var(--blue); }
.filter.is-active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(0,34,238,.22); }

/* الكروت */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px; }
.product-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; transition: box-shadow .35s; animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) backwards; animation-delay: var(--delay, 0ms); }
.product-card:hover { box-shadow: 0 18px 40px rgba(15,23,42,.12); }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e2e8f0; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.no-image { display: grid; place-items: center; width: 100%; height: 100%; color: #94a3b8; font-size: 28px; font-weight: 900; }
.card-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(9,13,22,.45); opacity: 0; transition: opacity .35s; }
.card-overlay span { padding: 11px 26px; border-radius: 30px; background: #fff; color: var(--ink); font-weight: 800; font-size: 14px; transform: translateY(10px); transition: transform .35s; }
.serial { position: absolute; bottom: 12px; left: 12px; direction: ltr; padding: 2px 12px; border-radius: 8px; background: rgba(15,23,42,.8); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.state-badge { position: absolute; top: 12px; right: 12px; padding: 4px 14px; border-radius: 30px; font-size: 12px; font-weight: 800; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.state-badge.inline { position: static; box-shadow: none; }
.is-new { background: #ecfdf5; color: #047857; }
.is-updated { background: #fffbeb; color: #92400e; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.type-badge { align-self: flex-start; padding: 4px 12px; border-radius: 30px; background: #eef2ff; color: var(--blue); font-size: 12px; font-weight: 800; }
.card-body h3 { margin: 10px 0 14px; font-size: 18px; line-height: 1.6; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-button { margin-top: auto; }
@media (hover: hover) and (min-width: 901px) {
    .product-card:hover img { transform: scale(1.06); }
    .product-card:hover .card-overlay, .card-media:focus-visible .card-overlay { opacity: 1; }
    .product-card:hover .card-overlay span, .card-media:focus-visible .card-overlay span { transform: none; }
    .card-button { display: none; }
}
@media (hover: none), (max-width: 900px) { .card-overlay { display: none; } }
.empty-state { text-align: center; color: var(--muted); padding: 60px 0; animation: fadeUp .5s ease both; }

/* صفحة المنتج */
.back-link { display: inline-block; margin-bottom: 20px; color: var(--blue); font-weight: 700; text-decoration: none; }
.product-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.fade-up { animation: fadeUp .7s ease both; }
.product-info.fade-up { animation-delay: .12s; }
.gallery-main { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 18px; background: #e9eef5; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: opacity .25s; }
.arrow { direction: ltr; unicode-bidi: isolate; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 28px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.arrow.prev { right: 12px; }
.arrow.next { left: 12px; }
.gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 14px 2px 4px; }
.gallery-thumbs button { flex: 0 0 88px; height: 70px; overflow: hidden; border: 3px solid transparent; border-radius: 12px; background: #fff; cursor: pointer; opacity: .65; transition: .2s; }
.gallery-thumbs button.is-active { border-color: var(--blue); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; min-width: 0; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.product-code { margin-right: auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.product-info h1 { margin: 14px 0 20px; font-size: clamp(22px, 3.5vw, 30px); font-weight: 900; line-height: 1.5; overflow-wrap: anywhere; }
.specs { margin-bottom: 24px; }
.specs div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.specs dt { color: var(--muted); font-weight: 700; }
.specs dd { font-weight: 800; overflow-wrap: anywhere; }
.btn-order { width: 100%; min-height: 54px; background: #15803d; color: #fff; font-size: 16px; }
.btn-order:hover { background: #166534; color: #fff; transform: translateY(-2px); }
.description { margin-top: 36px; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 18px; line-height: 2; overflow-wrap: anywhere; }
.description h2 { margin-bottom: 12px; font-size: 20px; }
.description p { margin-bottom: 12px; }
.site-footer { padding: 40px 6%; background: #090d16; color: #94a3b8; text-align: center; font-size: 13px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .furnado-links { display: none; position: absolute; top: 100%; right: 0; left: 0; flex-direction: column; gap: 0; max-height: 75vh; overflow-y: auto; background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,.08); }
    .furnado-links.open { display: flex; }
    .furnado-links a { width: 100%; padding: 14px 6%; border-top: 1px solid #f1f5f9; }
    .product-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 782px) { .admin-bar .furnado-nav { top: 46px; } }
@media (max-width: 600px) {
    .admin-bar .furnado-nav { top: 0; }
    .furnado-nav { padding: 10px 16px; }
    .section-hero { min-height: 230px; }
    .container { padding: 24px 16px 50px; }
    .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 8px; margin-bottom: 22px; }
    .panel-head, #product-fields { padding-right: 16px; padding-left: 16px; }
    .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
    .product-info, .description { padding: 20px 16px; }
    .specs div { grid-template-columns: 100px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .furnado-page *, .furnado-page *::before { animation: none !important; transition: none !important; }
}

/* ───── اللوجو في الهيدر (أقصى الشمال) ───── */
.furnado-nav { gap: 22px; padding-top: 8px; padding-bottom: 8px; min-height: 68px; }
.furnado-links { margin-right: auto; }
.furnado-logo { display: flex; flex: 0 0 auto; }
.furnado-logo img { height: 50px; width: auto; }
@media (max-width: 900px) {
    .furnado-nav { gap: 10px; }
    .furnado-logo { margin-right: auto; }
    .menu-toggle { order: 3; }
    .furnado-logo img { height: 44px; }
}

/* ───── صفحة المقالات ───── */
.blog-hero { background-image: linear-gradient(rgba(9,13,22,.72), rgba(9,13,22,.72)), url('https://images.unsplash.com/photo-1507089947368-19c1da9775ae?auto=format&fit=crop&w=1920&q=80'); }
.blog-search { max-width: 520px; margin: 0 auto 20px; }
.blog-search input { width: 100%; padding: 13px 22px; border: 1px solid #cbd5e1; border-radius: 30px; background: #fff; font-size: 16px; }
.blog-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,34,238,.12); outline: 0; }
.card-text { margin-bottom: 14px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.article-card .card-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.read-more { align-self: flex-start; padding: 10px 0 0; color: var(--blue); font-size: 14px; font-weight: 800; text-decoration: none; }
.product-card:hover .card-media img { transform: scale(1.05); }
@media (min-width: 901px) {
    .articles-grid .article-card.is-featured:not(.is-compact) { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
    .article-card.is-featured:not(.is-compact) .card-media { aspect-ratio: auto; min-height: 380px; }
    .article-card.is-featured:not(.is-compact) .card-media img { position: absolute; inset: 0; }
    .article-card.is-featured:not(.is-compact) .card-body { justify-content: center; padding: 36px; }
    .article-card.is-featured:not(.is-compact) h3 { font-size: 26px; }
    .article-card.is-featured:not(.is-compact) .card-meta { margin-top: 0; }
}
.load-more-wrap { display: flex; justify-content: center; margin-top: 34px; }

/* أزرار تنسيق النص */
.editor-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.editor-bar button { min-height: 38px; padding: 6px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; color: var(--ink); font-size: 13px; cursor: pointer; }
.editor-bar button:hover { border-color: var(--blue); color: var(--blue); }

/* ───── صفحة المقال ───── */
.reading-progress { position: fixed; top: 0; right: 0; left: 0; z-index: 100000; height: 3px; direction: rtl; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--blue); }
.article-page .back-link, .article-box { display: block; max-width: 880px; margin-right: auto; margin-left: auto; }
.article-box { padding: 48px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 40px rgba(15,23,42,.05); }
.article-header h1 { margin: 14px 0; font-size: clamp(24px, 4.5vw, 36px); font-weight: 900; line-height: 1.6; overflow-wrap: anywhere; }
.article-featured { width: 100%; max-height: 520px; object-fit: cover; margin: 26px 0 30px; border-radius: 16px; }
.toc { margin-bottom: 30px; padding: 20px 24px; background: #f5f7ff; border-right: 4px solid var(--blue); border-radius: 12px; }
.toc ol { margin: 8px 22px 0 0; line-height: 2.1; }
.toc li.sub { margin-right: 18px; font-size: 14px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--blue); }
.article-content { color: #334155; font-size: 17px; line-height: 2.1; overflow-wrap: anywhere; }
.article-content::after { content: ''; display: block; clear: both; }
.article-content p { margin-bottom: 20px; }
.article-content h2, .article-content h3, .article-content h4 { margin: 32px 0 14px; color: var(--blue); font-weight: 800; line-height: 1.6; scroll-margin-top: 100px; }
.article-content ul, .article-content ol { margin: 0 26px 20px 0; }
.article-content li { margin-bottom: 8px; }
.article-content a { color: var(--blue); }
.article-content img, .article-content video, .article-content iframe { max-width: 100%; border-radius: 12px; }
.article-content img { height: auto; }
.article-content figure { margin: 0 0 20px; }
.article-content figcaption { color: var(--muted); font-size: 13px; text-align: center; }
.article-content blockquote { margin: 0 0 20px; padding: 14px 20px; border-right: 4px solid #cbd5e1; background: #f8fafc; }
.article-content table { display: block; max-width: 100%; margin-bottom: 20px; overflow-x: auto; border-collapse: collapse; }
.article-content td, .article-content th { padding: 10px 14px; border: 1px solid var(--line); }
.article-content .aligncenter { display: block; margin-right: auto; margin-left: auto; }
.article-content .alignright { float: right; margin: 0 0 16px 20px; }
.article-content .alignleft { float: left; margin: 0 20px 16px 0; }
.article-gallery { margin-top: 34px; }
.article-gallery h2, .article-cta h2 { margin-bottom: 16px; font-size: 20px; }
.article-gallery > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(45%, 220px), 1fr)); gap: 12px; }
.article-gallery a { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; }
.article-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.article-gallery a:hover img { transform: scale(1.06); }
.furnado-page .lightbox { position: fixed; inset: 0; margin: auto; max-width: 94vw; max-height: 92vh; border: 0; border-radius: 14px; background: #000; overflow: visible; }
.lightbox::backdrop { background: rgba(9,13,22,.85); }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 14px; }
.lightbox button { position: absolute; top: 8px; left: 8px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; font-size: 24px; cursor: pointer; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); font-weight: 800; }
.article-cta { margin-top: 28px; padding: 28px; text-align: center; background: #f5f7ff; border-radius: 16px; }
.article-cta > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.article-cta .btn { width: auto; min-width: 220px; min-height: 52px; }
.btn-call { background: #212B84; color: #fff; }
.btn-call:hover { background: #161d5e; color: #fff; transform: translateY(-2px); }
.related { margin-top: 50px; }
.related > h2 { margin-bottom: 22px; font-size: 22px; }
@media (max-width: 600px) {
    .article-box { padding: 20px 16px; }
    .article-content { font-size: 16px; }
    .article-cta { padding: 20px 14px; }
    .article-cta .btn { width: 100%; }
}
