/* ===== VARIABLES ===== */
:root {
  --primary: #7a3e12;
  --primary-light: #c76b22;
  --primary-dark: #4e2508;
  --gold: #d4a24e;
  --gold-light: #f5dca0;
  --bg: #fdfaf5;
  --surface: #fff;
  --ink: #2b2217;
  --muted: #6e5a43;
  --border: #e8d9c0;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(80,43,18,.06);
  --shadow: 0 8px 30px rgba(80,43,18,.10);
  --shadow-lg: 0 20px 50px rgba(80,43,18,.14);
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --font: 'Tajawal', sans-serif;
  --font-heading: 'Changa', sans-serif;
}

/* ===== BASE (alongside Bootstrap 5) ===== */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-heading); line-height: 1.25; }

/* Keep content visible if AOS fails to initialize. */
[data-aos]:not(.aos-init) {
  opacity: 1 !important;
  transform: none !important;
}

/* ===== HEADER — Blur Navbar ===== */
.site-header {
  background: rgba(253,250,245,.6) !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232,217,192,.4);
  transition: background var(--transition), box-shadow var(--transition);
  padding: 0 !important;
}
.site-header.scrolled {
  background: rgba(253,250,245,.95) !important;
  box-shadow: var(--shadow-sm);
}
.site-header .navbar-brand {
  display: flex; align-items: center; gap: 10px; padding: 0;
}
.brand-logo { width: 44px; height: 44px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: .8rem; color: var(--muted); font-weight: 500; }
.brand-sub { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; color: var(--primary); }

.site-header .nav-link {
  padding: 8px 14px !important; border-radius: 999px; font-weight: 600; font-size: .9rem;
  color: var(--muted) !important; transition: all var(--transition);
}
.site-header .nav-link:hover,
.site-header .nav-link.active {
  background: var(--primary); color: #fff !important;
}
.site-header .navbar-toggler { border: none; padding: 6px; }
.site-header .navbar-toggler:focus { box-shadow: none; }

