/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --color-primary: #0072CE;
  --color-primary-dark: #003C6B;
  --color-primary-light: #4FA8E8;
  --color-secondary: #D4A017;
  --color-bg: #F8FAFC;
  --color-text: #1F2937;
  --color-muted: #5B6B80;
  --color-border: #E2E8F0;
  --color-glass-bg: rgba(255, 255, 255, 0.55);
  --color-glass-border: rgba(255, 255, 255, 0.35);
  --shadow-soft: 0 12px 30px rgba(0, 114, 206, 0.14);
  --shadow-strong: 0 22px 54px rgba(0, 60, 107, 0.26);
  --radius-sm: 4px;
  --radius-md: 8px;
  --header-h: 76px;
  --container-w: 1240px;
  --font-fa: 'Vazirmatn', sans-serif;
  --font-en: 'Poppins', sans-serif;
  --font-body: 'Vazirmatn', 'Poppins', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   RESET
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
  overflow-y: visible;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea { font-family: inherit; }
ul { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section.container { padding: 88px 24px; max-width: var(--container-w); margin: 0 auto; }
.section.narrow.container { max-width: 760px; }

.section-heading {
  position: relative;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 26px;
  padding-bottom: 16px;
  text-align: center;
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0; inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.8s var(--ease) 0.15s;
}
.reveal.in-view .section-heading::after,
.section-heading.in-view::after { width: 56px; }
body.lang-fa .section-heading::after { transform: translateX(50%); }
.section-heading.center { text-align: center; }

/* Exception: the "About Us" heading on the home page keeps its original
   start-aligned layout (paired with the two-column intro paragraph) */
#aboutTitle { text-align: start; }
#aboutTitle::after { inset-inline-start: 0; transform: none; }
body.lang-fa #aboutTitle::after { transform: none; }

.section-text { color: var(--color-muted); font-size: 1.05rem; max-width: 60ch; text-align: justify; }
.section-text.center { margin: 0 auto 20px; text-align: justify; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  margin-top: 10px;
}
.btn-primary {
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-secondary);
  color: var(--color-secondary);
}
.btn-secondary:hover { background: var(--color-secondary); color: var(--color-primary-dark); }
.btn-ghost {
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  padding: 10px 18px;
  font-size: 0.85rem;
  margin-inline-start: 20px;
}
.btn-ghost:hover { background: var(--color-border); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: #F8FAFC;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(15, 76, 129, 0.10);
  border-bottom-color: transparent;
}

.header-inner {
  height: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--color-primary-dark); }
.logo-mark { color: var(--color-secondary); display: flex; }
.logo-text { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.2px; }

.main-nav > ul { display: flex; gap: 4px; }
.main-nav li { position: relative; }
.nav-item-row { display: flex; align-items: center; }
.nav-panel-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}
.nav-panel-title { font-weight: 700; color: var(--color-primary-dark); font-size: 1.05rem; }
.nav-close { font-size: 1.7rem; line-height: 1; color: var(--color-muted); padding: 4px 8px; }
.nav-close:hover { color: var(--color-primary); }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  border-radius: 8px;
  transition: color 0.2s, background 0.25s var(--ease), transform 0.2s var(--ease);
}
.nav-link:hover { background: rgba(0, 114, 206, 0.08); transform: translateY(-1px); }
.nav-caret {
  width: 7px; height: 7px;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -4px;
  opacity: 0.55;
  transition: transform 0.25s var(--ease);
}
.has-submenu:hover > .nav-item-row .nav-caret,
.has-submenu:focus-within > .nav-item-row .nav-caret { transform: rotate(225deg); margin-top: 2px; }

.submenu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  min-width: 250px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  z-index: 220;
}
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--color-text);
  transition: background 0.15s, color 0.15s;
}
.submenu li a:hover { background: rgba(0, 114, 206, 0.08); color: var(--color-primary); }

/* Second-level flyout (product categories with sub-items) — opens to the
   side of the first-level dropdown on desktop */
