/* ====================================================
   1. VARIABLES & TYPOGRAPHY
   ==================================================== */
:root {
  --thd-font-main: 'Oswald', sans-serif;
  --thd-font-body: 'Open Sans', sans-serif;
  --thd-font-rtl: 'Iran Yekan', 'Tahoma', sans-serif;
  
  --thd-red: #CC0000;
  --thd-dark: #0A0E1A;
  --thd-dark2: #111827;
  --thd-white: #ffffff;
  --thd-gray: #9CA3AF;
  --thd-light-bg: #F5F5F5;
}

@font-face {
  font-family: 'Iran Yekan';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
}
@font-face {
  font-family: 'Iran Yekan';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
}

/* Base Wrapper for all Widgets */
.thd-widget-container, 
header, 
footer {
  font-family: var(--thd-font-body);
  background: var(--thd-white);
  color: var(--thd-dark);
  overflow-x: hidden;
}

/* ====================================================
   2. RTL (PERSIAN / ARABIC) OVERRIDES
   ==================================================== */
body.rtl .thd-widget-container,
body.rtl header,
body.rtl footer {
  font-family: var(--thd-font-rtl);
  direction: rtl;
  text-align: right;
}

/* Specific RTL Flips */
body.rtl .nav-links { flex-direction: row-reverse; }
body.rtl .logo-area { flex-direction: row-reverse; }
body.rtl .hero-text { text-align: right; }
body.rtl .stat-item { text-align: right; }
body.rtl .stat-item > div { text-align: right; margin-right: 16px; margin-left: 0; }
body.rtl .footer-col { text-align: right; }
body.rtl .contact-info-item { flex-direction: row; }
body.rtl .ci-text { text-align: right; margin-right: 16px; margin-left: 0; }

/* Flip Arrows for RTL */
body.rtl .btn-discover .arrow, 
body.rtl .btn-learn .arr, 
body.rtl .read-more,
body.rtl .btn-arrow,
body.rtl .btn-circle { 
  transform: scaleX(-1); 
  display: inline-block;
} 

/* Flip Borders */
body.rtl .mission-block { 
  border-left: none; 
  border-right: 3px solid var(--thd-red); 
  padding-left: 0; 
  padding-right: 24px; 
}
body.rtl .feature-item { 
  border-right: none; 
  border-left: 1px solid rgba(255,255,255,0.1); 
}
body.rtl .feature-item:last-child { 
  border-left: none; 
}

/* ====================================================
   3. HEADER WIDGET
   ==================================================== */
header { position: absolute; top: 0; left: 0; right: 0; z-index: 100; padding: 18px 40px; display: flex; align-items: center; justify-content: space-between; background: transparent; }
.logo-area { display: flex; align-items: center; gap: 14px; text-decoration: none; cursor: pointer; }
.logo-placeholder { width: 70px; height: 70px; background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--thd-white); font-size: 22px; font-weight: 700; font-family: var(--thd-font-main); }
.logo-text-block { display: flex; flex-direction: column; }
.logo-title { font-family: var(--thd-font-main); font-size: 20px; font-weight: 700; color: var(--thd-white); letter-spacing: 1px; line-height: 1.2; }
.logo-title span { color: var(--thd-red); }
.logo-sub { font-size: 10px; color: rgba(255,255,255,0.6); letter-spacing: 2px; text-transform: uppercase; }

nav { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: 0.5px; padding: 6px 10px; transition: color 0.2s; font-family: var(--thd-font-main); text-transform: uppercase; }
.nav-links a:hover, .nav-links a.active { color: var(--thd-white); }
.nav-links a.active { border-bottom: 2px solid var(--thd-red); }

.lang-selector { position: relative; margin: 0 10px; }
.lang-btn { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: var(--thd-white); padding: 6px 14px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: var(--thd-font-main); border-radius: 2px; transition: border-color 0.2s; }
.lang-btn:hover { border-color: var(--thd-white); }
.lang-dropdown { display: none; position: absolute; top: 110%; right: 0; background: var(--thd-dark2); border: 1px solid rgba(255,255,255,0.1); min-width: 130px; z-index: 200; border-radius: 4px; overflow: hidden; }
.lang-selector.open .lang-dropdown { display: block; }
.lang-dropdown button { display: block; width: 100%; padding: 10px 16px; background: none; border: none; color: rgba(255,255,255,0.8); text-align: left; font-size: 13px; cursor: pointer; font-family: var(--thd-font-rtl); transition: background 0.15s; }
.lang-dropdown button:hover { background: rgba(255,255,255,0.08); color: var(--thd-white); }

