/* ============================================================
   ماشین‌سازی عدالت — استایل سراسری
   ============================================================ */
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5b6470;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --dark: #0f172a;
  --border: #e5e9f0;
  --ring: 0 0 0 3px rgba(29, 78, 216, .25);
  --shadow: 0 6px 18px rgba(15, 23, 42, .08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
}

img { max-width: 100%; }

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
  padding-right: 15px;
  padding-left: 15px;
}

/* ---------- انیمیشن‌ها ---------- */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- هدر ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
  position: sticky;
  top: 0;
  z-index: 50;
  animation: fadeDown .6s ease;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1), opacity .35s ease, box-shadow .3s ease;
  will-change: transform, opacity;
}

.site-header.header-hidden {
  animation: none;
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 8px 15px;
}

.logo-container img {
  height: 70px;
  display: block;
  object-fit: contain;
}

.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 35px;
}

.main-nav a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 6px 0;
  transition: color .25s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width .3s ease;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a:hover::after { width: 100%; }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  color: #ffffff;
  background: var(--primary);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .25s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn:focus { outline: none; box-shadow: var(--ring); }

/* ---------- هدر موبایل ---------- */
.mobile-header-content {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 15px;
  background: #ffffff;
  height: 70px;
}
.mobile-logo-container img { height: 55px; display: block; }
.menu-toggle-checkbox { display: none; }
.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 22px;
  cursor: pointer;
}
.menu-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text);
  border-radius: 3px;
  transition: all .3s ease-in-out;
}
.mobile-nav {
  position: absolute;
  top: 70px;
  right: 0;
  left: 0;
  background: #ffffff;
  width: 100%;
  padding: 20px;
  transform: translateX(100%);
  transition: transform .3s ease-in-out;
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
  z-index: 60;
}
.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}
.mobile-nav a { color: var(--text); font-size: 1.1rem; text-decoration: none; display: block; }
.menu-toggle-checkbox:checked ~ .mobile-nav { transform: translateX(0); }
.menu-toggle-checkbox:checked ~ .menu-icon span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle-checkbox:checked ~ .menu-icon span:nth-child(2) { opacity: 0; }
.menu-toggle-checkbox:checked ~ .menu-icon span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- هیرو اصلی با اسلایدر ---------- */
.hero {
  position: relative;
  height: 88vh;
  min-height: 480px;
  overflow: hidden;
  color: #ffffff;
  text-align: right;
}
.hero-slider-container { position: relative; width: 100%; height: 100%; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 1.2s ease-in-out;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(15, 23, 42, .85) 0%, rgba(15, 23, 42, .35) 60%, rgba(15,23,42,.15) 100%);
}
.hero-slide.active { opacity: 1; z-index: 1; }

.slide-bg-1 { background-image: url('images/slide1.png'); }
.slide-bg-2 { background-image: url('images/slide2.png'); }
.slide-bg-3 { background-image: url('images/slide3.png'); }

.slide-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px;
}
.slide-text { max-width: 560px; }
.slide-text h1 {
  font-size: 3rem;
  line-height: 1.3;
  margin: 0 0 16px;
  animation: fadeUp .8s ease both;
}
.slide-text p {
  font-size: 1.2rem;
  opacity: .92;
  margin-bottom: 28px;
  animation: fadeUp .8s ease .15s both;
}
.slide-text .btn { animation: fadeUp .8s ease .3s both; font-size: 1.05rem; }