.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; font-weight: 700; font-size: .82rem;
  background: var(--primary); color: #fff !important; transition: background var(--transition);
  text-decoration: none;
}
.lang-switch:hover { background: var(--primary-dark); color: #fff !important; }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  background: linear-gradient(135deg, #3e1c08 0%, #7a3e12 40%, #c76b22 100%);
  background-image: url('/assets/hero-mill.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(62,28,8,.72) 0%, rgba(122,62,18,.68) 40%, rgba(199,107,34,.65) 100%);
  z-index: 1;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at 30% 50%, rgba(0,0,0,.25) 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 2; max-width: 700px; padding: 120px 0 80px; }
.hero-kicker {
  display: inline-block; padding: 6px 18px; border-radius: 999px;
  background: rgba(255,255,255,.12); color: var(--gold-light);
  font-weight: 600; font-size: .9rem; margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.15);
}
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); color: #fff; margin-bottom: 18px; }
.hero-desc { color: rgba(255,255,255,.78); font-size: 1.05rem; max-width: 540px; margin-bottom: 32px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== Brand Buttons (avoid Bootstrap .btn conflicts) ===== */
.btn-brand {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  border: 2px solid transparent; cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.btn-gold { background: var(--gold); color: var(--primary-dark); border-color: var(--gold); }
.btn-gold:hover { background: #e6b85a; color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,162,78,.4); }
.btn-ghost { border-color: rgba(255,255,255,.4); color: #fff; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.btn-cta { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-cta:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }

/* ===== STATS ===== */
.stats { background: var(--primary); padding: 32px 0; margin-top: -1px; }
.stat-item { padding: 12px 8px; text-align: center; }
.stat-number { font-family: var(--font-heading); font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 800; color: var(--gold); display: block; }
.stat-suffix { font-family: var(--font-heading); font-size: 1.4rem; color: var(--gold); font-weight: 700; }
.stat-label { display: block; color: rgba(255,255,255,.8); font-size: .88rem; margin-top: 4px; }

/* Stat borders — direction-aware */
[dir="rtl"] .stat-item { border-left: 1px solid rgba(255,255,255,.15); }
[dir="rtl"] .stat-item:last-child { border-left: none; }
[dir="ltr"] .stat-item { border-right: 1px solid rgba(255,255,255,.15); }
[dir="ltr"] .stat-item:last-child { border-right: none; }

/* ===== SECTION COMMON ===== */
.section-tag {
  display: inline-block; padding: 5px 16px; border-radius: 999px;
  background: rgba(199,107,34,.1); color: var(--primary-light); font-weight: 700;
  font-size: .82rem; margin-bottom: 10px; letter-spacing: .3px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--primary-dark);
  margin-bottom: 10px;
}
.section-subtitle { color: var(--muted); max-width: 560px; margin-bottom: 36px; }

/* ===== BRANDS ===== */
.brands { padding: 72px 0; }
.brand-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px 20px; text-align: center; transition: all var(--transition);
  box-shadow: var(--shadow-sm); height: 100%;
}
.brand-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.brand-card-img { height: 100px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.brand-card-img img { max-height: 90px; max-width: 160px; object-fit: contain; }
.brand-card h3 { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 4px; }
.brand-card p { color: var(--muted); font-size: .88rem; }

/* ===== ABOUT ===== */
.about { padding: 80px 0; background: #fff; }
.about-header { margin-bottom: 10px; }
.text-muted-custom { color: var(--muted); }

.about-logo-box {
  width: 240px; height: 240px; border-radius: var(--radius-lg);
  background: #fff; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(122,62,18,.10); margin: 0 auto;
  transition: all var(--transition); padding: 24px;
}
.about-logo-box:hover { box-shadow: 0 12px 40px rgba(122,62,18,.18); transform: translateY(-4px); }
.about-logo-box img { max-width: 180px; max-height: 180px; object-fit: contain; }
.about-logo-label {
  margin-top: 16px; font-size: .9rem; color: var(--gold); font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
}

.about-text-block {
  background: linear-gradient(135deg, #fdf8f0 0%, #f9f0e0 100%);
  border-radius: var(--radius-lg); padding: 28px;
  border-right: 4px solid var(--gold); margin-bottom: 28px;
}
.lang-fr .about-text-block { border-right: none; border-left: 4px solid var(--gold); }
.about-desc { color: var(--muted); font-size: .95rem; line-height: 1.85; margin-bottom: 0; }

.about-features { display: flex; flex-direction: column; gap: 16px; }
.about-feature {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: all var(--transition);
}
.about-feature:hover { box-shadow: var(--shadow); transform: translateX(-4px); }
.about-feature-num {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.about-feature h4 { font-size: .95rem; color: var(--primary-dark); margin-bottom: 2px; }
.about-feature p { font-size: .85rem; color: var(--muted); margin-bottom: 0; }

/* ===== PRODUCTS ===== */
.products { padding: 60px 0; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 14px; text-align: center; transition: all var(--transition);
  box-shadow: var(--shadow-sm); height: 100%;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.product-card-detailed { display: flex; flex-direction: column; align-items: center; }
.product-bag {
  width: 100%; max-width: 180px; height: 200px; object-fit: contain;
  margin-bottom: 10px; background: #fff; border-radius: 12px;
}
.product-card h3 { font-size: .95rem; color: var(--primary-dark); margin-bottom: 4px; }
.product-weight { font-size: .77rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.product-uses {
  font-size: .82rem; color: var(--muted); margin-bottom: 6px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.4rem;
}
.product-note { font-size: .73rem; color: var(--primary-light); margin-bottom: 8px; }
.product-details-btn {
  margin-top: auto; border: 1px solid var(--primary-light); color: var(--primary-dark);
  background: rgba(199,107,34,.08); font-weight: 700;
}
.product-details-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== QUALITY ===== */
.quality { padding: 80px 0; background: var(--surface); position: relative; }
.quality::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--gold) 50%, var(--primary-light) 100%);
}
.quality .section-tag { background: rgba(122,62,18,.08); color: var(--primary); }
.quality .section-title { color: var(--primary-dark); }
.quality-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 24px;
  transition: all var(--transition); height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  position: relative; overflow: hidden;
}
.quality-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold); transition: height var(--transition);
}
.quality-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); }
.quality-card:hover::before { height: 5px; }
.quality-icon { font-size: 2.2rem; margin-bottom: 16px; line-height: 1; height: 44px; display: flex; align-items: center;
  width: 44px; justify-content: center; }