.btn-header { background: var(--thd-red); color: var(--thd-white); padding: 12px 22px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-family: var(--thd-font-main); transition: background 0.2s; text-decoration: none; }
.btn-header:hover { background: #aa0000; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; }
.hamburger span { width: 25px; height: 2px; background: var(--thd-white); display: block; transition: 0.3s; }

/* ====================================================
   4. HERO SLIDER WIDGET
   ==================================================== */
.hero-section { position: relative; width: 100%; height: 100vh; min-height: 600px; overflow: hidden; background: var(--thd-dark); }
.slide { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity 1s ease; background-size: cover; background-position: center; }
.slide.active { opacity: 1; }

.hero-content { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; padding: 120px 40px 60px; max-width: 700px; }
.hero-text h1 { font-family: var(--thd-font-main); font-size: clamp(36px, 5vw, 68px); font-weight: 700; color: var(--thd-white); line-height: 1.15; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px; }
.hero-text h1 .red { color: var(--thd-red); }
.hero-text p { color: rgba(255,255,255,0.75); font-size: clamp(14px, 1.5vw, 17px); line-height: 1.7; margin-bottom: 36px; max-width: 460px; }

.btn-discover { display: inline-flex; align-items: center; gap: 10px; background: var(--thd-red); color: var(--thd-white); padding: 15px 28px; font-family: var(--thd-font-main); font-size: 14px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; border: none; cursor: pointer; transition: background 0.2s, gap 0.2s; align-self: flex-start; text-decoration: none; }
.btn-discover:hover { background: #aa0000; gap: 16px; }
.btn-discover .arrow { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }

.slider-dots { position: absolute; bottom: 240px; left: 40px; z-index: 20; display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: background 0.3s, width 0.3s; }
.dot.active { background: var(--thd-red); width: 24px; border-radius: 4px; }

.hero-bottom { position: absolute; bottom: 0; left: 0; right: 0; z-index: 20; }
.wave-shape { position: relative; background: var(--thd-dark); }
.wave-shape::before { content: ''; position: absolute; top: -60px; left: -5%; right: -5%; height: 80px; background: var(--thd-dark); border-radius: 50% 50% 0 0 / 100% 100% 0 0; transform: scaleX(1.1); }
.feature-icons { display: flex; background: var(--thd-dark); padding: 28px 40px 24px; justify-content: space-around; border-top: 1px solid rgba(255,255,255,0.08); position: relative; z-index: 1; }
.feature-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 20px; border-right: 1px solid rgba(255,255,255,0.1); flex: 1; }
.feature-icon { width: 44px; height: 44px; color: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; }
.feature-icon svg { width: 100%; height: 100%; }
.feature-label { font-family: var(--thd-font-main); font-size: 12px; color: rgba(255,255,255,0.7); letter-spacing: 1.5px; text-transform: uppercase; text-align: center; line-height: 1.4; }

/* ====================================================
   5. STATS & MISSION WIDGET
   ==================================================== */
.stats-mission { background: var(--thd-light-bg); padding: 70px 40px; display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: start; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.stat-item { display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 56px; height: 56px; flex-shrink: 0; color: var(--thd-dark); opacity: 0.8; }
.stat-icon svg { width: 100%; height: 100%; }
.stat-num { font-family: var(--thd-font-main); font-size: 42px; font-weight: 700; color: var(--thd-dark); line-height: 1; }
.stat-text { font-size: 11px; color: var(--thd-gray); letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.4; margin-top: 4px; }

.mission-block { max-width: 320px; border-left: 3px solid var(--thd-red); padding-left: 24px; }
.mission-label { display: flex; align-items: center; gap: 10px; font-size: 11px; font-family: var(--thd-font-main); color: var(--thd-red); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
.mission-label::before { content: ''; width: 30px; height: 2px; background: var(--thd-red); }
.mission-block p { font-size: 14px; line-height: 1.8; color: #555; margin-bottom: 20px; }
.btn-learn { display: inline-flex; align-items: center; gap: 8px; color: var(--thd-dark); font-family: var(--thd-font-main); font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; border: none; background: none; cursor: pointer; transition: gap 0.2s, color 0.2s; }
.btn-learn:hover { color: var(--thd-red); gap: 14px; }
.btn-learn .arr { color: var(--thd-red); font-size: 18px; }

/* ====================================================
   6. UNIVERSAL GRIDS WIDGET 
   ==================================================== */
.services-grid-section, .projects-section, .news-section { padding: 80px 40px; }
.section-header, .projects-header, .values-header { margin-bottom: 50px; }
.section-header .tag, .projects-header .tag { font-size: 11px; color: var(--thd-red); font-family: var(--thd-font-main); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 12px; }
.section-header h2, .projects-header h2, .values-header h2 { font-family: var(--thd-font-main); font-size: clamp(26px, 3vw, 44px); font-weight: 700; text-transform: uppercase; line-height: 1.2; color: var(--thd-dark); }
.section-header h2 span, .projects-header h2 span { color: var(--thd-red); }
.values-header h2 { color: var(--thd-white); text-align: center; }

/* Services Layout */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.service-card { padding: 36px 28px; border: 1px solid #e5e5e5; transition: border-color 0.3s, box-shadow 0.3s; }
.service-card:hover { border-color: var(--thd-red); box-shadow: 0 8px 30px rgba(204,0,0,0.08); }
.service-card .s-icon { width: 48px; height: 48px; color: var(--thd-red); margin-bottom: 18px; }
.service-card .s-icon svg { width: 100%; height: 100%; }
.service-card h3 { font-family: var(--thd-font-main); font-size: 17px; text-transform: uppercase; color: var(--thd-dark); margin-bottom: 12px; letter-spacing: 0.5px; }
.service-card p { font-size: 13px; color: #666; line-height: 1.7; margin-bottom: 20px; }
.btn-arrow { color: var(--thd-red); font-size: 22px; display: inline-block; transition: transform 0.2s; cursor: pointer; text-decoration: none; }
.btn-arrow:hover { transform: translateX(6px); }
body.rtl .btn-arrow:hover { transform: scaleX(-1) translateX(6px); }

/* Projects Layout */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.project-card { position: relative; height: 280px; overflow: hidden; cursor: pointer; display: block; }
.project-card-img { width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 0.4s; }
.project-card:hover .project-card-img { transform: scale(1.05); }
.project-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.85)); padding: 30px 20px 20px; }
.project-tag { font-size: 10px; color: var(--thd-red); font-family: var(--thd-font-main); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.project-title { font-family: var(--thd-font-main); font-size: 17px; color: var(--thd-white); margin-bottom: 4px; }
.project-meta { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 12px; }
.btn-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--thd-red); color: var(--thd-white); display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; border: none; }

/* News Layout */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.news-card { border: 1px solid #e5e5e5; overflow: hidden; transition: border-color 0.3s; display: block; text-decoration: none; }
.news-card:hover { border-color: var(--thd-red); }
.news-card-img { height: 180px; background-size: cover; background-position: center; position: relative; }
.news-badge { position: absolute; top: 16px; left: 16px; background: var(--thd-red); color: var(--thd-white); font-size: 10px; font-family: var(--thd-font-main); letter-spacing: 1px; padding: 4px 10px; text-transform: uppercase; z-index: 2; }
body.rtl .news-badge { right: 16px; left: auto; }
.news-card-body { padding: 20px; }
.news-card-body h3 { font-family: var(--thd-font-main); font-size: 16px; color: var(--thd-dark); margin-bottom: 8px; line-height: 1.3; }
.news-card-body .date { font-size: 11px; color: var(--thd-gray); margin-bottom: 12px; }
.read-more { font-size: 12px; color: var(--thd-red); font-family: var(--thd-font-main); letter-spacing: 1px; text-transform: uppercase; cursor: pointer; background: none; border: none; }

/* Values Layout */
.values-section { background: var(--thd-dark); padding: 70px 40px; }
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.value-card { text-align: center; padding: 30px 20px; border: 1px solid rgba(255,255,255,0.08); transition: border-color 0.3s; }
.value-card:hover { border-color: var(--thd-red); }
.value-icon { width: 50px; height: 50px; margin: 0 auto 16px; color: rgba(255,255,255,0.7); }
.value-icon svg { width: 100%; height: 100%; }
.value-card h3 { font-family: var(--thd-font-main); font-size: 16px; color: var(--thd-white); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.value-card p { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.7; }

/* Shared Grid Buttons */
.btn-all, .btn-view-all { display: inline-block; border: 1px solid var(--thd-dark); color: var(--thd-dark); padding: 12px 24px; font-family: var(--thd-font-main); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; background: none; margin-top: 20px; transition: background 0.2s, color 0.2s; text-decoration: none; }
.btn-all:hover, .btn-view-all:hover { background: var(--thd-dark); color: var(--thd-white); }

/* ====================================================
   7. CONTACT SPLIT WIDGET
   ==================================================== */
.contact-section { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 0px); }
.contact-left { background: var(--thd-dark); padding: 140px 60px 60px; }
.contact-left h2 { font-family: var(--thd-font-main); font-size: clamp(28px, 3vw, 48px); color: var(--thd-white); text-transform: uppercase; line-height: 1.2; margin-bottom: 40px; }
.contact-left h2 span { color: var(--thd-red); }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 28px; align-items: flex-start; }
.ci-icon { width: 42px; height: 42px; background: rgba(204,0,0,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--thd-red); flex-shrink: 0; font-size: 18px; }
.ci-text h4 { font-family: var(--thd-font-main); font-size: 13px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.ci-text p { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.map-placeholder { height: 180px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; margin-top: 30px; color: rgba(255,255,255,0.3); font-size: 36px; }

.contact-right { background: var(--thd-white); padding: 140px 60px 60px; }
.contact-right h3 { font-family: var(--thd-font-main); font-size: 14px; color: var(--thd-red); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 30px; }

/* WPForms / CF7 Integration Styles */
.contact-right input,
.contact-right textarea,
.contact-right select { width: 100%; border: 1px solid #e0e0e0; border-radius: 2px; padding: 14px 16px; font-size: 14px; font-family: var(--thd-font-body); color: var(--thd-dark); outline: none; transition: border-color 0.2s; background: #fafafa; margin-bottom: 18px; }
.contact-right input:focus, .contact-right textarea:focus { border-color: var(--thd-red); background: var(--thd-white); }
.contact-right textarea { height: 130px; resize: vertical; }
.contact-right button, .contact-right input[type="submit"] { width: 100%; background: var(--thd-red); color: var(--thd-white); padding: 16px; font-family: var(--thd-font-main); font-size: 14px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; border: none; cursor: pointer; transition: background 0.2s; }
.contact-right button:hover, .contact-right input[type="submit"]:hover { background: #aa0000; }

/* ====================================================
   8. FOOTER WIDGET
   ==================================================== */
footer { background: var(--thd-dark2); padding: 60px 40px 30px; color: rgba(255,255,255,0.6); font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 50px; margin-bottom: 50px; }
.footer-col h4 { font-family: var(--thd-font-main); font-size: 14px; color: var(--thd-white); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 20px; }
.footer-col p { line-height: 1.8; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--thd-red); }
.footer-logo { font-family: var(--thd-font-main); font-size: 22px; font-weight: 700; color: var(--thd-white); margin-bottom: 14px; }
.footer-logo span { color: var(--thd-red); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; }

/* ====================================================
   9. RESPONSIVE BREAKPOINTS
   ==================================================== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid, .values-grid, .news-grid, .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  header { padding: 14px 20px; }
  nav, .btn-header { display: none; }
  .hamburger { display: flex; }

  .hero-content { padding: 100px 20px 40px; }
  .hero-text h1 { font-size: 32px; }

  .feature-icons { padding: 20px; gap: 0; flex-wrap: wrap; }
  .feature-item { padding: 12px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); width: 50%; }
  .feature-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.1); }
  body.rtl .feature-item { border-left: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  body.rtl .feature-item:nth-child(odd) { border-left: 1px solid rgba(255,255,255,0.1); }

  .stats-mission { grid-template-columns: 1fr; padding: 40px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .mission-block { max-width: 100%; border-left: none; padding-left: 0; border-top: 3px solid var(--thd-red); padding-top: 20px; }
  body.rtl .mission-block { border-right: none; }

  .services-grid, .projects-grid, .news-grid, .values-grid { grid-template-columns: 1fr; }
  .contact-section { grid-template-columns: 1fr; }
  .contact-left, .contact-right { padding: 100px 24px 40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .services-grid-section, .projects-section, .news-section, .values-section { padding: 50px 20px; }
  .slider-dots { left: 20px; bottom: 260px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 26px; }
  .feature-item { width: 100%; border-right: none !important; border-left: none !important; }
  /* ====================================================
   UI REFINEMENTS (Header, Spacing, Hero Alignment)
   ==================================================== */
/* 1. Force Header to absolute top, remove Elementor default padding */
.elementor-widget-thd_header { margin: 0 !important; padding: 0 !important; }
header { top: 0 !important; margin: 0 !important; }

/* 2. Horizontal gaps for Header Buttons */
nav { gap: 24px !important; }
.nav-links { gap: 16px !important; }
.nav-links li { margin: 0 4px; }
.lang-selector { margin: 0 16px; }

/* 3. Hero Text moved to top */
.hero-content {
    justify-content: flex-start !important;
    padding-top: 180px !important; /* Pushes text just below the header */
}

/* Ensure the About image behaves perfectly */
.about-image-box {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
}