/* ناوبری اسلایدر */
.slider-navigation {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 3;
}
.prev-slide, .next-slide {
  background: rgba(255,255,255,.75);
  color: var(--dark);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s ease, transform .2s ease;
}
.prev-slide:hover, .next-slide:hover { background: #ffffff; transform: scale(1.08); }
.slide-indicators { display: flex; gap: 8px; }
.indicator {
  width: 12px; height: 12px;
  background: rgba(255,255,255,.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .3s ease, transform .3s ease;
}
.indicator.active { background: #ffffff; transform: scale(1.25); }

/* ---------- هیروی صفحات داخلی (استاتیک) ---------- */
.page-hero {
  position: relative;
  height: 42vh;
  min-height: 300px;
  display: flex;
  align-items: center;
  color: #fff;
  text-align: right;
  background-size: cover;
  background-position: center;
  animation: fadeIn .8s ease both;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(15,23,42,.85), rgba(15,23,42,.35));
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { font-size: 2.6rem; margin: 0 0 10px; animation: fadeUp .7s ease both; }
.page-hero p  { font-size: 1.15rem; opacity: .9; margin: 0; animation: fadeUp .7s ease .15s both; }

/* ---------- بخش سابقه (۳۰ سال) ---------- */
.hist {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #fff;
  padding: 70px 0;
  text-align: center;
  animation: fadeIn .8s ease both;
}
.hist h1 { font-size: 2.2rem; margin-top: 0; }
.hist p  { max-width: 760px; margin: 0 auto; font-size: 1.1rem; opacity: .95; }

/* ---------- بخش معرفی خدمات ---------- */
.offer {
  padding: 70px 0;
  text-align: center;
}
.offer h1 { font-size: 2.2rem; margin-top: 0; }
.offer p { max-width: 720px; margin: 0 auto 24px; color: var(--muted); font-size: 1.1rem; }

/* ---------- محصولات ---------- */
.section-title {
  font-size: 1.9rem;
  margin: 50px 0 28px;
  text-align: right;
  position: relative;
  padding-bottom: 12px;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 60px; height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* دو ستون * هشت ردیف */
  gap: 26px;
  padding-bottom: 70px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  aspect-ratio: 1 / 1;
  animation: fadeUp .5s ease both;
  animation-delay: calc(var(--i, 0) * .05s);
  transition: transform .25s ease, box-shadow .25s ease;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(15,23,42,.12); }

.product-photo {
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  background: #eef2f7;
  border: 1px dashed #c3cede;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: .95rem;
  overflow: hidden;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }

.product-name { font-size: 1.15rem; font-weight: 700; margin: 0; text-align: right; }
.product-card .btn { align-self: flex-start; padding: 8px 18px; font-size: .95rem; }

/* ---------- صفحه درباره ما ---------- */
.about-section { padding: 70px 0; }
.about-grid {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
}
.about-logo {
  flex: 1 1 45%;
  min-width: 280px;
  display: flex;
  justify-content: center;
  animation: fadeIn .8s ease both;
}
.about-logo img {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--dark);
  padding: 30px;
}
.about-text { flex: 1 1 45%; min-width: 280px; animation: fadeUp .8s ease both; }
.about-text h2 { font-size: 2rem; margin-top: 0; }
.about-text p { color: var(--muted); font-size: 1.08rem; }

/* ---------- خدمات ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 60px 0 80px;
}
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: right;
  animation: fadeUp .5s ease both;
  transition: transform .25s ease, box-shadow .25s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.service-card h3 { margin-top: 0; font-size: 1.3rem; }
.service-card p { color: var(--muted); margin-bottom: 0; }

/* ---------- تماس با ما ---------- */
.contact-wrap { padding: 70px 0 90px; }
.contact-grid { display: flex; gap: 30px; flex-wrap: wrap; }
.contact-info { flex: 1 1 320px; }
.contact-info .contact-item { margin-bottom: 18px; }
.contact-form {
  flex: 1 1 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  animation: fadeUp .7s ease both;
}
.contact-form label { display: block; margin-bottom: 6px; font-weight: 600; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* ---------- فوتر ---------- */
.site-footer {
  background: var(--dark);
  color: #cbd5e1;
  padding-top: 45px;
  animation: fadeIn .8s ease both;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  padding-bottom: 25px;
}
.footer-section { flex: 1; min-width: 250px; padding: 0 15px; }
.footer-right { display: flex; flex-direction: column; align-items: flex-start; }
.footer-logo img { height: 80px; margin-bottom: 8px; }
.company-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 10px; color: #fff; }
.about-company { font-size: .95rem; line-height: 1.8; color: #94a3b8; max-width: 420px; }
.footer-separator { width: 1px; background: rgba(255,255,255,.15); height: 150px; margin: 0 20px; }
.footer-left { display: flex; flex-direction: column; align-items: flex-start; }
.footer-left .section-title { font-size: 1.3rem; color: #fff; margin: 0 0 20px; padding-bottom: 10px; }
.footer-left .section-title::after { background: var(--primary); }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-item { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: .95rem; }
.contact-item i { font-size: 1.2rem; color: var(--primary); width: 25px; text-align: center; }
.social-icons { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 18px; }
.social-icons a { color: #cbd5e1; font-size: 1.5rem; text-decoration: none; transition: color .3s ease, transform .2s ease; }
.social-icons a:hover { color: #ffffff; transform: translateY(-3px); }
.copyright {
  background: #020617;
  text-align: center;
  padding: 15px 0;
  font-size: .85rem;
  color: #64748b;
  margin-top: 30px;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1000px) {
  .main-nav ul { gap: 22px; }
  .slide-text h1 { font-size: 2.4rem; }
}

@media (max-width: 700px) {
  .header-inner { display: none; }
  .mobile-header-content { display: flex; }

  .hero { height: 70vh; min-height: 480px; }
  .hero-slide { align-items: flex-end; padding-bottom: 70px; }
  .slide-content { padding: 20px; }
  .slide-text h1 { font-size: 2rem; }
  .slide-text p { font-size: 1rem; }

  /* مخفی کردن دکمه‌های اسلایدر در موبایل — اسلاید با کشیدن انگشت جابجا می‌شود */
  .prev-slide, .next-slide { display: none; }

  .page-hero h1 { font-size: 2rem; }
  .page-hero p { font-size: 1rem; }

  .products-grid { grid-template-columns: 1fr; } /* موبایل: یک ستون */
  .about-grid { flex-direction: column; text-align: center; }
  .hist { padding: 50px 20px; }
  .hist h1 { font-size: 1.7rem; }

  .site-footer .container { flex-direction: column; align-items: center; text-align: center; }
  .footer-section { width: 100%; text-align: center; }
  .footer-right, .footer-left { align-items: center; }
  .footer-separator { display: none; }
  .footer-left .section-title::after { right: 50%; transform: translateX(50%); }
  .contact-item { justify-content: center; flex-direction: row; }
  .social-icons { justify-content: center; }
  .about-company { max-width: none; }
}

@media (min-width: 701px) {
  .mobile-header-content { display: none; }
  .header-inner { display: flex; }
}