.submenu .submenu-lvl2 {
  top: -8px;
  inset-inline-start: 100%;
  margin-inline-start: 8px;
}
.submenu .has-submenu > .nav-item-row .nav-link.submenu-link { padding-inline-end: 4px; }
.product-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-inline-start: 8px;
  border-radius: 10px;
  background: rgba(0, 114, 206, 0.1);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
}
.banner-breadcrumb {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-secondary);
  margin-bottom: 6px;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 2px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.header-tools { display: flex; align-items: center; gap: 14px; }

.search-wrap { position: relative; }
.search-form {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 22px;
  padding: 6px 8px 6px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(0, 114, 206, 0.12); }
body.lang-fa .search-form { padding: 6px 14px 6px 8px; }
.search-form input {
  border: none;
  outline: none;
  width: 150px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--color-text);
}
.search-form button { color: var(--color-primary); display: flex; padding: 6px; border-radius: 50%; transition: background 0.2s; }
.search-form button:hover { background: rgba(0, 114, 206, 0.1); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  z-index: 210;
  display: none;
}
.search-dropdown.open { display: block; }
.search-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.search-dropdown a:last-child { border-bottom: none; }
.search-dropdown a:hover { background: rgba(0, 114, 206, 0.06); color: var(--color-primary); }
.search-dropdown .tag { font-size: 0.72rem; color: var(--color-muted); background: var(--color-bg); padding: 3px 8px; border-radius: 10px; }
.search-dropdown .empty { padding: 16px; font-size: 0.85rem; color: var(--color-muted); text-align: center; }

.lang-toggle {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.lang-toggle:hover { background: var(--color-primary); color: #fff; }

/* Mobile search icon button — hidden on desktop, shown in the 980px media query */
.search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--color-primary);
  transition: background 0.2s;
}
.search-toggle:hover { background: rgba(0, 114, 206, 0.1); }
.search-toggle.active { background: rgba(0, 114, 206, 0.12); }

.menu-toggle { display: none; flex-direction: column; gap: 5px; width: 26px; }
.menu-toggle span { height: 2px; background: var(--color-primary-dark); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  min-height: 520px;
  overflow: hidden;
}
.hero-slider { position: relative; height: 100%; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transform: translateX(0) scale(1.02);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.hero-slide.active { opacity: 1; visibility: visible; z-index: 2; transform: translateX(0) scale(1); }
.hero-slide.enter-next { visibility: visible; opacity: 0; transform: translateX(5%) scale(1.02); z-index: 3; }
.hero-slide.enter-prev { visibility: visible; opacity: 0; transform: translateX(-5%) scale(1.02); z-index: 3; }
.hero-slide.exit-next  { opacity: 0; transform: translateX(-5%) scale(1); z-index: 1; }
.hero-slide.exit-prev  { opacity: 0; transform: translateX(5%) scale(1); z-index: 1; }
.hero-media {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.14);
  transition: transform 6.5s linear;
}
.hero-slide.active .hero-media { transform: scale(1); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,38,71,0.5) 0%, rgba(0,38,71,0.78) 100%);
}
.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  max-width: 640px;
}

/* Eyebrow: small accent line + slide counter, revealed first */
.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(14px);
}
.hero-eyebrow-line {
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.7s var(--ease) 0.15s;
}
.hero-eyebrow-num {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-secondary);
  white-space: nowrap;
}
.hero-slide.active .hero-eyebrow { animation: heroFadeUp 0.6s var(--ease) 0.05s forwards; }
.hero-slide.active .hero-eyebrow-line { width: 42px; }

/* Title: curtain-reveal mask */
.hero-title { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; margin-bottom: 18px; }
.title-mask { display: block; overflow: hidden; }
.title-inner { display: block; transform: translateY(112%); }
.hero-slide.active .title-inner { animation: titleRise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards; }

.hero-text {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 8px;
  max-width: 52ch;
  opacity: 0;
  transform: translateY(20px);
}
.hero-slide.active .hero-text { animation: heroFadeUp 0.8s var(--ease) 0.62s forwards; }

@keyframes heroFadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes titleRise { to { transform: translateY(0); } }

