/* ============================================================
   صنایع شیرآلات شیرود — استایل اصلی
   Shiroud Industrial Valves — Main Stylesheet
   نسخه: ۳.۰ (دوزبانه + موبایل بهینه + سئو)
   ============================================================ */

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

:root {
  --primary: #0B3C5D;
  --primary-dark: #062A42;
  --primary-light: #1D5B82;
  --gray: #4A4A4A;
  --gray-light: #E8EAED;
  --bg: #F5F6F8;
  --silver: #B0B7C3;
  --accent: #E67E22;
  --accent-dark: #CF6D14;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --white: #ffffff;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.ltr {
  direction: ltr;
  font-family: 'Inter', Tahoma, sans-serif;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   🔷 هدر (Header)
   ============================================================ */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-bottom: 4px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 900;
  font-size: 22px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.logo-text small {
  display: block;
  font-size: 11px;
  color: var(--silver);
  font-weight: 500;
}

.main-nav ul {
  display: flex;
  gap: 6px;
  align-items: center;
}

.main-nav a {
  color: var(--white);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(230, 126, 34, 0.2);
  color: var(--accent);
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  padding: 4px;
  border-radius: 6px;
}

.lang-switch a {
  padding: 6px 14px;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.lang-switch a.active {
  background: var(--accent);
  color: var(--white);
}

.lang-switch a:hover:not(.active) {
  background: rgba(255,255,255,0.15);
}

.mobile-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.3);
  color: var(--white);
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* ============================================================
   🔷 هیرو (Hero) — با عکس پس‌زمینه
   ============================================================ */
.hero {
  background-image: url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--white);
  padding: 120px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(6, 42, 66, 0.88) 0%,
    rgba(11, 60, 93, 0.78) 50%,
    rgba(29, 91, 130, 0.72) 100%
  );
  z-index: 1;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 5px;
  background: var(--accent);
  z-index: 3;
}

.hero > * {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(230, 126, 34, 0.15);
  color: var(--accent);
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 24px;
  border: 1px solid rgba(230, 126, 34, 0.4);
  backdrop-filter: blur(6px);
}

.hero h1 {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 22px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero h1 .highlight {
  color: var(--accent);
  text-shadow: 0 2px 24px rgba(230, 126, 34, 0.4);
}

.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.92);
  max-width: 720px;
  margin: 0 auto 40px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.3);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== دکمه‌ها ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 38px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(230, 126, 34, 0.35);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-3px);
  color: var(--white);
}

.btn-outline {
  background: rgba(255,255,255,0.05);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(6px);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}

.btn-dark {
  background: var(--primary);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-3px);
}

/* ============================================================
   🔷 نوار اعتماد (Trust Bar)
   ============================================================ */
.trust-bar {
  background: var(--white);
  padding: 32px 0;
  box-shadow: 0 4px 20px rgba(11, 60, 93, 0.08);
  position: relative;
  z-index: 5;
  margin-top: -40px;
  border-radius: 12px;
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 60px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  border-right: 3px solid var(--gray-light);
  transition: all 0.3s ease;
}

.trust-item:first-child { border-right: none; }
.trust-item:hover { border-right-color: var(--accent); }

.trust-icon { font-size: 32px; flex-shrink: 0; }

.trust-item h4 {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 3px;
  font-weight: 800;
}

.trust-item p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ============================================================
   🔷 بخش‌ها (Sections)
   ============================================================ */
.section { padding: 80px 0; }
.section.alt { background: var(--white); }
.section.dark {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-label {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.section-title {
  font-size: 34px;
  font-weight: 900;
  color: var(--primary-dark);
  margin-bottom: 14px;
  line-height: 1.4;
}

.section.dark .section-title { color: var(--white); }

.section-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

.section.dark .section-desc { color: var(--silver); }

/* ============================================================
   🔷 گرید محصولات
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 5px; height: 100%;
  background: var(--primary);
  transition: background 0.3s;
  z-index: 2;
}

.product-card:hover::before { background: var(--accent); }

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(11, 60, 93, 0.15);
  border-color: transparent;
}

.product-image {
  background: var(--bg);
  padding: 20px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image img {
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image img { transform: scale(1.08); }

.badge {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 2;
}

body.ltr .badge {
  left: auto;
  right: 14px;
}

.product-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-cat {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.product-content h3 {
  font-size: 17px;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.5;
  min-height: 50px;
}

.product-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.product-link {
  margin-top: auto;
  font-size: 13.5px;
  color: var(--primary);
  font-weight: 700;
}

.product-card:hover .product-link { color: var(--accent); }

/* ============================================================
   🔷 فرم‌ها (Forms)
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gray-light);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: var(--white);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11, 60, 93, 0.1);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ============================================================
   🔷 جداول مشخصات فنی (Specs Tables)
   ============================================================ */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(11, 60, 93, 0.08);
  font-size: 14.5px;
  margin-bottom: 40px;
}

.specs-table th,
.specs-table td {
  padding: 14px 18px;
  text-align: right;
  border-bottom: 1px solid var(--gray-light);
  vertical-align: middle;
}

body.ltr .specs-table th,
body.ltr .specs-table td {
  text-align: left;
}

.specs-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  width: 35%;
}

