/* =========================================================
   IEG — إعادة تصميم كاملة: هوية "دقة هندسية / مخطط قص"
   بدل الاعتماد على شكل الصندوق نفسه، العنصر البصري المتكرر هنا
   مأخوذ من "علامات التسجيل" و"خطوط القص/الطي" اللي بتظهر فعليًا
   على أي مخطط قص (Dieline) بيستخدمه أي مصنع كرتون — زوايا L،
   خطوط متقطعة للطي، خطوط متصلة للقص، وأسهم قياس الأبعاد.
   ========================================================= */

:root {
  --ink:        #17181A;
  --ink-soft:   #4A4642;
  --paper:      #F7F4EE;
  --paper-2:    #EFEAE0;
  --panel-dark: #17181A;
  --panel-dark-2:#232323;
  --accent:     #E8491D;
  --accent-deep:#B8360F;
  --accent-soft:#FBDCCB;
  --line:       #DAD3C4;
  --line-strong:#3a3733;
  --text-dark:  #1C1A17;
  --text-light: #F3EEE4;
  --muted-light:#B8B0A2;
  --radius: 4px;
  --shadow: 0 10px 26px rgba(23,24,26,.10);
  --ease: cubic-bezier(.22,.9,.32,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text-dark);
  font-family: 'Almarai', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Changa', 'Almarai', sans-serif; font-weight: 700; margin: 0 0 .5em; color: inherit; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(232,73,29,.28); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-outline-dark { border-color: rgba(243,238,228,.35); color: #fff; }
.btn-outline-dark:hover { background: var(--accent); border-color: var(--accent); }
.btn-block { width: 100%; justify-content: center; }

.header-login-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .88rem; color: var(--text-light); opacity: .8;
  border-bottom: 1px solid transparent;
}
.header-login-link:hover { opacity: 1; border-color: var(--accent); }

/* ---------- هيدر ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  border-bottom: 2px solid var(--accent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text-light); }
.logo-mark { color: var(--accent); display: flex; }
.logo-text { font-family: 'Changa', sans-serif; font-weight: 700; font-size: 1.25rem; line-height: 1; display: flex; flex-direction: column; gap: 3px; }
.logo-text small { font-family: 'Almarai', sans-serif; font-weight: 400; font-size: .68rem; color: var(--muted-light); }

.main-nav { display: flex; gap: 26px; }
.main-nav a {
  position: relative; color: var(--text-light); font-size: .92rem; font-weight: 400; padding: 6px 0;
}
.main-nav a::after {
  content: ''; position: absolute; right: 0; bottom: -2px; width: 0; height: 2px; background: var(--accent);
  transition: width .25s var(--ease);
}
.main-nav a:hover::after { width: 100%; }
.main-nav a.is-active { font-weight: 700; }
.main-nav a.is-active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text-light); border-radius: 2px; }

/* ---------- هيرو ---------- */
.hero { background: var(--paper); position: relative; padding: 20px 0 70px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 50px; padding-top: 56px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--accent-deep); font-weight: 700; font-size: .85rem; margin-bottom: 18px;
}
.eyebrow-tag {
  font-family: 'Changa', sans-serif; background: var(--ink); color: var(--text-light);
  font-size: .72rem; padding: 2px 8px; border-radius: 3px;
}
.eyebrow-light { color: var(--accent); }

.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3rem); line-height: 1.25; margin-bottom: 22px; color: var(--ink); }
.hero h1 .accent-text { color: var(--accent); }
.hero .lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 30px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* بطاقة مخطط القص (Dieline) — العنصر البصري المميز بدل الصندوق */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.dieline-card {
  position: relative; width: 100%; max-width: 480px; background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 20px 16px;
}
.dieline-label {
  position: absolute; top: -13px; right: 20px; background: var(--ink); color: var(--accent);
  font-family: 'Changa', sans-serif; font-size: .74rem; padding: 4px 12px; border-radius: 3px; letter-spacing: .3px;
}
.dieline-svg { width: 100%; height: auto; color: var(--ink); }
.dl-cut { stroke: var(--ink); }
.dl-fold { stroke: var(--accent); }
.dl-reg { stroke: var(--ink-soft); }
.dl-dim { stroke: var(--ink-soft); }
.dl-dim-label { font-family: 'Almarai', sans-serif; font-size: 11px; fill: var(--ink-soft); }
.dl-dim-label-v { writing-mode: vertical-rl; }

