:root {
  --primary-color: #116466;
  --bg-color: #2c3531;
  --text-color: #d1e8e2;
  --card-bg: #2c3531;
  --accent-color: #d9b08c;
  --highlight-color: #ffcb9a;
  --glass-bg: rgba(44, 53, 49, 0.8);
  --glass-border: rgba(17, 100, 102, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', 'Arial', sans-serif;
  background: linear-gradient(135deg, #2c3531 0%, #1a2525 100%);
  color: var(--text-color);
  line-height: 1.6;
}

header {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  height: 70px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.25rem 0;
  position: relative;
  z-index: 101;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo span {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--highlight-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  position: relative;
  font-weight: 500;
  display: inline-block;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--highlight-color);
  background: rgba(17, 100, 102, 0.2);
  transform: translateY(-1px);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--highlight-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

nav a:hover::after {
  width: 70%;
}

nav a.active {
  color: var(--highlight-color);
  background: rgba(17, 100, 102, 0.3);
}

nav a.active::after {
  width: 70%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--highlight-color);
  margin: 5px 0;
  transition: 0.3s;
}

main {
  padding-top: 70px;
  min-height: calc(100vh - 70px);
}

#hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 2rem;
  background: radial-gradient(circle at center, rgba(17, 100, 102, 0.2) 0%, transparent 70%);
  overflow: hidden;
  margin-top: 70px;
}

.hero-content {
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--highlight-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(255, 203, 154, 0.3);
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.circuit-board {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  z-index: -1;
  background: 
    linear-gradient(90deg, var(--accent-color) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(0deg, var(--accent-color) 1px, transparent 1px) 0 0 / 20px 20px;
  animation: scrollBackground 20s linear infinite;
}

@keyframes scrollBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 20px 20px;
  }
}

.hero-text-farsi {
  direction: rtl;
  text-align: center;
  margin-top: 2rem;
  font-family: 'Vazirmatn', Arial, sans-serif;
  max-width: 800px;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-text-farsi h2 {
  color: var(--primary-color);
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
}

.hero-text-farsi p {
  margin-bottom: 1rem;
  line-height: 1.8;
  font-size: 1.1rem;
}

#products {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary-color);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.product-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--highlight-color);
  box-shadow: 0 12px 40px rgba(255, 203, 154, 0.2);
}

.circuit-animation {
  width: 100%;
  height: 150px;
  margin-bottom: 1rem;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 19px,
    var(--accent-color) 20px
  );
  animation: circuit 3s linear infinite;
  opacity: 0.5;
}

@keyframes circuit {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 20px;
  }
}

.expertise-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.expertise-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  > * { flex: 1 1 50%; min-width: 280px; }
}

.expertise-content h3 {
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 700;
}

.expertise-text {
  flex: 1;
}

.expertise-list {
  list-style: none;
  margin-top: 1rem;
}

.expertise-list li {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.expertise-list li::before {
  content: "▹";
  color: var(--highlight-color);
  position: absolute;
  left: 0;
}

.assembly-animation {
  flex: 1;
  max-width: 400px;
}

.pcb-svg {
  width: 100%;
  height: auto;
}

.pcb-svg .board {
  fill: var(--bg-color);
  stroke: var(--primary-color);
  stroke-width: 2;
}

.pcb-svg .component {
  fill: var(--accent-color);
  animation: pulse 2s infinite;
}

.pcb-svg .trace {
  fill: none;
  stroke: var(--accent-color);
  stroke-width: 1;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawTrace 4s linear infinite;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

@keyframes drawTrace {
  0% { stroke-dashoffset: 400; }
  100% { stroke-dashoffset: 0; }
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.service-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--highlight-color);
  box-shadow: 0 12px 40px rgba(255, 203, 154, 0.2);
}

.farsi-capabilities {
  direction: rtl;
  text-align: right;
  margin-top: 2rem;
  padding: 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  font-family: 'Vazirmatn', Arial, sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
}

.farsi-capabilities h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 700;
}