/* CTA button: bouncy pop-in + shine sweep + arrow travel on hover */
.hero-cta {
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  gap: 10px;
}
.hero-slide.active .hero-cta { animation: heroButtonIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.88s forwards; }
@keyframes heroButtonIn { to { opacity: 1; transform: translateY(0) scale(1); } }
.hero-cta::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.hero-cta:hover::before { left: 130%; }
.hero-cta-arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.hero-cta:hover .hero-cta-arrow { transform: translateX(5px); }
body.lang-fa .hero-cta-arrow { transform: scaleX(-1); }
body.lang-fa .hero-cta:hover .hero-cta-arrow { transform: scaleX(-1) translateX(-5px); }

/* Reading-direction icons used across CTA/back buttons — these DO mirror
   with the language, unlike carousel prev/next controls which never do. */
.icon-forward, .icon-back { transition: transform 0.25s var(--ease); }
.btn:hover .icon-forward { transform: translateX(3px); }
.btn:hover .icon-back { transform: translateX(-3px); }
body.lang-fa .icon-forward { transform: scaleX(-1); }
body.lang-fa .btn:hover .icon-forward { transform: scaleX(-1) translateX(3px); }
body.lang-fa .icon-back { transform: scaleX(-1); }
body.lang-fa .btn:hover .icon-back { transform: scaleX(-1) translateX(-3px); }

.hero-arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  z-index: 4; color: #fff; font-size: 1.1rem;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.hero-arrow:hover { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.55); transform: translateY(-50%) scale(1.08); }
.hero-arrow.prev { left: 24px; }
.hero-arrow.next { right: 24px; }
/* Prev/next always behave and point the same way regardless of language */

.hero-dots {
  position: absolute; bottom: 34px; left: 0; right: 0;
  z-index: 4; display: flex; justify-content: center; gap: 10px;
}
.hero-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.hero-dot.active { background: var(--color-secondary); transform: scale(1.25); box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.25); }

.hero-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; z-index: 4;
  background: rgba(255,255,255,0.18);
}
.hero-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--color-secondary);
  transform-origin: left;
  transform: scaleX(0);
}
.hero:hover .hero-progress-bar { animation-play-state: paused; }
@keyframes heroProgressFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Mobile: shorter hero so the slide photo reads big and clear —
   a lighter overlay keeps the image visible under the text. */
@media (max-width: 760px) {
  .hero { height: calc(64vh - var(--header-h)); min-height: 400px; }
  .hero-overlay { background: linear-gradient(180deg, rgba(0,38,71,0.32) 0%, rgba(0,38,71,0.66) 100%); }
}


/* ============================================================
   TWO COLUMN / MEDIA FRAME
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.media-frame {
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  width: 100%;
  object-fit: cover;
  display: block;
  background-color: #0A2E4D;
}
.media-frame.small { margin-top: 24px; }

/* ============================================================
   PRODUCT GALLERY INFO PANEL (replaces the old video block)
   ============================================================ */
