/* ═══════════════════════════════════════════════════════════════
   BASE — loaded on every frontend page (Home, Products, Suppliers, About).
   Design tokens, reset, navbar, footer, and the small set of components
   (section heading pattern, about-img, division-card) reused across pages.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --primary-light: #e8f0fe;
  --secondary: #00b894;
  --accent: #6c63ff;
  --logo-blue: #0a51f2;
  --bg: #f5f7fb;
  --text: #2d3436;
  --text-muted: #636e72;
  --text-light: #b2bec3;
  --border: #e9ecef;
  --shadow-sm: 0 2px 12px rgba(13,110,253,0.06);
  --shadow-md: 0 8px 32px rgba(13,110,253,0.10);
  --shadow-lg: 0 20px 60px rgba(13,110,253,0.14);
  --radius: 12px;
  --radius-lg: 20px;

  /* Type tokens — every font-family/font-size declaration site-wide reads
     from these instead of hardcoding a value, so a single override below
     re-fonts and re-scales Khmer pages without touching English at all. */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --km-scale: 1;
}

/* Khmer script isn't covered by Poppins/Inter — use a proper Khmer webfont
   for consistent rendering across devices instead of relying on whatever
   fallback font each visitor's OS happens to ship. --km-scale is an
   independent size multiplier: every font-size in the codebase is written
   as calc(<value> * var(--km-scale, 1)), so changing this one number here
   rescales all Khmer text without affecting the English pages at all. */
html[lang="km"] {
  --font-heading: 'Noto Sans Khmer', sans-serif;
  --font-body: 'Noto Sans Khmer', sans-serif;
  --km-scale: 1;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 99px; }

/* ─── NAVBAR ─── */
#mainNav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.6);
  transition: all 0.35s ease;
  padding: 0.75rem 0;
}
#mainNav.scrolled {
  box-shadow: 0 4px 30px rgba(13,110,253,0.10);
  padding: 0.5rem 0;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand-logo { height: 42px; width: auto; }
.footer-logo { height: 56px; background: #fff; padding: 6px 12px; border-radius: 8px; }
.nav-link {
  font-family: var(--font-heading);
  font-size: calc(0.85rem * var(--km-scale, 1));
  font-weight: 500;
  color: var(--text) !important;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color 0.25s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 1rem; right: 1rem;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  border-radius: 99px;
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--primary) !important; }
.nav-cta {
  background: var(--primary);
  color: white !important;
  border-radius: 8px;
  padding: 0.45rem 1.2rem !important;
  transition: background 0.25s, transform 0.2s, box-shadow 0.2s !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover {
  background: var(--primary-dark) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13,110,253,0.35);
}