.farsi-capabilities h4 {
  color: var(--highlight-color);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.farsi-list {
  list-style: none;
  padding: 0;
}

.farsi-list li {
  margin: 0.75rem 0;
  padding-right: 1.5rem;
  position: relative;
}

.farsi-list li::before {
  content: "✔";
  color: var(--highlight-color);
  position: absolute;
  right: 0;
}

.contact-section,
.about-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-container,
.about-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.contact-details {
  margin: 2rem 0;
}

.about-image {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.about-facility-image {
  width: 100%;
  height: auto;
  display: block;
}

footer {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-info p {
  margin: 0.5rem 0;
  color: var(--text-color);
}

.contact-info .address-farsi {
  direction: rtl;
  text-align: right;
  font-family: 'Vazirmatn', Arial, sans-serif;
  margin-top: 0.5rem;
  line-height: 1.8;
  font-size: 1rem;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.product-showcase {
  margin: 3rem auto 5rem;
  max-width: 1200px;
  padding: 0 1rem;
}

.product-image {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.showcase-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.product-image:hover .showcase-image {
  transform: scale(1.02);
}

.product-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(44, 53, 49, 0.9), transparent);
  padding: 2.5rem;
  color: var(--text-color);
}

.product-overlay h3 {
  color: var(--highlight-color);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.product-overlay p {
  font-size: 1rem;
  opacity: 0.9;
}

.assembly-showcase {
  margin: 3rem auto 5rem;
  max-width: 1200px;
  padding: 0 1rem;
}

.assembly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.assembly-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.assembly-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.assembly-item:hover .assembly-image {
  transform: scale(1.05);
}

.assembly-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(44, 53, 49, 0.95) 0%, rgba(44, 53, 49, 0.7) 70%, transparent 100%);
  padding: 2rem;
  color: var(--text-color);
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.4s ease;
}

.assembly-item:hover .assembly-overlay {
  transform: translateY(0);
  opacity: 1;
}

.assembly-overlay h3 {
  color: var(--highlight-color);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.assembly-overlay p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.assembly-process {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-family: 'Vazirmatn', Arial, sans-serif;
  color: var(--text-color);
}

.assembly-title {
  text-align: center;
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  opacity: 0;
  transform: translateY(6px);
  animation: fadeInUp 0.5s ease forwards 0.1s;
}

.assembly-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.assembly-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.9rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  border: 1px solid rgba(255,255,255,0.03);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  opacity: 0;
  transform: translateX(18px);
  will-change: transform, opacity;
  cursor: default;
}

.assembly-step:hover {
  transform: translateX(0) scale(1.01);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.assembly-step .step-icon {
  min-width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(17,100,102,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--highlight-color);
  flex-shrink: 0;
  margin-left: 0.25rem;
  transform: translateY(0);
}

.assembly-step .step-content {
  text-align: right;
  direction: rtl;
}

.assembly-step h4 {
  margin-bottom: 0.25rem;
  color: var(--highlight-color);
  font-size: 1rem;
}

.assembly-step p {
  margin: 0;
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* staggered reveal when visible */
.assembly-step.visible {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0s;
}

/* subtle floating accent animation for icons */
@keyframes floatIcon {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.assembly-step .step-icon { animation: floatIcon 4s ease-in-out infinite; }

@media (min-width: 768px) {
  .contact-container,
  .about-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  main {
    padding-top: 90px;
  }
  
  #hero {
    min-height: calc(100vh - 90px);
    padding: 1rem;
  }
  
  .hero-content {
    padding: 1rem;
  }
  
  .services-section {
    padding: 5rem 1rem 3rem;
  }
  
  .services-header {
    text-align: center;
    margin-bottom: 3rem;
  }
  
  .section-subtitle {
    text-align: center;
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-top: 1rem;
    direction: rtl;
    font-family: 'Vazirmatn', Arial, sans-serif;
  }
  
  .logo span {
    font-size: 1.3rem;
  }
  
  nav ul {
    padding: 1.5rem;
  }
  
  nav ul.active {
    gap: 1rem;
  }
  
  .farsi-capabilities {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .menu-toggle { display: block; }
  header { height: auto; }
  nav ul { display: none; position: absolute; top: 70px; right: 0; left: 0; width: 100%; flex-direction: column; gap: 0; padding: 0.5rem 1rem; background: var(--glass-bg); border-top: 1px solid var(--glass-border); box-shadow: 0 8px 30px rgba(0,0,0,0.4); z-index: 120; }
  nav ul.active { display: flex; }
  nav a { display: block; width: 100%; padding: 0.9rem 1rem; border-radius: 8px; font-size: 1rem; }
  nav ul li { width: 100%; }
  /* ensure header content stacks nicely */
  nav { align-items: center; padding: 0.5rem 0; }
  .logo { flex: 0 0 auto; }
}

@media (max-width: 768px) {
  .assembly-grid {
    grid-template-columns: 1fr;
  }
  
  .assembly-overlay {
    transform: translateY(0);
    padding: 1rem;
  }
  
  .assembly-overlay h3 {
    font-size: 1rem;
  }
  
  .assembly-overlay p {
    font-size: 0.8rem;
  }
}

/* Professional animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.hero-content {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.circuit-board {
  animation: float 6s ease-in-out infinite;
}

.price-table-wrapper {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1rem;
  direction: rtl;
}

.price-table-title {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.price-table-container {
  overflow-x: auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: 12px;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-family: 'Vazirmatn', Arial, sans-serif;
  color: var(--text-color);
}

.price-table th,
.price-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: right;
  font-size: 0.95rem;
}

/* adjust column right-border for three main columns */
.price-table th:nth-child(1),
.price-table td:nth-child(1),
.price-table th:nth-child(2),
.price-table td:nth-child(2),
.price-table th:nth-child(3),
.price-table td:nth-child(3) {
  border-right: 1px solid rgba(255,255,255,0.08);
}

.price-table thead th {
  background: rgba(17,100,102,0.08);
  color: var(--highlight-color);
  position: sticky;
  top: 0;
}

.price-table tbody tr:hover {
  background: rgba(255,203,154,0.03);
}