.gallery-info-panel {
  position: relative;
  background: linear-gradient(135deg, #F3F8FD 0%, #EAF3FC 100%);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
}
.gallery-info-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg,
    rgba(0, 114, 206, 0.045) 0 10px, transparent 10px 26px);
  pointer-events: none;
}
.gallery-info-panel > * { position: relative; }
.gallery-info-text {
  color: var(--color-muted);
  font-size: 1.02rem;
  line-height: 2;
  text-align: justify;
  text-justify: inter-word;
  margin-bottom: 20px;
}
.gallery-info-divider {
  height: 3px; width: 64px; border-radius: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  margin-bottom: 20px;
}
/* Entrance choreography — fired by the .reveal.in-view observer */
.gallery-info-panel .gallery-info-text,
.gallery-info-panel .gallery-info-divider,
.gallery-info-panel .gallery-info-cta {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.gallery-info-panel.in-view .gallery-info-text   { transition-delay: 0.10s; }
.gallery-info-panel.in-view .gallery-info-divider { transition-delay: 0.24s; }
.gallery-info-panel.in-view .gallery-info-cta    { transition-delay: 0.38s; }
.gallery-info-panel.in-view .gallery-info-text,
.gallery-info-panel.in-view .gallery-info-divider,
.gallery-info-panel.in-view .gallery-info-cta {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .gallery-info-panel .gallery-info-text,
  .gallery-info-panel .gallery-info-divider,
  .gallery-info-panel .gallery-info-cta {
    opacity: 1; transform: none; transition: none;
  }
}

/* ============================================================
   BATCH CAROUSEL (shared by Partners/Clients & Certificates)
   ============================================================ */
.partners-section {
  padding: 70px 0;
  background: linear-gradient(180deg, #fff, #F3F8FD);
  border-block: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.partners-section::before {
  content: '';
  position: absolute; top: -60px; inset-inline-end: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,114,206,0.08), transparent 70%);
}

.batch-carousel { position: relative; overflow: hidden; margin-top: 12px; }
.batch-track { display: flex; will-change: transform; direction: ltr; }
.batch-track > * { flex-shrink: 0; }

/* Square items (partners/clients): 6 visible, gap via margin */
.batch-square .batch-track > * {
  width: calc((100% - 5 * 22px) / 6);
  margin-inline-end: 22px;
}
/* Portrait items (certificates): 4 visible */
.batch-portrait .batch-track > * {
  width: calc((100% - 3 * 22px) / 4);
  margin-inline-end: 22px;
}

.batch-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-soft);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background 0.2s, transform 0.2s;
}
.batch-nav:hover { background: var(--color-primary); color: #fff; transform: translateY(-50%) scale(1.08); }
.batch-nav.prev { left: -14px; }
.batch-nav.next { right: -14px; }
/* Prev/next always behave and point the same way regardless of language */

.logo-item {
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  opacity: 0.75;
  filter: grayscale(0.4);
  transition: opacity 0.3s, filter 0.3s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.logo-item:hover { opacity: 1; filter: grayscale(0); transform: translateY(-5px); box-shadow: var(--shadow-strong); }
.logo-item img { width: 100%; height: 100%; object-fit: contain; }

.cert-card {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cert-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.cert-card::after {
  content: '\1F50D';
  position: absolute; inset: auto 12px 12px auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
}
.cert-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-strong); }
.cert-card:hover img { transform: scale(1.08); }
.cert-card:hover::after { opacity: 1; transform: scale(1); }

@media (max-width: 980px) {
  .batch-square .batch-track > * { width: calc((100% - 2 * 14px) / 3); margin-inline-end: 14px; }
  .batch-portrait .batch-track > * { width: calc((100% - 1 * 14px) / 2); margin-inline-end: 14px; }
  .batch-nav.prev { left: 4px; }
  .batch-nav.next { right: 4px; }
}
@media (max-width: 560px) {
  .batch-square .batch-track > * { width: calc((100% - 1 * 10px) / 2); margin-inline-end: 10px; }
  .batch-portrait .batch-track > * { width: calc((100% - 1 * 10px) / 2); margin-inline-end: 10px; }
}

/* ============================================================
   GLASS PANELS
   ============================================================ */
.glass-panel {
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-soft);
}
.mv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.mv-grid .glass-panel {
  border-inline-start: 3px solid var(--color-primary);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.mv-grid .glass-panel:hover { transform: translateY(-5px); box-shadow: var(--shadow-strong); }
.glass-panel h3 { color: var(--color-primary-dark); font-size: 1.25rem; margin-bottom: 12px; }
.glass-panel p { color: var(--color-muted); text-align: justify; }

/* ============================================================
   PAGE BANNER (inner pages)
   ============================================================ */
.page-banner {
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  padding: 70px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 26px);
}
.page-banner h1 { position: relative; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
.page-banner .btn-ghost { position: relative; color: #fff; border-color: rgba(255,255,255,0.4); }
.page-banner .btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   PAGES
   ============================================================ */
.page-section { display: none; }
.page-section.active { display: block; animation: pageIn 0.5s var(--ease); }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* Values */
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.value-chip {
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-secondary);
  background: #fff;
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.value-chip:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-inline-start-color: var(--color-primary);
}

/* Bullet lists (core/auxiliary products, development projects) */
.bullet-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bullet-list li {
  position: relative;
  padding-inline-start: 22px;
  color: var(--color-muted);
  text-align: justify;
}
.bullet-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 2px;
  top: 8px;
  width: 7px; height: 7px;
  background: var(--color-secondary);
  transform: rotate(45deg);
}
.bullet-list-wide { max-width: 800px; margin: 22px auto 0; gap: 14px; }