.specs-table td {
  color: var(--text);
  font-weight: 500;
}

.specs-table tbody tr:nth-child(even) td { background: var(--bg); }
.specs-table tbody tr:hover td { background: var(--gray-light); }

.specs-table tbody tr:last-child th,
.specs-table tbody tr:last-child td {
  border-bottom: none;
}

.material-table thead th {
  background: var(--primary-dark);
  text-align: center;
  width: auto;
}

.material-table thead th:first-child {
  width: 50px;
  text-align: center;
}

.material-table tbody td {
  text-align: center;
  font-size: 13.5px;
}

.material-table tbody td:nth-child(2),
.material-table tbody td:nth-child(3) {
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}

body.ltr .material-table tbody td:nth-child(2),
body.ltr .material-table tbody td:nth-child(3) {
  text-align: left;
}

.material-table tbody td:nth-child(4) {
  font-family: 'Inter', sans-serif;
  direction: ltr;
  text-align: left;
  font-size: 13px;
  color: var(--gray);
}

/* ============================================================
   🔷 CTA (Call to Action)
   ============================================================ */
.cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 70px 20px;
  text-align: center;
  border-radius: 12px;
  margin: 60px auto;
  max-width: 1160px;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 4px;
  background: var(--accent);
}

.cta h2 {
  font-size: 32px;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 14px;
}

