/* Aifiber Technology - English Template
   Based on Design: 首页.png, 产品列表.png, 产品内容页.png, 关于.png
   White background + Teal/Green accent color scheme
*/

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header - White background */
.header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 70px;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo img { height: 40px; }
.logo span { font-size: 1.4rem; font-weight: 600; color: #333; }

/* Nav */
.nav-menu { display: flex; gap: 35px; }
.nav-menu a {
  font-size: 0.95rem;
  color: #555;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s;
}
.nav-menu a:hover, .nav-menu a.active {
  color: #00a8a8;
}
.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: #00a8a8;
}

/* Header Right */
.nav-right { display: flex; align-items: center; gap: 20px; }
.lang-switch { position: relative; }
.lang-switch::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 8px;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.lang-btn img { width: 20px; height: 14px; }
.lang-dropdown {
  position: absolute;
  top: 100%; right: 0;
  margin-top: 5px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 140px;
  padding: 5px 0;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.lang-switch:hover .lang-dropdown,
.lang-dropdown:hover { display: block; }
.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  font-size: 0.85rem;
  color: #555;
  transition: background 0.2s;
}
.lang-dropdown a:hover { background: #f5f5f5; color: #00a8a8; }

.social-icons { display: flex; gap: 12px; }
.social-icons a {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #555;
  transition: all 0.3s;
}
.social-icons a:hover { background: #f0f0f0; color: #00a8a8; }

/* Hero Section - Teal/Green gradient */
.hero {
  position: relative;
  min-height: 500px;
  background: linear-gradient(135deg, #7fb3a6 0%, #5a9a8a 50%, #4a8a7a 100%);
  margin-top: 70px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 50%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="80" cy="50" r="40" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
  opacity: 0.3;
}
.hero-content {
  position: relative;
  z-index: 2;
 
  padding: 60px 0;
}
.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 15px;
  line-height: 1.2;
}
.hero-content p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
}

/* Info Bar */
.info-bar {
  background: #f8f9fa;
  padding: 40px 0;
  text-align: center;
}
.info-bar p {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* Product Showcase - 3 cards */
.product-showcase {
  padding: 60px 0;
  background: #fff;
}
.product-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.showcase-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}
.showcase-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.showcase-card-img {
  height: 200px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.showcase-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.showcase-card-body { padding: 25px; }
.showcase-card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}
.showcase-card-body p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* Section Title */
.section-title {
  text-align: center;
  margin-bottom: 50px;
}
.section-title h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}
.section-title p {
  font-size: 1rem;
  color: #666;
}

/* About Section */
.about-section {
  padding: 80px 0;
  background: #f8f9fa;
}
.about-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
}
.about-intro h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}
.about-intro p {
  font-size: 1rem;
  color: #666;
  line-height: 1.8;
}

/* Timeline */
.timeline {
  padding: 60px 0;
}
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}
.timeline-item {
  text-align: center;
  padding: 20px;
}
.timeline-item .year {
  font-size: 1.3rem;
  font-weight: 700;
  color: #00a8a8;
  margin-bottom: 10px;
}
.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}
.timeline-item p {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.6;
}

/* Why Choose Us */
.why-choose {
  padding: 60px 0;
  background: #fff;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}
.why-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}
.why-item p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.7;
}

/* Contact Form */
.contact-section {
  padding: 60px 0;
  background: #f8f9fa;
}
.contact-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 30px;
}
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #00a8a8;
}
.form-group textarea {
  height: 120px;
  resize: vertical;
}
.btn-submit {
  background: #5b7cff;
  color: #fff;
  padding: 12px 40px;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-submit:hover { background: #4a6bef; }

/* Product List Page */
.product-list-page {
  padding: 40px 0;
  margin-top: 70px;
}
.product-list-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}
.product-sidebar h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}
.sidebar-nav { margin-bottom: 30px; }
.sidebar-nav li { margin-bottom: 8px; }
.sidebar-nav a {
  display: block;
  padding: 8px 0;
  color: #666;
  font-size: 0.9rem;
  transition: color 0.3s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #00a8a8;
}
.product-count {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 20px;
}