/* OEM partner / approval badges */
.oem-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; }
.oem-badge {
  padding: 12px 26px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 30px;
  font-weight: 700;
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.oem-badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); border-color: var(--color-secondary); }



/* CTA band */
.cta-band {
  text-align: center;
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 60px 24px;
  box-shadow: var(--shadow-strong);
}
.cta-band h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin-bottom: 6px; }

/* Products grid */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  text-align: start;
}
/* Card media: a two-layer background instead of a static <img> — the
   thumbnail is randomly picked from the item's own gallery and rotates
   every 3s with a true crossfade: the next photo is set on the hidden
   layer, which then fades in over the current one (see CARD THUMBNAIL
   ROTATOR in script.js). The frame stays a uniform 4:3. */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #F3F8FD;
  overflow: hidden;
}
.card-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.card-layer.is-front { opacity: 1; }
.product-card:not(.static):hover { transform: translateY(-6px); box-shadow: var(--shadow-strong); }
.product-card:not(.static):hover .card-media { transform: scale(1.07); }
@media (prefers-reduced-motion: reduce) {
  .card-layer { transition: none; }
}
.product-card.static { cursor: zoom-in; }
.product-card.static:hover img { transform: scale(1.06); }
.product-name {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
  font-weight: 600;
  color: var(--color-primary-dark);
}
.product-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-name::after {
  content: '\2192';
  flex-shrink: 0;
  color: var(--color-secondary);
  transition: transform 0.3s var(--ease);
}
body.lang-fa .product-name::after { content: '\2190'; }
.product-card:hover .product-name::after { transform: translateX(4px); }
body.lang-fa .product-card:hover .product-name::after { transform: translateX(-4px); }

/* Gallery slider (product page)
   Slides keep a square frame, but images use `contain` so landscape and
   portrait photos both display fully — never stretched or cropped. */
.gallery-block { display: flex; flex-direction: column; gap: 14px; }
.gallery-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 1/1;
  background:
    repeating-linear-gradient(135deg, rgba(0, 114, 206, 0.03) 0 12px, transparent 12px 24px),
    var(--color-bg);
  touch-action: pan-y;
}
.gallery-strip { display: flex; height: 100%; direction: ltr; transition: transform 0.55s var(--ease); }
.gallery-slide { flex: 0 0 100%; height: 100%; cursor: zoom-in; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gallery-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
}
.gallery-slide:hover img { transform: scale(1.05); }

/* Loading / empty states */
.gallery-loading { text-align: center; color: var(--color-muted); padding: 30px 0; }
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

/* Badge bar above the production-line gallery grid */
.gallery-grid-bar {
  display: flex;
  margin-bottom: 14px;
}

/* Gallery grid (production-line gallery): auto-adaptive masonry —
   portrait items span 2 rows so mixed orientations tile neatly and any
   image count flows naturally into the columns. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  gap: 16px;
}
.gallery-grid-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  cursor: zoom-in;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.gallery-grid-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-strong); }
.gallery-grid-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.4s var(--ease);
}
.gallery-grid-item:hover img { transform: scale(1.04); }
.gallery-grid-item.img-portrait { grid-row: span 2; }
.gallery-grid-item.img-landscape.wide { grid-column: span 2; }
.gallery-counter {
  position: absolute; bottom: 14px; inset-inline-start: 14px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 14px;
  z-index: 3;
}
.gallery-zoom-hint {
  position: absolute; bottom: 14px; inset-inline-end: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; z-index: 3; pointer-events: none;
}
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.85); box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
  transition: background 0.2s;
}
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 14px; }
.gallery-nav.next { right: 14px; }
/* Prev/next always behave and point the same way regardless of language */

