/* ----- Variables ----- */
:root {
  --color-bg: #0f1419;
  --color-surface: #1a2332;
  --color-footer: #0c121a;
  --color-footer-border: rgba(100, 120, 150, 0.22);
  --color-border: #2d3a4d;
  --color-text: #e6edf3;
  --color-text-muted: #8b9cb3;
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-hero-overlay: rgba(15, 20, 25, 0.75);
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-heading: 'Outfit', 'DM Sans', sans-serif;
  --font-fa: Tahoma, 'Segoe UI', 'Vazirmatn', 'IRANSansX', sans-serif;
  --header-height: 72px;
  --container: min(1120px, 92vw);
  --radius: 8px;
  --transition: 0.2s ease;
}

html[lang="fa"] body {
  font-family: var(--font-fa);
}

html[lang="fa"] .section-title,
html[lang="fa"] .page-title,
html[lang="fa"] .impressum-page-title,
html[lang="fa"] .impressum-section-title,
html[lang="fa"] .logo {
  font-family: var(--font-fa);
}

/* ----- Base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: var(--container); margin-inline: auto; padding-inline: 1rem; }
.narrow { max-width: 720px; }

/* ----- Cookie Banner ----- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem var(--container);
  margin: 0 auto;
  max-width: var(--container);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }
.btn-primary {
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--color-accent-hover); }

/* ----- Header ----- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--color-accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}
.nav-list a {
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.nav-list a:hover, .nav-list a.active { color: var(--color-text); background: var(--color-surface); text-decoration: none; }

/* Dropdown */
.has-dropdown { position: relative; }
.has-dropdown > a::after { content: ''; display: inline-block; margin-left: 4px; border: 4px solid transparent; border-top-color: currentColor; vertical-align: middle; }
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 0.5rem 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition);
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li { margin: 0; }
.dropdown-label {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  font-size: 0.9rem;
}
.dropdown a:hover { background: var(--color-bg); text-decoration: none; }

.lang-switcher { display: flex; align-items: center; gap: 0.25rem; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  border-radius: var(--radius);
}
.lang-btn:hover { color: var(--color-text); }
.lang-btn.active { color: var(--color-accent); font-weight: 600; }
.lang-flag { display: block; width: 20px; height: 14px; object-fit: cover; border-radius: 1px; flex-shrink: 0; }
.lang-sep { color: var(--color-border); user-select: none; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav { position: fixed; top: var(--header-height); left: 0; right: 0; background: var(--color-surface); flex-direction: column; align-items: stretch; padding: 1rem; border-bottom: 1px solid var(--color-border); max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease, opacity 0.2s; }
  .nav.is-open { max-height: 80vh; overflow-y: auto; opacity: 1; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .has-dropdown .dropdown { position: static; opacity: 1; visibility: visible; transform: none; margin-top: 0.25rem; margin-left: 1rem; max-height: 0; overflow: hidden; border: none; background: var(--color-bg); }
  .has-dropdown.is-open .dropdown { max-height: 400px; }
  .lang-switcher { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--color-border); }
}

/* ----- Hero Slider (full width, full viewport) ----- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: var(--color-bg);
  opacity: 0;
  transition: opacity 0.6s ease;
}
/* موبایل: عکس‌های افقی با cover بریده می‌شوند — contain تا کل تصویر دیده شود */
@media (max-width: 768px) {
  .hero {
    min-height: 72svh;
    min-height: 72dvh;
  }
  .hero-slide {
    background-size: contain;
    background-position: center center;
    background-color: var(--color-bg);
  }
}
.hero-slide.active {
  opacity: 1;
  z-index: 1;
}
.hero-media-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.2);
  pointer-events: none;
}
.hero-slider-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}
.hero-slider-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}
.hero-slider-dots .dot:hover { background: rgba(255,255,255,0.7); }
.hero-slider-dots .dot.active { background: #fff; }

/* ----- Sections ----- */
.section { padding: 4rem 0; }
.section:nth-child(even) { background: var(--color-surface); }
.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-text);
}
.section-text {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 64ch;
}

.section-about .section-text { max-width: 56ch; }
.section-services .section-text { max-width: 56ch; }

