/* ==================== Reset & Base ==================== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'IRANSans';
  src: url('../jquery/IRANSans.ttf') format('truetype');
  font-display: swap;
}

:root {
  --primary: #022e62;
  --primary-light: #0a4f9c;
  --indigo: #3f51b5;
  --indigo-hover: #2c3e9e;
  --accent: #00bcd4;
  --text: #2d3748;
  --muted: #718096;
  --bg: #f8fafc;
  --white: #fff;
  --radius: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(2, 46, 98, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
  direction: rtl;
  color: var(--text);
  background: var(--white);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== Header ==================== */
.site-header {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 1000;
  padding: 8px 0;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.site-header.scrolled {
  background-color: rgba(2, 46, 98, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  background: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: var(--transition);
}
.logo:hover { transform: scale(1.02); }
.logo img { width: 120px; height: auto; object-fit: contain; }

.main-nav { flex: 1; }
.main-nav ul {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}
.main-nav a {
  display: block;
  padding: 10px 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  position: relative;
  transition: var(--transition);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  right: 18px;
  left: 18px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle svg { width: 32px; height: 32px; fill: #fff; }

@media (max-width: 900px) {
  .nav-toggle { display: block; order: -1; }
  .logo { order: 1; }
  .main-nav {
    order: 0;
    position: fixed;
    top: 0; right: 0;
    width: 280px;
    height: 100vh;
    background: var(--primary);
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.4s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .main-nav.open { max-width: 280px; }
  .main-nav ul {
    flex-direction: column;
    padding: 20px;
    gap: 10px;
  }
  .main-nav a { padding: 14px; font-size: 16px; }
  .main-nav a::after { right: 14px; left: 14px; }
}

/* ==================== Main Layout ==================== */
main { display: block; margin: 0; padding: 0; }
.main-home { padding: 0; }
.main-inner { padding-top: 0px; }
@media (max-width: 900px) {
  .main-inner { padding-top: 30px; }
}

/* ==================== Hero ==================== */
.hero {
  position: relative;
  height: 82vh;               /* از 100vh به 82vh — حدود 18% کمتر */
  min-height: 500px;
  max-height: 660px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 66px;
  margin-top: 0;
}
@media (max-width: 768px) {
  .hero {
    height: 50vh;             /* از 65vh به 50vh — حدود 25% کمتر */
    min-height: 320px;
    max-height: 450px;
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 3s ease, transform 12s ease;
  user-select: none;
}
.hero-bg1 { opacity: 1; z-index: 1; }
.hero-bg2 { opacity: 0; z-index: 2; }
.hero-bg-p1 { opacity: 1; z-index: 4; pointer-events: none; }
.hero-bg-p2 { opacity: 0; z-index: 4; pointer-events: none; }

.hero.scrolled .hero-bg1,
.hero.scrolled .hero-bg-p1 { opacity: 0; transform: scale(1.08); }
.hero.scrolled .hero-bg2,
.hero.scrolled .hero-bg-p2 { opacity: 1; transform: scale(1.03); }

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;                 /* از 4 به 3 — حالا زیر PNGها */
  background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.7) 100%);
}

#smoke-layer, #dust {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.smoke {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.4), rgba(255,255,255,.05) 45%, transparent 70%);
  filter: blur(35px);
  animation: rise linear forwards;
}
@keyframes rise {
  0%   { transform: translate(0,0) scale(.4); opacity: 0; }
  15%  { opacity: .35; }
  100% { transform: translate(var(--x), var(--y)) scale(2.5); opacity: 0; }
}

.dust {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: .4;
  animation: float linear infinite;
}
@keyframes float {
  from { transform: translateY(100vh); }
  to   { transform: translateY(-20vh); }
}

.hero-content {
  position: absolute;         /* از relative به absolute — برای چیدمان گوشه */
  z-index: 10;
  text-align: right;          /* راست‌چین */
  color: #fff;
  padding: 0;
  max-width: 620px;
  right: 24px;                /* همان مقدار پدینگ container (۲۴px) */
  bottom: 48px;               /* فاصله از پایین */
  left: auto;
  top: auto;
  animation: fadeIn 1.5s ease-out;
}

/* هم‌راستا با منو در موبایل (اگر منو هم ۲۴px فاصله دارد، همین می‌ماند) */

.hero-content h1 {
  font-size: clamp(22px, 2.6vw, 34px);   /* از clamp(28px,4vw,50px) کوچک‌تر */
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 20px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
  letter-spacing: -0.3px;
}

.hero-content h1 span {
  font-size: .6em;
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 700;
}

/* دکمه‌ها راست‌چین شوند */
.hero-content > div {
  justify-content: flex-start !important;  /* چون text-align: right است، flex-start یعنی سمت راست */
}

@media (max-width: 768px) {
  .hero-content {
    right: 16px;
    bottom: 28px;
    max-width: 88%;
  }
  .hero-content h1 { font-size: 20px; }
  .hero-content h1 span { font-size: 14px; }
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(63, 81, 181, 0.4);
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(63, 81, 181, 0.6);
  background: linear-gradient(135deg, var(--indigo-hover) 0%, var(--primary) 100%);
}
.btn svg { width: 20px; height: 20px; fill: #fff; }

/* ==================== Sections ==================== */
.section { padding: 100px 24px; }
.section-alt { background: var(--bg); }

.section-title {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  text-align: center;
}
.section-title span {
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.section-title span::after {
  content: '';
  position: absolute;
  bottom: 2px; right: 0; left: 0;
  height: 8px;
  background: rgba(0, 188, 212, 0.2);
  z-index: -1;
  border-radius: 4px;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 60px;
  font-size: 18px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ==================== Articles Grid ==================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.article-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.04);
}
.article-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.article-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover img { transform: scale(1.05); }

.article-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.article-body p {
  color: var(--muted);
  font-size: 15px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== Features ==================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.feature-card {
  background: #fff;
  padding: 40px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--indigo), var(--accent));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}
.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: rgba(63, 81, 181, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.feature-card:hover .feature-icon {
  background: var(--indigo);
  transform: scale(1.1) rotate(5deg);
}
.feature-icon svg { width: 32px; height: 32px; fill: var(--indigo); transition: var(--transition); }
.feature-card:hover .feature-icon svg { fill: #fff; }

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}
.feature-card p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* ==================== Counters ==================== */
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #031d3f 100%);
  color: #fff;
  position: relative;
}
.counters::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.counter-value {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}
.counter-label {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  margin-top: 8px;
}

/* ==================== Contact / Form ==================== */
.contact-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  margin-top: 40px;
}
@media (max-width: 900px) {
  .contact-wrap { grid-template-columns: 1fr; gap: 32px; }
}

.contact-form {
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.04);
}
.contact-form .field { margin-bottom: 20px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--indigo);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(63, 81, 181, 0.1);
}
.contact-form textarea { min-height: 120px; }
.contact-form .btn { width: 100%; margin-top: 8px; }