.cta p {
  color: var(--silver);
  font-size: 16px;
  margin-bottom: 30px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   🔷 فوتر (Footer)
   ============================================================ */
.site-footer {
  background: var(--primary-dark);
  color: var(--silver);
  padding: 60px 0 24px;
  border-top: 4px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 20px;
  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;
}

body.ltr .footer-col h4::after {
  right: auto;
  left: 0;
}

.footer-col p,
.footer-col li {
  font-size: 14px;
  line-height: 2;
  color: var(--silver);
}

.footer-col a {
  color: var(--silver);
  transition: color 0.3s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  color: var(--silver);
}

/* ============================================================
   📱 ریسپانسیو (Responsive) — بهینه‌شده
   ============================================================ */

/* تبلت بزرگ */
@media (max-width: 992px) {
  .hero h1 { font-size: 38px; }
  .section-title { font-size: 26px; }

  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-item { border-right: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

/* تبلت و موبایل بزرگ */
@media (max-width: 768px) {
  /* منو موبایل */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--primary-dark);
    padding: 20px;
    border-top: 2px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  .main-nav.open { display: block; }

  .main-nav ul {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }

  .main-nav a {
    display: block;
    padding: 14px 16px;
    text-align: right;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  body.ltr .main-nav a {
    text-align: left;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
  }

  /* هیرو — بهینه‌سازی موبایل */
  .hero {
    background-attachment: scroll;
    background-position: center center;
    padding: 60px 16px;
    min-height: 400px;
  }

  .hero h1 { font-size: 28px; line-height: 1.35; }
  .hero p { font-size: 14.5px; line-height: 1.8; }
  .hero-badge { font-size: 12px; padding: 6px 16px; margin-bottom: 18px; }
  .hero-buttons { flex-direction: column; width: 100%; }
  .btn { width: 100%; min-height: 48px; padding: 14px 24px; }

  /* نوار اعتماد */
  .trust-bar {
    margin-top: 0 !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    padding: 20px 0;
  }

  .trust-grid { grid-template-columns: 1fr; gap: 4px; }
  .trust-item { padding: 10px 12px; }

  /* بخش‌ها */
  .section { padding: 60px 0; }
  .section-title { font-size: 22px; }
  .section-desc { font-size: 14px; }

  /* محصولات */
  .products-grid { grid-template-columns: 1fr; }
  .product-image { height: 200px; }

  /* CTA */
  .cta {
    padding: 50px 20px;
    margin: 40px 12px;
    border-radius: 10px;
  }
  .cta h2 { font-size: 22px; }
  .cta p { font-size: 14.5px; }

  /* فوتر */
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }

  /* جداول — حالت کارتی */
  .specs-table,
  .specs-table thead,
  .specs-table tbody,
  .specs-table th,
  .specs-table td,
  .specs-table tr {
    display: block;
  }

  .specs-table thead { display: none; }

  .specs-table th {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border-radius: 6px 6px 0 0;
    margin-top: 12px;
    font-size: 14px;
  }

  .specs-table td {
    width: 100%;
    background: var(--white) !important;
    border-radius: 0 0 6px 6px;
    margin-bottom: 8px;
    font-size: 13.5px;
    line-height: 1.7;
  }

  /* جدول لیست قطعات در موبایل */
  .material-table tbody td {
    text-align: right !important;
  }

  .material-table tbody td:nth-child(1) {
    background: var(--primary) !important;
    color: #fff;
    font-weight: 800;
    border-radius: 6px 6px 0 0;
    margin-top: 12px;
    padding: 4px 14px;
    font-size: 12px;
    display: inline-block;
    width: auto;
  }

  .material-table tbody td:nth-child(2) {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-dark);
  }

  .material-table tbody td:nth-child(3) {
    font-size: 12.5px;
    color: var(--text-muted);
    font-style: italic;
  }

  .material-table tbody td:nth-child(4) {
    text-align: right !important;
    font-size: 12px;
    direction: ltr;
  }

  /* فرم تماس */
  .contact-form > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* گریدهای دو ستونی */
  .section > .container > div[style*="grid-template-columns:1.2fr 1fr"],
  .section > .container > div[style*="grid-template-columns:1.5fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }

  /* سوییچر زبان در موبایل */
  .lang-switch a {
    min-height: 36px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* موبایل کوچک */
@media (max-width: 480px) {
  .hero {
    padding: 50px 14px;
    min-height: 340px;
  }
  .hero h1 { font-size: 22px; line-height: 1.4; }
  .hero p { font-size: 13.5px; }
  .hero-badge { font-size: 11px; padding: 5px 14px; }

  .header-inner { padding: 12px 16px; }
  .logo { font-size: 18px; }
  .logo-icon { width: 38px; height: 38px; font-size: 18px; }
  .logo-text small { font-size: 10px; }

  .trust-icon { font-size: 26px; }
  .trust-item h4 { font-size: 13px; }
  .trust-item p { font-size: 11px; }

  .section-title { font-size: 19px; }
  .section-desc { font-size: 13px; }
  .cta { padding: 40px 16px; margin: 30px 8px; }
  .cta h2 { font-size: 19px; }
  .cta p { font-size: 13.5px; }

  .product-content h3 { font-size: 15px; min-height: auto; }
  .product-content p { font-size: 12.5px; }
}

/* ============================================================
   🌐 English (LTR) Overrides
   ============================================================ */
body.ltr {
  direction: ltr;
  font-family: 'Inter', Tahoma, sans-serif;
}

body.ltr .hero h1,
body.ltr .hero p,
body.ltr .hero .hero-badge { text-align: center; }

body.ltr .trust-item {
  border-right: none;
  border-left: 3px solid var(--gray-light);
}

body.ltr .trust-item:first-child { border-left: none; }
body.ltr .trust-item:hover { border-left-color: var(--accent); }

body.ltr .section-title,
body.ltr .section-desc { text-align: left; }

body.ltr .product-content h3,
body.ltr .product-content p,
body.ltr .product-cat { text-align: left; }

body.ltr .footer-col h4,
body.ltr .footer-col p,
body.ltr .footer-col li { text-align: left; }

body.ltr .footer-bottom { text-align: center; }

body.ltr .specs-table th,
body.ltr .specs-table td { text-align: left; }

body.ltr .material-table thead th,
body.ltr .material-table thead th:first-child { text-align: center; }

body.ltr .material-table tbody td { text-align: center; }

body.ltr .material-table tbody td:nth-child(2),
body.ltr .material-table tbody td:nth-child(3) { text-align: left; }

body.ltr .material-table tbody td:nth-child(4) { text-align: left; }

@media (max-width: 768px) {
  body.ltr .specs-table th,
  body.ltr .specs-table td { text-align: left; }

  body.ltr .main-nav a { text-align: left; }
}

/* ============================================================
   🎯 دسترس‌پذیری (Accessibility)
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   📌 کلاس‌های کمکی
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}