/* Product grid – glass card style */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.product-card {
  background: rgba(26, 35, 50, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.section-products .product-card { background: rgba(26, 35, 50, 0.55); }
.product-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}
.product-card p { margin: 0; font-size: 0.95rem; color: var(--color-text-muted); }
.product-link {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.product-link:hover { text-decoration: underline; }
.product-page-grid { margin-top: 1.75rem; }
.product-page-grid .product-card h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.product-detail-list li {
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 0.4rem;
}


/* ----- Page (Impressum, Downloads) ----- */
.page-main { padding: 3rem 0 4rem; }
.page-products .page-main {
  background: linear-gradient(180deg, #131c28 0%, #162333 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.page-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: var(--color-text);
}
.content-block { color: var(--color-text-muted); line-height: 1.7; }
.content-block p { margin: 0 0 1rem; }
.download-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.download-list li { margin: 0.5rem 0; }
.download-list a { display: inline-block; padding: 0.5rem 0; }

/* ----- Impressum page (editorial: TOC + watermark sections) ----- */
body.page-impressum {
  background: var(--color-bg);
}
.impressum-main { padding-top: 0; padding-bottom: 4rem; }
.impressum-hero {
  padding: 2.25rem 0 2rem;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.impressum-hero-inner { max-width: 52rem; margin-inline: auto; padding-inline: 1rem; }
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--color-accent); text-decoration: underline; }
.breadcrumb-sep { margin: 0 0.5rem; opacity: 0.45; }
.impressum-page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  margin: 0 0 0.65rem;
  letter-spacing: -0.03em;
  color: var(--color-text);
}
.impressum-lead {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 36rem;
}
.impressum-body-wrap {
  max-width: 52rem;
  margin-inline: auto;
  padding: 0 1rem 2rem;
}
.impressum-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  padding: 1.5rem 0 2.25rem;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.impressum-toc a {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.impressum-toc a:hover {
  color: var(--color-text);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
}
.impressum-article {
  position: relative;
}
.impressum-section {
  position: relative;
  padding: 2.75rem 0;
  overflow: hidden;
}
.impressum-section + .impressum-section {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.impressum-watermark {
  position: absolute;
  right: 0;
  top: 1.25rem;
  font-family: var(--font-heading);
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  user-select: none;
}
.impressum-section-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 1.15rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--color-accent);
}
.impressum-section-body {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.78;
}
.impressum-section-body p { margin: 0 0 1rem; }
.impressum-section-body p:last-child { margin-bottom: 0; }
.impressum-section-body a {
  color: var(--color-accent);
  text-decoration: none;
  word-break: break-word;
}
.impressum-section-body a:hover { text-decoration: underline; }
.impressum-section--last { padding-bottom: 0; }

html[lang="fa"] .page-impressum .impressum-watermark {
  left: 0;
  right: auto;
  direction: ltr;
  unicode-bidi: isolate;
}

html[lang="fa"] .page-impressum .impressum-section-title {
  padding-left: 0;
  border-left: 0;
  padding-right: 0.85rem;
  border-right: 3px solid var(--color-accent);
}

@media (max-width: 520px) {
  .impressum-toc { gap: 0.4rem; }
  .impressum-toc a { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
}

/* ----- Footer ----- */
.footer {
  background: var(--color-footer);
  border-top: 1px solid var(--color-footer-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  padding: 2.5rem 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
}
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col p, .footer-col ul { margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin: 0.25rem 0; }
.footer-col a { color: var(--color-text-muted); }
.footer-col a:hover { color: var(--color-accent); }
.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-footer-border);
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.social-link:hover { color: var(--color-accent); background: rgba(59, 130, 246, 0.15); text-decoration: none; }
.footer-bottom {
  padding: 1rem 0;
  border-top: 1px solid var(--color-footer-border);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}
.footer-bottom .container { display: flex; justify-content: center; }
.footer-bottom p { margin: 0; font-size: 0.85rem; color: var(--color-text-muted); }
.footer-bottom a { color: var(--color-text-muted); }
.footer-bottom a:hover { color: var(--color-accent); }

@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
}