.quality-onssa-img { height: 44px; width: auto; margin-bottom: 16px; transition: transform var(--transition); }
.quality-card:hover .quality-onssa-img { transform: scale(1.1); }
.trust-onssa-img { width: 60px; height: auto; margin-bottom: 10px; display: block; }
.quality-card h3 { color: var(--primary-dark); font-size: 1.08rem; margin-bottom: 10px; font-weight: 700; }
.quality-card p { color: var(--muted); font-size: .9rem; margin-bottom: 0; line-height: 1.7; }

/* ===== FOOTER ===== */
.site-footer { background: #1a0e05; color: rgba(255,255,255,.7); }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { width: 52px; height: 52px; object-fit: contain; margin-bottom: 12px; filter: brightness(0) invert(1); opacity: .8; }
.footer-tagline { font-size: .92rem; line-height: 1.6; }
.footer-links h4, .footer-contact h4, .footer-lang h4 { color: var(--gold); font-size: .95rem; margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,.7); font-size: .9rem; transition: color var(--transition); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.footer-contact p { font-size: .9rem; margin-bottom: 10px; }
.footer-map {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--gold); font-weight: 600; font-size: .88rem;
  transition: color var(--transition); text-decoration: none;
}
.footer-map:hover { color: var(--gold-light); }
.footer-email { margin-top: 8px; }
.footer-email a { color: var(--gold); font-weight: 600; font-size: .88rem; transition: color var(--transition); text-decoration: none; }
.footer-email a:hover { color: var(--gold-light); }
.footer-lang a { color: rgba(255,255,255,.7); font-size: .9rem; transition: color var(--transition); text-decoration: none; }
.footer-lang a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0;
  font-size: .82rem; color: rgba(255,255,255,.4);
}

/* ===== CONTACT PAGE ===== */
.contact-hero { padding-top: 130px; padding-bottom: 40px; }
.contact-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.contact-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow);
}
.contact-form-card h3 { font-size: 1.2rem; color: var(--primary-dark); margin-bottom: 20px; }
.contact-form .form-control {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-size: .95rem; background: var(--bg); transition: border-color var(--transition);
}
.contact-form .form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 .2rem rgba(199,107,34,.15); }
.contact-form .form-label { font-weight: 600; color: var(--primary-dark); font-size: .9rem; }
.contact-side .trust-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.contact-side .trust-item h4 { color: var(--primary-dark); margin-bottom: 6px; }
.contact-side .trust-item p { color: var(--muted); font-size: .9rem; margin-bottom: 0; }
.form-feedback { min-height: 20px; color: var(--primary); font-weight: 700; font-size: .9rem; }
.location-link {
  display: inline-flex; color: var(--primary-light); font-weight: 600; font-size: .88rem;
  margin-top: 6px; border-bottom: 2px solid var(--gold); text-decoration: none;
}
.location-link:hover { color: var(--primary-dark); }

/* ===== BLOG ===== */
.blog-hero {
  padding: 140px 0 60px; text-align: center;
  background: linear-gradient(135deg, #3e1c08 0%, #7a3e12 50%, #c76b22 100%);
  color: #fff;
}
.blog-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 12px; }
.blog-hero p { color: rgba(255,255,255,.8); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

.blog-grid { padding: 60px 0; }
.blog-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all var(--transition); height: 100%;
  display: flex; flex-direction: column;
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); }
.blog-card-img {
  height: 200px; background: linear-gradient(135deg, #f9f0e0, #fdf8f0);
  display: flex; align-items: center; justify-content: center; font-size: 3.5rem;
  border-bottom: 3px solid var(--gold);
}
.blog-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-tag {
  display: inline-block; background: rgba(122,62,18,.08); color: var(--primary);
  font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
  width: fit-content;
}
.blog-card-body h3 { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 10px; line-height: 1.6; }
.blog-card-body p { font-size: .88rem; color: var(--muted); margin-bottom: 16px; flex: 1; line-height: 1.7; }
.blog-card-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--primary-light);
  font-weight: 600; font-size: .9rem; text-decoration: none;
  border-bottom: 2px solid transparent; transition: all var(--transition);
}
.blog-card-link:hover { color: var(--primary-dark); border-bottom-color: var(--gold); }