.product-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.product-main-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
}
.product-search {
  display: flex;
  gap: 10px;
}
.product-search input {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 250px;
  font-size: 0.9rem;
}
.product-search button {
  padding: 10px 20px;
  background: #5b7cff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}
.product-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.product-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.product-card-img {
  height: 180px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
.product-card-body {
  padding: 15px;
}
.product-card-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin-bottom: 5px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.pagination a, .pagination span {
  min-width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.3s;
}
.pagination a:hover, .pagination .current {
  background: #5b7cff;
  color: #fff;
  border-color: #5b7cff;
}

/* Product Detail */
.product-detail-page {
  padding: 40px 0;
  margin-top: 70px;
}
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.product-gallery { position: relative; }
.product-main-img {
  background: #f5f5f5;
  border-radius: 8px;
  height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}
.product-main-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
.product-thumbs {
  display: flex;
  gap: 10px;
}
.product-thumbs img {
  width: 70px; height: 70px;
  object-fit: cover;
  border: 2px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s;
}
.product-thumbs img:hover,
.product-thumbs img.active {
  border-color: #00a8a8;
  opacity: 1;
}

.product-info h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}
.product-info .subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 25px;
}
.product-info .description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.8;
  margin-bottom: 25px;
}
.product-info .description ul {
  list-style: disc;
  padding-left: 20px;
  margin-top: 15px;
}
.product-info .description li {
  margin-bottom: 8px;
}

/* Footer */
.footer {
  background: #4a4a4a;
  color: #ccc;
  padding: 30px 0;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.footer-left { max-width: 400px; }
.footer-left p { margin-bottom: 5px; }
.footer a { color: #ccc; }
.footer a:hover { color: #00a8a8; }

.whatsapp-float {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 50px; height: 50px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 999;
}

/* ===== RTL Overrides for Arabic ===== */
[dir="rtl"] .nav-menu { flex-direction: row; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .product-detail-grid { direction: rtl; }
[dir="rtl"] .product-info .description ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .product-list-layout { direction: rtl; }
[dir="rtl"] .hero-content { text-align: right; }
[dir="rtl"] .footer-left { text-align: right; }
[dir="rtl"] .section-title h2, [dir="rtl"] .section-title p { text-align: center; }
[dir="rtl"] .about-intro h2, [dir="rtl"] .about-intro p { text-align: center; }
[dir="rtl"] .timeline-item { text-align: center; }
[dir="rtl"] .why-item h3, [dir="rtl"] .why-item p { text-align: right; }
[dir="rtl"] .contact-section h2, [dir="rtl"] .contact-section > p { text-align: center; }
[dir="rtl"] .product-main-header { direction: rtl; }
[dir="rtl"] .whatsapp-float { right: auto; left: 30px; }

/* Responsive */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .product-showcase-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-showcase-grid { grid-template-columns: 1fr; }
  .product-list-layout { grid-template-columns: 1fr; }
  .product-detail-grid { grid-template-columns: 1fr; }
  .timeline-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-content h1 { font-size: 2rem; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============================================ */
/* RTL Overrides for Arabic                      */
/* ============================================ */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] .nav-menu { flex-direction: row-reverse; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .product-detail-grid { direction: rtl; }
[dir="rtl"] .footer { direction: rtl; }
[dir="rtl"] .footer-left { text-align: right; }
[dir="rtl"] .product-card-body h3 { text-align: right; }
[dir="rtl"] .about-intro h2,
[dir="rtl"] .about-intro p { text-align: right; }
[dir="rtl"] .section-title h2,
[dir="rtl"] .section-title p { text-align: right; }
[dir="rtl"] .why-item h3,
[dir="rtl"] .why-item p { text-align: right; }
[dir="rtl"] .timeline-item { text-align: right; }
[dir="rtl"] .product-main-header { direction: rtl; }
[dir="rtl"] .product-search { direction: rtl; }
[dir="rtl"] .product-sidebar { text-align: right; }
[dir="rtl"] .sidebar-nav { padding-right: 0; padding-left: 0; }
