:root {
  --primary: #123c8c;
  --accent: #e63946;
  --dark: #0a1f44;
  --wa: #25d366;
  --wa-dark: #128c4a;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1b2540;
  --muted: #64708a;
  --line: #e3e8f2;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 35, 80, .08);
  --shadow-lg: 0 20px 50px rgba(15, 35, 80, .16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body { overflow-x: clip; }
body { margin: 0; font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.container { width: min(1200px, 92%); margin-inline: auto; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.draft-bar { background: #fff3cd; color: #7a5a00; text-align: center; padding: 8px; font-size: 14px; font-weight: 600; }
.draft-bar a { text-decoration: underline; margin-inline-start: 8px; }

/* Topbar */
.topbar { background: var(--dark); color: #cfd8ee; font-size: 13px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.topbar-links { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar-links a:hover { color: #fff; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 70px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--primary); font-weight: 800; }
.brand img { height: 46px; width: auto; }
.logo-svg { height: 44px; width: auto; color: var(--primary); }
.brand-names { line-height: 1.2; white-space: nowrap; }
.brand-names small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.menu { display: flex; gap: 4px; list-style: none; margin: 0 auto 0 0; padding: 0; margin-inline-start: auto; }
.menu a { padding: 8px 14px; border-radius: 10px; font-weight: 600; color: #34405e; transition: .2s; }
.menu a:hover { background: #eef2fb; color: var(--primary); }
.cart-btn { display: flex; align-items: center; gap: 8px; border: 0; background: var(--primary); color: #fff; padding: 9px 16px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.cart-btn b { background: var(--accent); min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; font-size: 13px; padding: 0 6px; }
.burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--dark); margin: 5px 0; border-radius: 2px; }

/* Hero */
.hero { position: relative; color: #fff; padding: 70px 0 0; overflow: hidden; background: linear-gradient(135deg, var(--dark), var(--primary)); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .18; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, rgba(0,0,0,.15)); pointer-events: none; }
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; padding-bottom: 60px; min-height: 560px; }
.pill { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 4px 14px; border-radius: 30px; font-size: 14px; font-weight: 600; }
.hero h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.3; margin: 16px 0; font-weight: 800; }
.hero p { font-size: 17px; color: #dce4f7; max-width: 620px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-logo { color: #fff; display: flex; justify-content: center; }
.hero-logo .logo-svg { height: 42px; color: #fff; }
.hero-logo img { max-height: 54px; }
.hero-company { font-size: 16px; font-weight: 800; line-height: 1.3; }
.hero-company-fr { font-family: 'Poppins', sans-serif; letter-spacing: .4px; color: #c7d3f0; font-size: 12px; }
.hero-year { display: inline-block; background: var(--accent); padding: 4px 14px; border-radius: 30px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.stats { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.15); border-radius: 18px 18px 0 0; overflow: hidden; }
.stat { background: rgba(10, 25, 60, .55); padding: 22px; text-align: center; }
.stat b { display: block; font-size: 30px; font-family: 'Poppins', 'Cairo', sans-serif; }
.stat span { color: #c7d3f0; font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 12px; font-weight: 700; border: 2px solid transparent; cursor: pointer; transition: .2s; font-size: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: none; color: var(--muted); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 6px 0; color: var(--dark); }
.kicker { color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: .5px; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.cat { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); cursor: pointer; transition: .25s; border: 1px solid var(--line); }
.cat:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.cat-img { height: 150px; background: #eef2fb center/contain no-repeat; background-origin: content-box; padding: 14px; }
.cat-info { padding: 14px 18px; border-top: 1px solid var(--line); }
.cat-info h3 { margin: 0; font-size: 18px; color: var(--dark); }
.cat-info small { color: var(--muted); font-family: 'Poppins', sans-serif; font-size: 12px; }
.cat-count { position: absolute; top: 12px; inset-inline-start: 12px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: #fff; padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); }
.search { flex: 1 1 300px; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 10px; padding: 0 14px; color: var(--muted); }
.search input { border: 0; background: none; outline: none; padding: 12px 0; width: 100%; color: var(--text); }
.toolbar select { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 7px 16px; border-radius: 30px; cursor: pointer; font-weight: 600; font-size: 14px; color: #34405e; transition: .2s; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip small { opacity: .7; margin-inline-start: 4px; }
.result-info { color: var(--muted); font-size: 14px; margin: 10px 0 16px; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 1fr; gap: 20px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: .25s; height: 100%; min-width: 0; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-img { position: relative; aspect-ratio: 1 / 1; flex: none; overflow: hidden; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: contain; transition: .3s; }
.card:hover .card-img img { transform: scale(1.05); }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #eef2fb, #f8f9fd); color: #9aa6c2; border-radius: 10px; text-align: center; font-size: 13px; }
.noimg svg { width: 56px; height: 56px; opacity: .6; margin: 0 auto 6px; display: block; }
.code { position: absolute; top: 10px; inset-inline-end: 10px; background: var(--dark); color: #fff; font-family: 'Poppins', sans-serif; font-size: 12px; padding: 3px 10px; border-radius: 8px; direction: ltr; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { font-size: 12px; color: var(--accent); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 20px; line-height: 20px; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.5; color: var(--dark); direction: auto; text-align: start; cursor: pointer; height: 45px; flex: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title-ar { display: none; }
.price { font-size: 19px; font-weight: 800; color: var(--primary); font-family: 'Poppins', 'Cairo', sans-serif; direction: ltr; text-align: end; }
.price.na { font-size: 14px; color: var(--muted); font-family: 'Cairo', sans-serif; font-weight: 700; direction: rtl; text-align: start; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; min-height: 40px; }
.card-foot .price { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; display: grid; place-items: center; cursor: pointer; transition: .2s; flex: none; }
.icon-btn.add { background: #eef2fb; color: var(--primary); }
.icon-btn.add:hover { background: var(--primary); color: #fff; }
.icon-btn.wa { background: var(--wa); color: #fff; }
.icon-btn.wa:hover { background: var(--wa-dark); }
.icon-btn.edit { background: #fff4e0; color: #b26a00; font-size: 18px; font-weight: 700; }
.icon-btn.edit:hover { background: #f5a300; color: #fff; }
.btn-edit { background: #fff4e0; color: #8a5200; border-color: #f5c46b; }
.btn-edit:hover { background: #f5a300; color: #fff; }
.admin-bar { background: #f5a300; color: #2b1a00; display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.admin-bar a { background: rgba(255,255,255,.55); padding: 2px 12px; border-radius: 8px; }
.admin-bar button { background: none; border: 0; text-decoration: underline; cursor: pointer; font-weight: 700; color: inherit; }
.card-actions { display: flex; gap: 6px; }
.more-wrap { text-align: center; margin-top: 30px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); grid-column: 1 / -1; }

/* About */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.about-text h2 { font-size: 32px; color: var(--dark); margin: 6px 0 16px; }
.about-text p { color: #45506b; font-size: 16px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feature { background: var(--bg); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.feature i { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; font-style: normal; font-weight: 800; margin-bottom: 10px; }
.feature h4 { margin: 0 0 4px; color: var(--dark); }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.wa-list { display: grid; gap: 14px; align-content: start; }
.wa-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: .2s; }
.wa-card:hover { border-color: var(--wa); box-shadow: var(--shadow); }
.wa-card .ico { width: 52px; height: 52px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; flex: none; }
.wa-card b { display: block; color: var(--dark); }
.wa-card span { direction: ltr; display: inline-block; color: var(--muted); font-family: 'Poppins', sans-serif; font-size: 15px; }
.wa-card .go { margin-inline-start: auto; color: var(--wa-dark); font-weight: 700; font-size: 14px; }
.contact-info { background: linear-gradient(135deg, var(--dark), var(--primary)); color: #fff; border-radius: var(--radius); padding: 28px; display: grid; gap: 16px; align-content: start; }
.ci-row { display: flex; gap: 12px; align-items: flex-start; }
.ci-row i { width: 40px; height: 40px; flex: none; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-style: normal; }
.ci-row small { display: block; color: #bcc8e8; font-size: 13px; }
.ci-row a, .ci-row div { word-break: break-word; }
.ltr { direction: ltr; unicode-bidi: embed; }
.branches-wrap { margin-top: 40px; }
.branches-title { text-align: center; color: var(--dark); font-size: 24px; margin: 0 0 20px; }
.branches { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.branch { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: .2s; }
.branch:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.branch-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.branch-city { background: var(--primary); color: #fff; font-family: 'Poppins', sans-serif; font-size: 12px; padding: 3px 12px; border-radius: 20px; letter-spacing: .5px; }
.branch-type { font-size: 12px; color: var(--accent); font-weight: 700; }
.branch h4 { margin: 4px 0 0; color: var(--dark); font-size: 17px; text-align: start; }
.branch p { margin: 0; color: #45506b; font-size: 14px; text-align: start; }
.branch-tels { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-family: 'Poppins', 'Cairo', sans-serif; }
.branch-tels a { color: var(--primary); align-self: flex-start; }
.branch .btn { margin-top: auto; align-self: flex-start; }
.map { margin-top: 24px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map iframe { width: 100%; height: 360px; border: 0; display: block; }

/* Footer */
.footer { background: var(--dark); color: #c3cde6; padding: 40px 0 20px; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-brand { color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.footer-brand .logo-svg { color: #fff; height: 40px; }
.footer-brand img { height: 44px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; transition: .2s; }
.socials a:hover { background: var(--accent); }
.copy { border-top: 1px solid rgba(255,255,255,.1); margin-top: 24px; padding-top: 16px; font-size: 13px; text-align: center; }

/* WhatsApp float */
.wa-float { position: fixed; bottom: 22px; left: 22px; z-index: 60; }
.wa-fab { width: 62px; height: 62px; border-radius: 50%; background: var(--wa); color: #fff; border: 0; cursor: pointer; box-shadow: 0 10px 25px rgba(37, 211, 102, .45); display: grid; place-items: center; animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); } 50% { box-shadow: 0 0 0 14px rgba(37,211,102,0); } }
.wa-menu { position: absolute; bottom: 74px; left: 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 270px; overflow: hidden; transform-origin: bottom left; transform: scale(.8); opacity: 0; pointer-events: none; transition: .2s; }
.wa-float.open .wa-menu { transform: none; opacity: 1; pointer-events: auto; }
.wa-menu-head { background: var(--wa-dark); color: #fff; padding: 14px 16px; font-weight: 700; }
.wa-menu a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wa-menu a:hover { background: #f0fbf4; }
.wa-menu a span { direction: ltr; color: var(--muted); font-size: 13px; display: block; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(8, 18, 40, .65); display: grid; place-items: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 20px; width: min(980px, 100%); max-height: 92vh; overflow: auto; position: relative; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.modal-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg); font-size: 26px; cursor: pointer; z-index: 2; line-height: 1; }
.modal-body { display: grid; grid-template-columns: 1.35fr 1fr; gap: 34px; padding: 30px; }
#modal .modal-box { width: min(1180px, 100%); }
.gallery-main { position: relative; aspect-ratio: 1 / 1; max-height: 74vh; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; padding: 16px; cursor: zoom-in; overflow: hidden; }
.gallery-main::after { content: '⤢ تكبير'; position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(10,31,68,.75); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 20px; pointer-events: none; }
.gallery-main:has(.noimg) { cursor: default; }
.gallery-main:has(.noimg)::after { display: none; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; animation: pop .3s ease; }
.lightbox { position: fixed; inset: 0; z-index: 130; background: rgba(5,12,30,.94); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; background: #fff; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .25s ease; }
.lightbox .modal-x { position: fixed; top: 14px; inset-inline-end: 14px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: contain; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.thumbs img.active { border-color: var(--primary); }
.m-info h3 { font-size: 24px; margin: 6px 0; color: var(--dark); direction: auto; text-align: start; }
.m-code { font-family: 'Poppins', sans-serif; background: var(--bg); padding: 4px 12px; border-radius: 8px; display: inline-block; direction: ltr; font-size: 14px; }
.m-price { font-size: 30px; margin: 16px 0; }
.m-desc { color: #45506b; white-space: pre-line; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 40px; height: 42px; border: 0; background: var(--bg); cursor: pointer; font-size: 18px; }
.qty input { width: 56px; text-align: center; border: 0; height: 42px; outline: none; }
.m-actions { display: grid; gap: 10px; margin-top: 18px; }
.wa-choose { display: grid; gap: 8px; }
.wa-choose .btn { justify-content: space-between; }
.wa-choose .btn span { direction: ltr; opacity: .85; font-size: 13px; }

/* Drawer */
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(420px, 100%); background: #fff; z-index: 90; display: flex; flex-direction: column; transform: translateX(-105%); visibility: hidden; transition: transform .3s ease, visibility .3s; box-shadow: var(--shadow-lg); }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: relative; }
.drawer-head h3 { margin: 0; }
.drawer-head .modal-x { position: static; }
.drawer-items { flex: 1; overflow: auto; padding: 12px 20px; }
.ci { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ci img, .ci .noimg { width: 60px; height: 60px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
.ci .noimg svg { width: 26px; height: 26px; margin: 0; }
.ci-name { font-weight: 700; font-size: 14px; line-height: 1.4; direction: auto; }
.ci-meta { font-size: 13px; color: var(--muted); }
.ci .qty button { width: 30px; height: 32px; }
.ci .qty input { width: 38px; height: 32px; }
.ci-del { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.drawer-foot input { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; }
.cart-total { display: flex; justify-content: space-between; font-size: 17px; }
.cart-total b { color: var(--primary); direction: ltr; }
.backdrop { position: fixed; inset: 0; background: rgba(8,18,40,.5); z-index: 85; }
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--dark); color: #fff; padding: 12px 22px; border-radius: 12px; opacity: 0; transition: .3s; z-index: 100; pointer-events: none; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* Responsive */
@media (max-width: 1100px) {
  .burger { display: block; margin-inline-start: auto; }
  .menu { position: absolute; top: 70px; right: 0; left: 0; background: #fff; flex-direction: column; padding: 10px; border-bottom: 1px solid var(--line); display: none; margin: 0; }
  .menu.open { display: flex; }
  .cart-btn span { display: none; }
}
@media (max-width: 980px) {
  .hero-in, .about, .contact-grid, .modal-body { grid-template-columns: 1fr; }
  .hero-in { min-height: 0; }
  .hero-show { max-width: 560px; width: 100%; margin: 10px auto 30px; }
  .show-frame { transform: none; }
  .show-badge { inset-inline-start: 50%; transform: translateX(-50%); animation: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .brand-names { white-space: normal; font-size: 13px; }
  .brand-names small { display: none; }
  .logo-svg { height: 34px; }
  .nav-in { gap: 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 13px; height: 39px; }
  .price { font-size: 15px; }
  .icon-btn { width: 34px; height: 34px; }
  .features { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .modal-body { padding: 18px; gap: 18px; }
  .modal { padding: 0; }
  #modal .modal-box { border-radius: 0; max-height: 100vh; height: 100%; }
  .gallery-main { max-height: 60vh; }
  .topbar { display: none; }
}

/* ============ Animated hero ============ */
.hero { isolation: isolate; }
.hero-ambient { position: absolute; inset: -60px; z-index: 0; pointer-events: none; }
.hero-ambient div { position: absolute; inset: 0; background: center/cover no-repeat; filter: blur(46px) saturate(1.4); opacity: 0; transition: opacity 1.8s ease; transform: scale(1.1); }
.hero-ambient div.on { opacity: .3; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-blobs { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); animation: blob 18s ease-in-out infinite alternate; }
.hero-blobs span:nth-child(1) { width: 440px; height: 440px; background: var(--accent); top: -160px; right: -120px; opacity: .28; }
.hero-blobs span:nth-child(2) { width: 560px; height: 560px; background: #2f7bff; bottom: -260px; left: 8%; opacity: .35; animation-duration: 24s; }
.hero-blobs span:nth-child(3) { width: 320px; height: 320px; background: #18c4b8; top: 35%; left: 42%; opacity: .18; animation-duration: 28s; }
@keyframes blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(70px, -50px) scale(1.18); } 100% { transform: translate(-50px, 60px) scale(.92); } }

.reveal { opacity: 0; transform: translateY(26px); animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; }
.hero-text .reveal:nth-child(2) { animation-delay: .12s; }
.hero-text .reveal:nth-child(3) { animation-delay: .24s; }
.hero-text .reveal:nth-child(4) { animation-delay: .36s; }
.hero-show.reveal { animation-delay: .3s; animation-duration: 1.2s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero h1 { background: linear-gradient(90deg, #fff 0%, #fff 40%, #ffd3d6 50%, #fff 60%, #fff 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise .9s .12s cubic-bezier(.2,.7,.2,1) forwards, shine 7s 1.5s linear infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.hero-show { position: relative; padding-top: 26px; }
.show-glow { position: absolute; inset: 6% -3% 14% 6%; background: linear-gradient(135deg, var(--accent), #2f7bff 60%, #18c4b8); filter: blur(55px); opacity: .5; border-radius: 40px; animation: glow 7s ease-in-out infinite alternate; }
@keyframes glow { from { transform: scale(.94) rotate(-3deg); opacity: .4; } to { transform: scale(1.04) rotate(3deg); opacity: .6; } }
.show-frame { position: relative; aspect-ratio: 1 / .86; border-radius: 28px; overflow: hidden; background: #fff; border: 6px solid rgba(255,255,255,.92); box-shadow: 0 40px 90px rgba(0, 0, 0, .45); transform: perspective(1400px) rotateY(7deg) rotateX(2deg); transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.hero-show:hover .show-frame { transform: perspective(1400px) rotateY(0) rotateX(0) scale(1.01); }
.show-slides { position: absolute; inset: 0; }
.show-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.3s ease; overflow: hidden; }
.show-slide.on { opacity: 1; z-index: 1; }
.show-slide .sb { position: absolute; inset: -30px; background: center/cover no-repeat; filter: blur(28px) saturate(1.2); opacity: .55; transform: scale(1.1); }
.show-slide img { position: relative; width: 100%; height: 100%; object-fit: contain; transform-origin: var(--ox, 50%) var(--oy, 50%); will-change: transform; }
.show-slide.on img { animation: kenburns var(--dur, 6s) ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.16); } }
.show-cap { position: absolute; z-index: 3; inset: auto 0 0 0; padding: 50px 22px 18px; background: linear-gradient(transparent, rgba(6, 16, 40, .82)); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.show-cap span { animation: capin .7s ease both; }
.show-cap .code { background: var(--accent); font-family: 'Poppins', sans-serif; font-size: 12px; padding: 3px 10px; border-radius: 20px; direction: ltr; }
.show-cap.link { cursor: pointer; }
.show-cap.link::after { content: 'عرض المنتج ←'; margin-inline-start: auto; font-size: 13px; background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 20px; }
@keyframes capin { from { opacity: 0; transform: translateY(12px); } }
.show-progress { position: absolute; z-index: 4; inset: auto 0 0 0; height: 4px; background: rgba(255,255,255,.2); }
.show-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffb703); }
.show-progress i.run { animation: prog var(--dur, 6s) linear forwards; }
@keyframes prog { to { width: 100%; } }
.show-dots { position: relative; z-index: 3; display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.show-dots button { width: 10px; height: 10px; border-radius: 10px; border: 0; padding: 0; background: rgba(255,255,255,.35); cursor: pointer; transition: .35s; }
.show-dots button.on { width: 30px; background: #fff; }
.show-badge { position: absolute; z-index: 5; top: 0; inset-inline-start: -26px; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 18px; background: rgba(10, 25, 60, .62); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(14px); box-shadow: 0 20px 40px rgba(0,0,0,.3); animation: floaty 5s ease-in-out infinite; white-space: nowrap; }
@keyframes floaty { 50% { transform: translateY(-8px); } }

/* Scroll reveal */
.sr { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.sr.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .sr { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-blobs span, .show-glow, .show-badge, .show-slide.on img, .hero h1 { animation: none !important; }
  .hero h1 { color: #fff; }
}
@media (max-width: 560px) {
  .hero-in { min-height: 0; }
  .show-cap { font-size: 14px; padding: 40px 14px 14px; }
  .show-badge { gap: 10px; padding: 10px 12px; }
  .hero-company-fr { display: none; }
}

/* ============ Proforma invoice ============ */
.btn-invoice { background: var(--dark); color: #fff; }
.btn-invoice:hover { background: var(--primary); }
#invModal { z-index: 110; }
.inv-form { width: min(720px, 100%); padding: 28px; }
.inv-form h3 { margin: 0 0 4px; color: var(--dark); font-size: 22px; }
.inv-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.inv-types label { cursor: pointer; }
.inv-types input { position: absolute; opacity: 0; pointer-events: none; }
.inv-types span { display: block; text-align: center; padding: 12px 8px; border: 2px solid var(--line); border-radius: 14px; font-weight: 700; font-size: 14px; transition: .2s; height: 100%; }
.inv-types input:checked + span { border-color: var(--primary); background: #eef3fd; color: var(--primary); }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.inv-grid label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: #3a4562; }
.inv-grid .full { grid-column: 1 / -1; }
.inv-grid input, .inv-grid textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; }
.inv-grid input:focus, .inv-grid textarea:focus { outline: 2px solid rgba(18,60,140,.2); border-color: var(--primary); }
.inv-form-actions { display: flex; gap: 10px; margin-top: 20px; }

.inv-view { position: fixed; inset: 0; z-index: 120; background: #5b6478; overflow: auto; padding: 0 12px 40px; }
.inv-toolbar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 12px; margin: 0 -12px 24px; background: rgba(20, 28, 48, .92); backdrop-filter: blur(8px); }
.inv-toolbar .btn { padding: 10px 18px; }
.inv-toolbar .btn-ghost { color: #fff; }
.inv-toolbar .btn-wa { padding: 10px 18px; }
.inv-paper { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #111; padding: 14mm 14mm 12mm; box-shadow: 0 20px 60px rgba(0,0,0,.4); font-size: 12.5px; line-height: 1.55; display: flex; flex-direction: column; }
.iv-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 12px; border-bottom: 3px solid var(--primary); }
.iv-co { display: flex; gap: 14px; align-items: flex-start; }
.iv-co .iv-logo { flex: none; color: var(--primary); }
.iv-co .iv-logo .logo-svg { height: 54px; }
.iv-co .iv-logo img { max-height: 70px; max-width: 150px; }
.iv-co h2 { margin: 0; font-size: 19px; color: var(--dark); line-height: 1.3; }
.iv-co .fr { font-family: 'Poppins', sans-serif; font-size: 12px; color: var(--primary); font-weight: 600; }
.iv-co .act { color: #444; font-size: 12px; }
.iv-co .lines { font-size: 11.5px; color: #333; margin-top: 4px; }
.iv-co .lines div { direction: rtl; }
.iv-legal { font-size: 11px; color: #333; direction: ltr; text-align: left; min-width: 170px; }
.iv-legal div b { display: inline-block; min-width: 34px; color: var(--dark); }
.iv-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 16px 0 12px; }
.iv-title h1 { margin: 0; font-size: 22px; color: var(--primary); line-height: 1.2; }
.iv-title h1 small { display: block; font-family: 'Poppins', sans-serif; font-size: 13px; letter-spacing: 2px; color: var(--accent); }
.iv-meta { border: 1px solid #cfd6e4; border-radius: 8px; overflow: hidden; font-size: 12px; min-width: 230px; }
.iv-meta div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 10px; }
.iv-meta div:nth-child(odd) { background: #f2f5fb; }
.iv-meta b { direction: ltr; }
.iv-client { border: 1px solid #cfd6e4; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; font-size: 12px; }
.iv-client .h { grid-column: 1 / -1; font-weight: 800; color: var(--primary); border-bottom: 1px dashed #cfd6e4; padding-bottom: 4px; margin-bottom: 4px; display: flex; justify-content: space-between; }
.iv-client .h span { background: var(--primary); color: #fff; padding: 0 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.iv-client .nm { grid-column: 1 / -1; font-size: 14px; font-weight: 800; }
.iv-client i { font-style: normal; color: #666; }
.iv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.iv-table th { background: var(--primary); color: #fff; padding: 7px 6px; font-weight: 700; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.iv-table td { border: 1px solid #d3d9e6; padding: 6px; vertical-align: top; }
.iv-table tbody tr:nth-child(even) td { background: #f7f9fd; }
.iv-table .n, .iv-table .q { text-align: center; width: 32px; }
.iv-table .c { white-space: nowrap; direction: ltr; text-align: center; font-family: 'Poppins', sans-serif; font-size: 11px; width: 80px; }
.iv-table .m { direction: ltr; text-align: left; white-space: nowrap; width: 110px; }
.iv-table .d { text-align: start; }
.iv-table .na { color: #999; text-align: center; }
.iv-bottom { display: grid; grid-template-columns: 1fr 260px; gap: 18px; margin-top: 14px; align-items: start; }
.iv-totals { border: 1px solid #cfd6e4; border-radius: 8px; overflow: hidden; }
.iv-totals div { display: flex; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid #e3e8f2; }
.iv-totals div:last-child { border: 0; background: var(--primary); color: #fff; font-weight: 800; font-size: 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.iv-totals b { direction: ltr; }
.iv-words { font-size: 12px; border-inline-start: 3px solid var(--accent); padding: 6px 10px; background: #fdf3f4; direction: ltr; text-align: left; margin-bottom: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.iv-notes { font-size: 11.5px; color: #444; white-space: pre-line; }
.iv-warn { font-size: 11.5px; color: #a0141e; margin-top: 6px; }
.iv-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 22px; }
.iv-sign div { flex: 1; max-width: 260px; text-align: center; font-weight: 700; font-size: 12px; border-top: 1px solid #999; padding-top: 6px; min-height: 100px; }
.iv-sign img { max-height: 110px; margin: 6px auto 0; }
.iv-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #cfd6e4; font-size: 10.5px; color: #555; text-align: center; }
.iv-foot .bank { direction: ltr; }

@media screen and (max-width: 860px) {
  .inv-paper { width: 100%; min-height: 0; padding: 18px; overflow-x: auto; }
  .iv-head, .iv-title { flex-direction: column; }
  .iv-bottom { grid-template-columns: 1fr; }
  .iv-legal { text-align: right; }
}
@media screen and (max-width: 560px) {
  .inv-types, .inv-grid { grid-template-columns: 1fr; }
  .iv-client { grid-template-columns: 1fr; }
  .iv-co { flex-direction: column; }
  .iv-co > div { min-width: 0; }
  .iv-meta { min-width: 0; width: 100%; }
  .inv-view { padding: 0 6px 30px; }
  .inv-toolbar { gap: 6px; padding: 8px; margin: 0 -6px 14px; }
  .inv-toolbar .btn, .inv-toolbar .btn-wa { padding: 7px 12px; font-size: 13px; }
  .inv-paper { padding: 12px; font-size: 11.5px; }
  .iv-table { font-size: 10.5px; }
  .iv-table .m { width: auto; }
}

@page { size: A4; margin: 0; }
@media print {
  body.printing > *:not(#invView) { display: none !important; }
  body.printing { background: #fff; }
  body.printing #invView { position: static; overflow: visible; background: #fff; padding: 0; }
  body.printing .inv-toolbar { display: none; }
  body.printing .inv-paper { box-shadow: none; margin: 0; width: 210mm; min-height: 297mm; }
}

/* زر تحميل الكتالوج PDF */
.btn-cat { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.55); backdrop-filter: blur(6px); }
.btn-cat:hover { background: #fff; color: var(--primary); transform: translateY(-2px); }
.btn-cat .sz { font-weight: 600; opacity: .75; font-size: 12px; direction: ltr; }
.btn-cat.busy { pointer-events: none; opacity: .85; }
.menu a.menu-cat { color: var(--accent); }

/* ---------- حركة روابط القائمة العلوية ---------- */
@media (min-width: 1101px) { .menu { position: relative; } }
.menu li { position: relative; z-index: 1; }
.menu a { position: relative; display: inline-block; overflow: hidden; white-space: nowrap; isolation: isolate; transition: color .35s ease, background .25s ease; }
.menu a.active, .menu a.active:hover { color: #fff; background: transparent; }
.menu-ink {
  position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 0; border-radius: 10px; pointer-events: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 6px 18px rgba(18, 60, 140, .35);
  opacity: 0; transform-origin: center;
  transition: transform .6s cubic-bezier(.68, -0.4, .27, 1.4), width .6s cubic-bezier(.68, -0.4, .27, 1.4), height .4s ease, opacity .3s ease;
}
.menu-ink.on { opacity: 1; }
.menu-ink::after { /* لمعة تمر على العلامة */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  background-size: 250% 100%; background-position: 120% 0; transition: background-position .9s ease .15s;
}
.menu a.pop ~ .menu-ink::after, .menu-ink.on::after { background-position: -40% 0; }
.menu a.pop { animation: menuPop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes menuPop {
  0% { transform: scale(1); }
  25% { transform: scale(.86) rotate(-2deg); }
  55% { transform: scale(1.12) rotate(1deg); }
  80% { transform: scale(.97); }
  100% { transform: scale(1); }
}
.menu-rip {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(255,255,255,.75) 0%, rgba(230,57,70,.35) 45%, transparent 70%);
  transform: scale(0); animation: menuRip .65s ease-out forwards;
}
@keyframes menuRip { to { transform: scale(1); opacity: 0; } }
@media (max-width: 1100px) {
  .menu li, .menu a { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-ink, .menu-ink::after { transition: opacity .2s; }
  .menu a.pop, .menu-rip { animation: none; }
}
.cart-btn { white-space: nowrap; flex-shrink: 0; }
@media (min-width: 1101px) and (max-width: 1320px) { .menu { gap: 0; } .menu a { padding: 8px 9px; font-size: 14.5px; } }
@media (min-width: 1101px) and (max-width: 1240px) { .cart-btn span { display: none; } }