/* ─── LANGUAGE SWITCHER ─── */
.lang-switch {
  display: flex; align-items: center; gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
}
.lang-switch a {
  display: flex; align-items: center; justify-content: center;
  padding: 0.3rem;
  border-radius: 5px;
  transition: background 0.2s;
  line-height: 1;
}
.lang-switch a .fi {
  width: 20px; height: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.lang-switch a:hover { background: rgba(13,110,253,0.08); }
.lang-switch a.active { background: var(--primary); }
.lang-switch a.active .fi { box-shadow: 0 0 0 1px rgba(255,255,255,0.5); }
.lang-switch a:not(.active) .fi { opacity: 0.55; }
.lang-switch a:not(.active):hover .fi { opacity: 0.85; }

/* ─── SECTION HEADING PATTERN ─── */
section { padding: 90px 0; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: calc(0.75rem * var(--km-scale, 1));
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.section-label i { font-size: calc(0.8rem * var(--km-scale, 1)); color: var(--secondary); }
.section-title {
  font-size: calc(clamp(1.7rem, 3vw, 2.4rem) * var(--km-scale, 1));
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.section-sub {
  color: var(--text-muted);
  font-size: calc(1rem * var(--km-scale, 1));
  max-width: 560px;
  margin-top: 0.75rem;
}
.divider-line {
  width: 50px; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px;
  margin: 1rem 0 0;
}

/* ─── ABOUT-IMG COMPONENT (Home + About pages) ─── */
.about-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.about-img-wrapper img {
  width: 100%; height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}
.about-img-badge {
  position: absolute;
  bottom: 20px; right: 20px;
  background: white;
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
}
.about-img-badge .icon-box {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: calc(1rem * var(--km-scale, 1));
}
.about-img-badge p { margin: 0; font-size: calc(0.78rem * var(--km-scale, 1)); color: var(--text-muted); }
.about-img-badge strong { font-family: var(--font-heading); font-size: calc(0.9rem * var(--km-scale, 1)); color: var(--text); display: block; }

/* ─── DIVISION CARD COMPONENT (Home + About pages) ─── */
.division-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  height: 100%;
  display: flex; flex-direction: column;
}
.division-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.division-header {
  padding: 2rem 1.8rem 1.5rem;
  position: relative;
}
.div-1 .division-header { background: linear-gradient(135deg, #0d6efd 0%, #4f8ef7 100%); }
.div-2 .division-header { background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%); }
.div-3 .division-header { background: linear-gradient(135deg, #2d3436 0%, #636e72 100%); }
.division-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(1.5rem * var(--km-scale, 1));
  color: white;
  margin-bottom: 1rem;
  backdrop-filter: blur(4px);
}
.division-header h3 {
  font-size: calc(1.25rem * var(--km-scale, 1));
  font-weight: 700;
  color: white;
  margin: 0;
  letter-spacing: -0.3px;
}
.division-body {
  padding: 1.8rem;
  flex: 1;
  display: flex; flex-direction: column;
}
.division-body p {
  font-size: calc(0.88rem * var(--km-scale, 1));
  color: var(--text-muted);
  line-height: 1.75;
  flex: 1;
}
.division-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 1.2rem 0;
}
.div-tag {
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
  font-size: calc(0.72rem * var(--km-scale, 1));
  font-weight: 600;
  letter-spacing: 0.3px;
}
.div-1 .div-tag { background: #e8f0fe; color: var(--primary); }
.div-2 .div-tag { background: #fef5e7; color: #e67e22; }
.div-3 .div-tag { background: #f0f0f0; color: #2d3436; }

/* ─── FADE-UP / FLOAT ANIMATIONS ─── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

@keyframes floatSlow {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
.float-slow { animation: floatSlow 7s ease-in-out infinite; }

/* ─── BACK TO TOP ─── */
#backTop {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(1rem * var(--km-scale, 1));
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(13,110,253,0.35);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 999;
  pointer-events: none;
}
#backTop.show { opacity: 1; transform: translateY(0); pointer-events: all; }
#backTop:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ─── FOOTER ─── */
footer {
  background: #0f1724;
  color: rgba(255,255,255,0.75);
}
.footer-top { padding: 70px 0 50px; }
.footer-desc {
  font-size: calc(0.85rem * var(--km-scale, 1));
  color: rgba(255,255,255,0.5);
  margin-top: 1rem;
  max-width: 260px;
  line-height: 1.7;
}
.footer-social { display: flex; gap: 10px; margin-top: 1.5rem; }
.social-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: calc(0.85rem * var(--km-scale, 1));
  transition: all 0.25s;
}
.social-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}
.footer-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: calc(0.85rem * var(--km-scale, 1));
  color: white;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.7rem; }
.footer-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: calc(0.86rem * var(--km-scale, 1));
  transition: color 0.25s;
  display: inline-flex; align-items: center; gap: 6px;
}
.footer-links a:hover { color: var(--primary); }
.footer-links a i { font-size: calc(0.7rem * var(--km-scale, 1)); }
.contact-item {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 1rem;
}
.contact-item .ci-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: calc(0.82rem * var(--km-scale, 1));
  margin-top: 1px;
}
.contact-item p { font-size: calc(0.83rem * var(--km-scale, 1)); color: rgba(255,255,255,0.5); margin: 0; line-height: 1.6; }
.footer-divider {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0;
}
.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-bottom p { font-size: calc(0.78rem * var(--km-scale, 1)); color: rgba(255,255,255,0.3); margin: 0; }
.footer-bottom a { color: rgba(255,255,255,0.4); text-decoration: none; font-size: calc(0.78rem * var(--km-scale, 1)); transition: color 0.2s; }
.footer-bottom a:hover { color: var(--primary); }

/* ─── RESPONSIVE ─── */
@media (max-width: 575px) {
  section { padding: 60px 0; }
}