/* Autoplay toggle: bottom-right (opposite the counter), play/pause icons
   swap via the .on state — mirrors the hero slider's pause-on-hover idea
   but as an explicit user-controlled toggle. */
.gallery-autoplay {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow-soft);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
  transition: background 0.2s, color 0.2s;
}
.gallery-autoplay:hover { background: #fff; }
.gallery-autoplay .ic-pause { display: none; }
.gallery-autoplay.on { background: var(--color-primary); color: #fff; }
.gallery-autoplay.on .ic-play { display: none; }
.gallery-autoplay.on .ic-pause { display: block; }

.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* Numeric badge showing total image count, sits as the first grid cell */
.gallery-thumbs-bar {
  display: flex;
  align-items: center;
}
.gallery-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(0, 114, 206, 0.08);
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.gallery-count-badge svg { flex-shrink: 0; }

.gallery-thumb {
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity 0.25s, border-color 0.25s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover { opacity: 0.9; }
.gallery-thumb.active { opacity: 1; border-color: var(--color-primary); }

/* Lines grid */
.lines-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.line-card {
  display: grid;
  grid-template-columns: 45% 1fr;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #fff;
  text-align: start;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.line-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-strong); }
.line-image { background-size: cover; background-position: center; min-height: 160px; transition: transform 0.5s var(--ease); }
.line-card:hover .line-image { transform: scale(1.05); }
.line-info { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.line-info h3 { color: var(--color-primary-dark); }
.line-info p { color: var(--color-muted); font-size: 0.92rem; text-align: justify; }
.link-arrow { margin-top: auto; color: var(--color-secondary); font-weight: 600; font-size: 0.88rem; }
.link-arrow::after { content: ' \2192'; }
body.lang-fa .link-arrow::after { content: ' \2190'; }

/* Contact CTA panel (replaces old forms) */
.cta-contact-panel { text-align: center; }
.cta-contact-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.cta-contact-actions .btn { margin-top: 0; }
.cta-contact-actions .btn svg { flex-shrink: 0; }
.cta-contact-meta {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.cta-contact-meta .dot { color: var(--color-secondary); }

/* Search results page */
.search-results-list { display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin: 0 auto; }
.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.search-result-item:hover { transform: translateX(4px); box-shadow: var(--shadow-strong); }
body.lang-fa .search-result-item:hover { transform: translateX(-4px); }
.search-result-title { font-weight: 600; color: var(--color-primary-dark); }
.search-result-tag { font-size: 0.75rem; color: #fff; background: var(--color-secondary); padding: 4px 10px; border-radius: 12px; }
.search-empty-state { text-align: center; color: var(--color-muted); padding: 40px 0; }

/* Contact info */
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.info-row { padding: 16px 18px; background: #fff; border-inline-start: 4px solid var(--color-primary); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); display: block; }
.info-row strong { color: var(--color-primary-dark); margin-inline-end: 8px; }
.info-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-primary);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.info-row-link svg { flex-shrink: 0; }
.info-row-link strong, .info-row-link span { color: var(--color-text); }
.info-row-link:hover { transform: translateX(4px); box-shadow: var(--shadow-strong); border-inline-start-color: var(--color-secondary); }
body.lang-fa .info-row-link:hover { transform: translateX(-4px); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,20,30,0.86);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease);
  padding: 30px;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;   /* always render at true aspect ratio */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
  /* transform is driven by the pinch-zoom module (JS) */
  transition: transform 0.25s var(--ease);
  touch-action: none;          /* let JS own all touch gestures here */
  will-change: transform;
  cursor: zoom-in;
}
.lightbox img.zoomed {
  transition: none;            /* no smoothing while panning */
  cursor: grab;
}
.lightbox img.zoomed:active { cursor: grabbing; }
.lightbox-close {
  position: absolute; top: 22px; inset-inline-end: 26px;
  color: #fff; font-size: 2rem; line-height: 1;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  background: linear-gradient(160deg, var(--color-primary-dark) 0%, #062038 100%);
  color: rgba(255,255,255,0.85);
  margin-top: 40px;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute; inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-primary));
}
.site-footer::after {
  content: '';
  position: absolute; bottom: -80px; inset-inline-end: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,23,0.10), transparent 70%);
  pointer-events: none;
}