.why-list { padding: 10px 0; }
.why-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}
.why-list li svg {
  width: 24px; height: 24px;
  fill: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-box {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
  margin-top: 32px;
  border: 1px solid rgba(0,0,0,0.04);
}
.info-box li {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 500;
}
.info-box li:last-child { margin-bottom: 0; }
.info-box svg { width: 20px; height: 20px; fill: var(--primary); flex-shrink: 0; }

/* ==================== Footer ==================== */
.site-footer {
  background: #021a38;
  color: #fff;
  padding: 80px 24px 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
}
.footer-col h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 40px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.footer-col ul li { margin-bottom: 14px; }
.footer-col a {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
}
.footer-col a:hover { color: #fff; padding-right: 5px; }
.footer-col p { font-size: 15px; color: rgba(255,255,255,0.7); line-height: 1.8; }
.footer-logo img {
  max-width: 180px;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.footer-contact li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.7);
}
.footer-contact svg {
  width: 20px; height: 20px;
  fill: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}

/* ==================== Article Single Page ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { color: var(--indigo); }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 992px) {
  .article-layout { grid-template-columns: 1fr; }
}

.article-main {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 40px;
  border: 1px solid rgba(0,0,0,0.04);
}
@media (max-width: 768px) {
  .article-main { padding: 24px; }
}

.article-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.meta-item svg { width: 18px; height: 18px; fill: var(--indigo); }
.meta-item a { color: var(--primary); font-weight: 600; }

.article-content {
  font-size: 16px;
  line-height: 2;
  color: var(--text);
  text-align: justify;
}
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.article-content p { margin-bottom: 16px; }
.article-content h2, .article-content h3 {
  color: var(--primary);
  margin: 32px 0 16px;
  font-weight: 700;
}
.article-content video {
  width: 100%;
  border-radius: 12px;
  margin: 24px 0;
}

.article-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  border: 1px solid rgba(0,0,0,0.04);
  position: sticky;
  top: 100px;
}
.article-sidebar h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(63, 81, 181, 0.1);
}

.sidebar-post {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.sidebar-post:hover .sidebar-post-title { color: var(--indigo); }
.sidebar-post img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-post-content { flex: 1; }
.sidebar-post-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition);
}
.sidebar-post-date { font-size: 12px; color: var(--muted); }

/* ==================== Blog List Page ==================== */
.page-header {
  background: var(--bg);
  padding: 60px 20px 40px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 40px;
}
.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}
.page-header p { color: var(--muted); font-size: 16px; }

.blog-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

/* ==================== Animation helpers ==================== */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-in-up.visible { opacity: 1; transform: translateY(0); }
.page-content { padding: 60px 24px; }

/* گرید 4 ستونی محصولات در صفحه اصلی */
.products-grid-home {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1100px) {
  .products-grid-home { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .products-grid-home { grid-template-columns: 1fr; }
}

.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.product-price {
  color: var(--indigo);
  font-weight: 800;
  font-size: 16px;
}
.product-price small { font-weight: 500; font-size: 12px; color: var(--muted); }
.product-star {
  color: #f59e0b;
  font-size: 14px;
  font-weight: 700;
}

/* ==================== Product Single ==================== */
.product-single {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .product-single { grid-template-columns: 1fr; }
}
.product-single-image {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
}
.product-single-image img {
  max-height: 340px;
  object-fit: contain;
}
.product-single-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  line-height: 1.5;
}
.product-single-price {
  font-size: 16px;
  color: var(--muted);
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-right: 4px solid var(--indigo);
}
.product-single-price b {
  color: var(--indigo);
  font-size: 22px;
  font-weight: 800;
}
.product-single-short {
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  margin-top: 16px;
}
.products-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ==================== Product Card Image (Square & Full) ==================== */
.product-card-home .product-img-square {
  width: 100%;
  aspect-ratio: 1 / 1; /* نسبت 1:1 برای مربع */
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid #f0f0f0;
}

.product-card-home .product-img-square img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* کل کادر را پر می‌کند */
  transition: transform 0.5s ease;
}

.product-card-home:hover .product-img-square img {
  transform: scale(1.08); /* افکت زوم هنگام هاور */
}

/* در صفحه لیست محصولات هم همینطور */
.product-img-square {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-img-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}