﻿/* ============================================================
   WanZhan Textiles - Main Stylesheet
   RTL Support | Responsive | Modern Design
   ============================================================ */

/* ==================== CSS Variables ==================== */
:root {
  --primary: #1a3c5e;
  --primary-light: #2a5a8a;
  --primary-dark: #0f2a45;
  --accent: #c8944a;
  --accent-light: #d4a85c;
  --accent-dark: #a67a3a;
  --text: #2d3436;
  --text-light: #636e72;
  --text-white: #f5f6fa;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --bg-dark: #1a1a2e;
  --border: #e0e0e0;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
  --header-height: 72px;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

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

.section-header h2 {
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 700;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ==================== Header / Navigation ==================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.logo span { color: var(--accent); }

/* Logo image */
.logo img {
  height: 42px;
  width: auto;
  display: block;
}

.nav { display: flex; align-items: center; gap: 8px; }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(26,60,94,0.06);
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  margin-left: 12px;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.lang-current:hover { border-color: var(--accent); }
.lang-current i { font-size: 0.7rem; transition: var(--transition); }

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 100;
}

.lang-switcher:hover .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: var(--transition);
}

.lang-dropdown button:hover { background: var(--bg-light); color: var(--primary); }
.lang-dropdown button.active { color: var(--accent); font-weight: 600; background: rgba(200,148,74,0.08); }

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

/* ==================== Hero Section ==================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: var(--text-white);
  position: relative;
  overflow: hidden;
  padding-top: var(--header-height);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(200,148,74,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-content h1 span { color: var(--accent); }

.hero-content p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 32px;
  line-height: 1.8;
  max-width: 500px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(200,148,74,0.4);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(200,148,74,0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text-white);
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-placeholder {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 4/3;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  backdrop-filter: blur(5px);
}

/* ==================== About Section ==================== */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 1.02rem;
}

.about-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-placeholder {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--primary-light);
  border: 2px dashed var(--border);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ==================== Services Section ==================== */
.services {
  background: var(--bg-light);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid transparent;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}
.service-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-card h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.service-card p {
  font-size: 0.93rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ==================== Products Section ==================== */
.products {
  background: var(--bg);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-info {
  padding: 20px;
}

.product-info h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.product-info p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ==================== Contact Section ==================== */
.contact {
  background: var(--bg-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
}

.contact-info h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 24px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  background: rgba(200,148,74,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-item-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.contact-item-text span {
  font-size: 0.93rem;
  color: var(--text-light);
}

/* Form */
.contact-form {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.contact-form h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-light);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,148,74,0.1);
  background: var(--bg);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.form-submit:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(26,60,94,0.3);
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  text-align: center;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
}

.form-status.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-status.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ==================== Footer ==================== */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 50px 0 30px;
}

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

.footer-brand .logo { color: #fff; font-size: 1.3rem; margin-bottom: 12px; display: block; }

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.8;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col ul a {
  font-size: 0.88rem;
  transition: var(--transition);
  opacity: 0.8;
}

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

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ==================== Back to Top ==================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-3px);
}

/* ==================== RTL Support (Arabic) ==================== */
html[dir="rtl"] body {
  font-family: 'Segoe UI', 'Tahoma', 'Helvetica Neue', Arial, sans-serif;
}

html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

html[dir="rtl"] .nav-links { flex-direction: row-reverse; }
html[dir="rtl"] .contact-item { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .form-group label { text-align: right; }
html[dir="rtl"] .back-to-top { right: auto; left: 30px; }
html[dir="rtl"] .lang-switcher { margin-left: 0; margin-right: 12px; }
html[dir="rtl"] .service-card { text-align: right; }
html[dir="rtl"] .product-info { text-align: right; }
html[dir="rtl"] .footer-brand { text-align: right; }
html[dir="rtl"] .footer-col { text-align: right; }

/* ==================== Scroll Animations ==================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-content p { max-width: 100%; margin-left: auto; margin-right: auto; }
  .hero-visual { order: -1; }
  .hero-image-placeholder { max-width: 300px; }
  .hero-content h1 { font-size: 2.3rem; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-image { order: -1; }
  .about-placeholder { max-width: 350px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .section-header h2 { font-size: 1.7rem; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
  }
  .menu-toggle { display: flex; }
  .hero-content h1 { font-size: 1.9rem; }
  .hero { min-height: auto; padding: 120px 0 60px; }
  .services-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .lang-switcher { margin-left: 8px; }
}