/* Article page */
.article-hero {
  padding: 140px 0 50px; text-align: center;
  background: linear-gradient(135deg, #3e1c08 0%, #7a3e12 50%, #c76b22 100%);
  color: #fff;
}
.article-hero .breadcrumb { justify-content: center; margin-bottom: 16px; }
.article-hero .breadcrumb a { color: var(--gold-light); text-decoration: none; font-size: .9rem; }
.article-hero .breadcrumb span { color: rgba(255,255,255,.6); font-size: .9rem; }
.article-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; max-width: 800px; margin: 0 auto 16px; line-height: 1.5; }
.article-hero .article-meta { color: rgba(255,255,255,.7); font-size: .9rem; }

.article-content { padding: 60px 0; }
.article-body {
  max-width: 800px; margin: 0 auto;
  font-size: 1.05rem; line-height: 2; color: #3a3a3a;
}
.article-body h2 {
  font-size: 1.4rem; color: var(--primary-dark); margin: 40px 0 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--gold); font-weight: 700;
}
.article-body h3 { font-size: 1.15rem; color: var(--primary); margin: 28px 0 12px; font-weight: 700; }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { padding-right: 24px; margin-bottom: 18px; }
.lang-fr .article-body ul, .lang-fr .article-body ol { padding-right: 0; padding-left: 24px; }
.article-body li { margin-bottom: 8px; line-height: 1.9; }
.article-body strong { color: var(--primary-dark); }
.article-body blockquote {
  background: linear-gradient(135deg, #fdf8f0, #f9f0e0);
  border-right: 4px solid var(--gold); padding: 20px 24px;
  border-radius: var(--radius); margin: 24px 0; font-style: italic; color: var(--primary);
}
.lang-fr .article-body blockquote { border-right: none; border-left: 4px solid var(--gold); }

.article-sidebar { position: sticky; top: 100px; }
.article-toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.article-toc h4 { font-size: 1rem; color: var(--primary-dark); margin-bottom: 14px; font-weight: 700; }
.article-toc ul { list-style: none; padding: 0; margin: 0; }
.article-toc li { margin-bottom: 8px; }
.article-toc a {
  color: var(--muted); font-size: .88rem; text-decoration: none;
  transition: color var(--transition); display: block; padding: 4px 0;
}
.article-toc a:hover { color: var(--primary-light); }

.article-cta {
  background: linear-gradient(135deg, #fdf8f0, #f9f0e0);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; text-align: center; margin-top: 40px;
}
.article-cta h3 { color: var(--primary-dark); font-size: 1.15rem; margin-bottom: 10px; }
.article-cta p { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.article-cta .btn-primary {
  background: var(--primary); border: none; border-radius: var(--radius);
  padding: 10px 28px; font-weight: 600; transition: all var(--transition);
}
.article-cta .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.related-articles { padding: 60px 0; background: var(--bg); }
.related-articles h2 { text-align: center; color: var(--primary-dark); margin-bottom: 32px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    background: rgba(253,250,245,.98);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 16px;
    margin-top: 8px;
    box-shadow: var(--shadow);
  }
  .about-logo-box { width: 180px; height: 180px; }
  .about-logo-box img { max-width: 130px; }
}

@media (max-width: 767.98px) {
  .hero { min-height: 80vh; }
  .hero-content { padding: 100px 0 60px; }
  .hero-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  .brand-logo { width: 36px; height: 36px; }
}