.footer-grid { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 64px 24px 44px; }

.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.footer-logo { width: 42px; height: 42px; filter: brightness(0) invert(1); }
.footer-brand-name { display: block; font-weight: 700; font-size: 1.15rem; color: #fff; }
.footer-brand-tagline { display: block; font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-top: 2px; }

.footer-col h3 {
  position: relative;
  color: #fff; font-size: 1.05rem; margin-bottom: 20px; padding-bottom: 12px;
}
.footer-col h3::after {
  content: '';
  position: absolute; bottom: 0; inset-inline-start: 0;
  width: 36px; height: 3px; border-radius: 3px;
  background: var(--color-secondary);
}
.footer-col p { font-size: 0.92rem; color: rgba(255,255,255,0.65); }
/* The About-Us blurb stays aligned to the reading direction (not justified/centered) */
#footerAboutText { text-align: start; }

.footer-col ul { display: flex; flex-direction: column; gap: 12px; font-size: 0.92rem; }
.footer-col a { transition: color 0.2s; }
.footer-col a:hover { color: var(--color-secondary); }

.footer-link-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-secondary); margin-inline-end: 10px;
  transition: transform 0.2s;
}
.footer-col a:hover .footer-link-dot { transform: scale(1.4); }

.footer-contact-list li,
.footer-contact-list a {
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.75);
}
.footer-contact-list svg { flex-shrink: 0; color: var(--color-secondary); }

.footer-bottom {
  position: relative;
  text-align: center; padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.footer-credit {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.42);
}
.footer-credit a {
  color: rgba(255,255,255,0.62);
  transition: color 0.25s var(--ease);
}
.footer-credit a:hover { color: #fff; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 70ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 140ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 210ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 280ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 350ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 420ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 490ms; }
.reveal-stagger > .reveal:nth-child(9) { transition-delay: 560ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .menu-toggle { display: flex; }

  /* Mobile search: icon button toggles an expanding bar under the header */
  .search-toggle { display: flex; }
  .search-wrap {
    display: block;
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 10px 16px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    z-index: 199;
  }
  .site-header.search-open .search-wrap {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .search-form { width: 100%; }
  .search-form input { width: 100%; flex: 1; }
  .search-dropdown { min-width: 0; }

  .nav-panel-header { display: flex; }

  .main-nav {
    position: fixed;
    top: 0; bottom: 0;
    left: 0;
    width: min(320px, 84vw);
    max-width: 320px;
    background: #ffffff;
    color: var(--color-text);
    box-shadow: var(--shadow-strong);
    transform: translateX(-100%);
    transition: transform 0.4s var(--ease);
    z-index: 260;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    visibility: visible;
    opacity: 1;
  }
  .site-header.menu-open .main-nav { transform: translateX(0); }

  /* RTL: mobile nav slides from the right (start) side */
  body.lang-fa .main-nav {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }
  body.lang-fa .site-header.menu-open .main-nav { transform: translateX(0); }

  .nav-backdrop {
    position: fixed; inset: 0;
    background: rgba(6, 20, 34, 0.5);
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
    z-index: 250;
  }
  .nav-backdrop.open { opacity: 1; visibility: visible; }

  .main-nav > ul { flex-direction: column; padding: 6px 14px 24px; gap: 2px; }
  .nav-item-row { display: flex; align-items: stretch; }
  .main-nav .nav-link { flex: 1; padding: 14px 12px; border-radius: 8px; }
  .main-nav .nav-link::after { display: none; }
  .main-nav .nav-link:hover, .main-nav .nav-link.active { background: rgba(0, 114, 206, 0.08); }

  .site-header.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .site-header.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .submenu-toggle {
    width: 46px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
  }
  .submenu-toggle:hover { background: rgba(0, 114, 206, 0.08); }
  .submenu-toggle .nav-caret { transition: transform 0.3s var(--ease); }
  .has-submenu.submenu-open > .nav-item-row > .submenu-toggle .nav-caret { transform: rotate(225deg); }

  .has-submenu .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    min-width: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    padding: 0 0 0 20px;
    transition: max-height 0.4s var(--ease);
  }
  body.lang-fa .has-submenu .submenu { padding: 0 20px 0 0; }
  .has-submenu.submenu-open .submenu { padding-block: 4px 8px; }

  .two-col, .mv-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .lines-grid { grid-template-columns: 1fr; }
  .line-card { grid-template-columns: 1fr; }
}

@media (min-width: 981px) {
  .submenu-toggle { display: none; }
  .nav-panel-header { display: none; }
  .nav-backdrop { display: none; }
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 36px; padding: 48px 24px 36px; }
}