/* ---------- شريط المميزات ---------- */
.features { background: var(--ink); padding: 26px 0; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.feature { display: flex; align-items: center; gap: 12px; padding: 6px; }
.feature-icon {
  flex: none; width: 40px; height: 40px; border: 1.5px solid var(--accent); border-radius: var(--radius); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.feature h3 { font-size: .92rem; margin: 0; color: var(--text-light); font-weight: 400; font-family: 'Almarai', sans-serif; }

/* ---------- أقسام عامة ---------- */
.section { padding: 90px 0; position: relative; }
.section-light { background: var(--paper); color: var(--text-dark); }
.section-dark { background: var(--panel-dark); color: var(--text-light); }
.section-title-light { color: #fff; }
.section-lead { max-width: 62ch; font-size: 1.02rem; color: var(--ink-soft); }
.section-lead-light { color: var(--muted-light); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 18px; max-width: 24ch; }

.check-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.check-list li { position: relative; padding-right: 28px; color: var(--text-dark); }
.check-list li::before {
  content: '›'; position: absolute; right: 0; top: -2px; width: 18px; height: 18px;
  color: var(--accent); font-weight: 700; font-size: 1.2rem; font-family: 'Changa', sans-serif;
}

/* ---------- من نحن ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: start; }
.stat-cards { display: grid; gap: 14px; }
.stat-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: baseline; gap: 14px; position: relative;
  border-inline-start: 3px solid var(--accent);
}
.stat-num { font-family: 'Changa', sans-serif; font-weight: 700; font-size: 1.9rem; color: var(--ink); }
.stat-label { color: var(--ink-soft); font-size: .92rem; }

/* ---------- منتجاتنا ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 44px; background: rgba(243,238,228,.12); border: 1px solid rgba(243,238,228,.12); }
.product-card {
  background: var(--panel-dark); padding: 30px 24px; position: relative;
  transition: background .25s var(--ease);
}
.product-card:hover { background: var(--panel-dark-2); }
.product-card::before {
  content: ''; position: absolute; top: 14px; left: 14px; width: 10px; height: 10px;
  border-top: 1.5px solid rgba(243,238,228,.25); border-right: 1.5px solid rgba(243,238,228,.25);
  opacity: 0; transition: opacity .25s var(--ease);
}
.product-card:hover::before { opacity: 1; border-color: var(--accent); }
.product-icon {
  width: 44px; height: 44px; border: 1.5px solid var(--accent); border-radius: var(--radius); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.product-card h3 { font-size: 1.02rem; margin-bottom: 8px; color: #fff; }
.product-card p { font-size: .88rem; color: var(--muted-light); margin: 0; }

/* ---------- خدماتنا ---------- */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); }
.service-row { display: flex; gap: 18px; align-items: flex-start; background: var(--paper); padding: 26px; }
.service-icon {
  flex: none; width: 42px; height: 42px; border: 1.5px solid var(--accent); border-radius: var(--radius); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
}
.service-row h3 { font-size: 1.02rem; margin-bottom: 6px; }
.service-row p { font-size: .9rem; color: var(--ink-soft); margin: 0; }

/* ---------- جودة واعتماد ---------- */
.section-quality { background: var(--paper-2); }
.quality-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.layer-diagram { display: flex; flex-direction: column-reverse; gap: 2px; border: 1.5px solid var(--ink); padding: 6px; background: #fff; }
.layer {
  height: 60px; display: flex; align-items: center; padding: 0 20px;
  background: var(--paper-2); color: var(--text-dark); font-weight: 700; font-size: .9rem;
  border-inline-start: 4px solid var(--accent);
}
.layer:nth-child(2) { border-inline-start-color: var(--ink); background: repeating-linear-gradient(90deg, var(--paper-2) 0 16px, var(--line) 16px 18px); }

/* ---------- تواصل معنا ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-info { display: grid; gap: 16px; margin-top: 30px; }
.contact-item { display: flex; align-items: center; gap: 12px; color: var(--muted-light); font-size: .95rem; }
.contact-item svg { color: var(--accent); flex: none; }
.contact-form { background: var(--panel-dark-2); border: 1.5px solid rgba(243,238,228,.1); padding: 32px; position: relative; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: .85rem; color: var(--muted-light); margin-bottom: 7px; }
.form-row input, .form-row textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid rgba(243,238,228,.15);
  background: rgba(243,238,228,.05); color: var(--text-light); font-family: inherit; font-size: .95rem; resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-note { text-align: center; margin: 14px 0 0; font-size: .88rem; min-height: 1.4em; }
.form-note.success { color: #9ed6a8; }
.form-note.error { color: #e69b9b; }

/* ---------- فوتر ---------- */
.site-footer { background: var(--ink); color: var(--muted-light); padding-top: 60px; border-top: 2px solid var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 30px; align-items: start; padding-bottom: 40px; border-bottom: 1px solid rgba(243,238,228,.08); }
.footer-logo { color: var(--text-light); margin-bottom: 10px; }
.footer-tagline { font-size: .9rem; max-width: 32ch; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { font-size: .9rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-login { align-self: start; font-size: .88rem; color: var(--accent); border: 1px solid rgba(232,73,29,.4); padding: 10px 18px; border-radius: var(--radius); white-space: nowrap; }
.footer-login:hover { background: rgba(232,73,29,.1); }
.footer-bottom { display: flex; justify-content: center; padding: 22px 0; font-size: .82rem; }

/* ---------- ظهور تدريجي عند التمرير ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- أزرار التواصل العايمة (واتساب / فيسبوك) ---------- */
.floating-contact {
  position: fixed;
  bottom: 22px;
  left: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fab-btn {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.fab-btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 22px rgba(0,0,0,.3); }
.fab-whatsapp { background: #25D366; }
.fab-facebook { background: #1877F2; }

@media (max-width: 640px) {
  .floating-contact { bottom: 16px; left: 14px; gap: 10px; }
  .fab-btn { width: 48px; height: 48px; }
  .fab-btn svg { width: 22px; height: 22px; }
}

/* ---------- هيرو الصفحات الداخلية (منتجات / جاليري) ---------- */
.page-hero { background: var(--ink); color: var(--text-light); padding: 54px 0 50px; border-bottom: 2px solid var(--accent); }
.page-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); max-width: 26ch; }
.page-hero .section-lead { max-width: 60ch; }

.db-notice { background: var(--accent-soft); color: var(--accent-deep); border-radius: var(--radius); padding: 18px 22px; font-size: .95rem; border-inline-start: 3px solid var(--accent); }
.db-notice code { background: rgba(0,0,0,.08); padding: 2px 6px; border-radius: 4px; }
.db-notice a { text-decoration: underline; font-weight: 700; }

.btn-sm { padding: 9px 18px; font-size: .85rem; }

/* ---------- فلتر التصنيفات ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter-chip {
  padding: 8px 18px; border-radius: var(--radius); border: 1.5px solid var(--line); background: #fff;
  color: var(--ink-soft); font-size: .88rem; font-weight: 700; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- شبكة كتالوج المنتجات ---------- */
.catalog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.catalog-card {
  background: #fff; border: 1.5px solid var(--line); overflow: hidden;
  transition: border-color .2s var(--ease), transform .25s var(--ease);
  display: flex; flex-direction: column;
}
.catalog-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.catalog-thumb { aspect-ratio: 4/3; background: var(--paper-2); overflow: hidden; }
.catalog-thumb img { width: 100%; height: 100%; object-fit: cover; }
.catalog-thumb-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: 'Changa', sans-serif; font-weight: 700; font-size: 1.6rem; color: var(--accent); }
.catalog-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.badge-chip { align-self: flex-start; background: var(--paper-2); color: var(--accent-deep); font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius); }
.catalog-body h3 { font-size: 1rem; margin: 0; }
.catalog-body p { font-size: .87rem; color: var(--ink-soft); margin: 0 0 8px; flex: 1; }
.catalog-body .btn { align-self: flex-start; }

/* ---------- جاليري الصور ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.gallery-item {
  position: relative; border: none; padding: 0; cursor: pointer; overflow: hidden;
  aspect-ratio: 4/3; background: var(--paper-2);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute; inset: auto 0 0 0; padding: 10px 14px; font-size: .82rem; color: #fff; text-align: right;
  background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
}

/* ---------- لايت بوكس ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10,10,10,.94); z-index: 200;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 30px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(90vw, 900px); max-height: 74vh; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.lightbox p { color: var(--muted-light); font-size: .95rem; margin: 0; }
.lightbox-close {
  position: absolute; top: 20px; left: 24px; background: rgba(255,255,255,.1); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
}
.lightbox-close:hover { background: var(--accent); }

/* ---------- استجابة الموبايل ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 30px; }
  .hero-visual { order: -1; }
  .about-grid, .quality-grid, .contact-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .main-nav { position: fixed; inset: 72px 0 0 0; background: var(--ink); flex-direction: column; padding: 30px 24px; gap: 22px;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle { display: flex; }
  .header-actions .header-login-link { display: none; }
  .product-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .catalog-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
}