@media (max-width: 560px) {
  .section { padding: 60px 0; }
  .section.container { padding: 60px 20px; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .header-inner { padding: 0 16px; }
  .logo-text { font-size: 1rem; }
  .hero-content { padding: 0 20px; }
}

body.no-scroll { overflow: hidden; }

/* ============================================================
   SECTION TONES & DIVIDERS — give each section a distinct feel
   ============================================================ */
.tone-a { background: #FFFFFF; }
.tone-b { background: linear-gradient(180deg, #F3F8FD, #EEF5FC); }
.tone-c { background: linear-gradient(180deg, #FFFCF5, #FBF6EA); }

.section-divider {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border) 15%, var(--color-border) 85%, transparent);
}
.section-divider::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 9px; height: 9px;
  background: var(--color-secondary);
  border: 2px solid #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ============================================================
   FLOATING ACTION BUTTONS (always bottom-left, never mirrored)
   ============================================================ */
.fab-stack {
  position: fixed;
  bottom: 26px;
  left: 26px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
/* Hidden while the mobile nav drawer is open — it opens from this same
   (start/left) side and would otherwise sit on top of the menu */
.fab-stack.fab-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-12px) scale(0.9);
  pointer-events: none;
}
.fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-strong);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.fab:hover { transform: translateY(-4px) scale(1.05); }
.fab-call {
  background: var(--color-primary);
  color: #fff;
  animation: fabPulse 2.6s ease-in-out infinite;
}
.fab-top {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s, box-shadow 0.25s var(--ease);
}
.fab-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

@keyframes fabPulse {
  0%, 100% { box-shadow: var(--shadow-strong), 0 0 0 0 rgba(0, 114, 206, 0.35); }
  50% { box-shadow: var(--shadow-strong), 0 0 0 10px rgba(0, 114, 206, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .fab-call { animation: none; }
}

@media (max-width: 560px) {
  .fab-stack { bottom: 18px; left: 18px; gap: 10px; }
  .fab { width: 46px; height: 46px; }
}

/* ============================================================
   ERROR PAGES (404 / 403)
   ============================================================ */
.error-main { display: flex; align-items: center; min-height: calc(100vh - var(--header-h)); padding: 70px 0; }
.error-page { text-align: center; }

.error-tag {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 18px;
  margin-bottom: 26px;
  background: #fff;
}

/* Big error numerals, blueprint-style: hatched fill like the page banners */
.error-code {
  font-family: var(--font-en);
  font-size: clamp(7rem, 22vw, 13rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 4px;
  color: transparent;
  background: repeating-linear-gradient(135deg, var(--color-primary) 0 3px, transparent 3px 9px);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px var(--color-primary-dark);
  margin-bottom: 18px;
  user-select: none;
}

.error-title {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 14px;
}
.error-text {
  color: var(--color-muted);
  max-width: 56ch;
  margin: 0 auto 8px;
}
.error-text-en {
  font-family: var(--font-en);
  font-size: 0.9rem;
  color: var(--color-muted);
  opacity: 0.8;
  max-width: 56ch;
  margin: 0 auto 26px;
}
.error-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.error-actions .btn { margin-top: 0; }

@media (max-width: 560px) {
  .error-main { padding: 48px 0; }
  .error-actions .btn { width: 100%; max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .error-code { letter-spacing: 0; }
}
