/* 
  Weifang Guomei Chemical Co., Ltd 
  Main Stylesheet
*/

:root {
  /* Brand Colors */
  --primary-red: #cb1c21;
  --primary-yellow: #edb11f;
  --dark-red: #a3161a;
  --primary-green: #cb1c21; /* Mapping old vars to new brand color for compatibility */
  --dark-green: #a3161a;
  --primary-blue: #1a252f;
  --dark-blue: #0f171e;

  /* Neutral Colors */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --gray: #95a5a6;
  --dark-gray: #34495e;

  /* Typography */
  --font-arabic: 'Cairo', sans-serif;
  --font-english: 'Inter', sans-serif;

  /* Setup */
  --transition: all 0.3s ease;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.15);
}

/* Base Styles & Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html[dir="rtl"] body {
  font-family: var(--font-arabic);
  text-align: right;
}

html[dir="ltr"] body {
  font-family: var(--font-english);
  text-align: left;
}

body {
  background-color: var(--light-gray);
  color: var(--dark-gray);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Reusable Components */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-green);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--dark-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-secondary:hover {
  background-color: var(--white);
  color: var(--primary-blue);
  transform: translateY(-2px);
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--primary-blue);
  margin-bottom: 10px;
}

.section-title .divider {
  height: 4px;
  width: 60px;
  background-color: var(--primary-green);
  margin: 0 auto;
  border-radius: 2px;
}

/* Header & Navigation */
header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo img {
  height: 50px;
  width: auto;
}

.logo-text h1 {
  font-size: 1.2rem;
  color: var(--primary-blue);
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.8rem;
  color: var(--gray);
}

nav.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links li a {
  font-weight: 600;
  color: var(--primary-blue);
  position: relative;
  padding-bottom: 5px;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-green);
  transition: width 0.3s ease;
}

html[dir="ltr"] .nav-links li a::after {
  right: auto;
  left: 0;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-right: 30px;
  /* For RTL */
}

html[dir="ltr"] .nav-actions {
  margin-right: 0;
  margin-left: 30px;
}

.lang-switch {
  cursor: pointer;
  font-weight: 600;
  color: var(--gray);
}

.lang-switch:hover {
  color: var(--primary-green);
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--primary-blue);
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background-image: linear-gradient(rgba(26, 37, 47, 0.8), rgba(26, 37, 47, 0.8)), url('https://images.unsplash.com/photo-1599839619722-39751411ea63?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--white);
}

.hero-content {
  max-width: 800px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #e0e0e0;
}

.hero-buttons {
  display: flex;
  gap: 20px;
}

/* Features/Intro Section */
.intro {
  padding: 80px 0;
  background-color: var(--white);
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.intro-card {
  padding: 40px;
  background-color: var(--light-gray);
  border-radius: 10px;
  text-align: center;
  transition: var(--transition);
  border-bottom: 4px solid transparent;
}

.intro-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  border-bottom-color: var(--primary-green);
}

.intro-card i {
  font-size: 3rem;
  color: var(--primary-green);
  margin-bottom: 20px;
}

.intro-card h3 {
  font-size: 1.5rem;
  color: var(--primary-blue);
  margin-bottom: 15px;
}

/* Products Highlights Section */
.products-highlight {
  padding: 100px 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.product-img {
  height: 200px;
  background-color: #e9ecef;
  position: relative;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
  transform: scale(1.1);
}

.product-content {
  padding: 25px;
}

.product-content h3 {
  font-size: 1.25rem;
  color: var(--primary-blue);
  margin-bottom: 10px;
}

.product-content p {
  color: var(--gray);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
  padding: 80px 0;
  background-color: var(--primary-blue);
  color: var(--white);
  text-align: center;
}

.cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.cta-section p {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #bdc3c7;
}

/* Footer Section */
footer {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 80px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.footer-col h3 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-green);
}

html[dir="ltr"] .footer-col h3::after {
  right: auto;
  left: 0;
}

.footer-col p {
  color: #bdc3c7;
  margin-bottom: 15px;
}

.footer-links li {
  margin-bottom: 15px;
}

.footer-links li a {
  color: #bdc3c7;
  display: flex;
  align-items: center;
}

.footer-links li a::before {
  content: '\f104';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-left: 10px;
  color: var(--primary-green);
  transition: var(--transition);
}

html[dir="ltr"] .footer-links li a::before {
  content: '\f105';
  margin-left: 0;
  margin-right: 10px;
}

.footer-links li a:hover {
  color: var(--white);
}

.footer-links li a:hover::before {
  margin-left: 15px;
}

html[dir="ltr"] .footer-links li a:hover::before {
  margin-left: 0;
  margin-right: 15px;
}

.contact-info li {
  display: flex;
  margin-bottom: 20px;
  color: #bdc3c7;
}

.contact-info li i {
  color: var(--primary-green);
  margin-left: 15px;
  font-size: 1.2rem;
  margin-top: 5px;
}

html[dir="ltr"] .contact-info li i {
  margin-left: 0;
  margin-right: 15px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  animation: fadeIn 0.8s ease forwards;
}

/* Custom Dropdown Multi-Select */
.custom-select {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
  text-align: right;
}

html[dir="ltr"] .custom-select {
  text-align: left;
}

.select-header {
  padding: 15px;
  background-color: #fafafa;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dark-gray);
  font-family: inherit;
  transition: var(--transition);
}

.select-header:hover {
  border-color: var(--primary-green);
}

.select-header i {
  transition: transform 0.3s ease;
}

.custom-select.open .select-header i {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--white);
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  max-height: 250px;
  overflow-y: auto;
}

.custom-select.open .select-options {
  display: block;
}

.option-item {
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f1f1;
}

.option-item:last-child {
  border-bottom: none;
}

.option-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  color: var(--dark-gray);
  font-size: 0.95rem;
}

.option-item input[type="text"] {
  width: 130px;
  padding: 8px;
  font-size: 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ===== Hero Slider ===== */
.hero-slider {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-top: 80px;
  color: var(--white);
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26, 37, 47, 0.85) 0%, rgba(26, 37, 47, 0.6) 100%);
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide .container {
  position: relative;
  z-index: 2;
}

.hero-slide .hero-content {
  max-width: 800px;
}

.hero-slide .hero-content h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-slide .hero-content p {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #e0e0e0;
}

.hero-slide .hero-content .hero-buttons {
  display: flex;
  gap: 20px;
}

/* Slider Dots Navigation */
.slider-dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.slider-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.slider-dots .dot.active {
  background-color: var(--primary-red);
  border-color: var(--white);
  transform: scale(1.2);
}

.slider-dots .dot:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

/* ===== Factory Image on Home About Section ===== */
.home-factory-image {
  margin-top: 40px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  max-height: 450px;
}

.home-factory-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Management Team Section ===== */
.team-section {
  padding: 80px 0;
  background-color: var(--light-gray);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.team-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}

.team-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.team-card-img {
  width: 100%;
  height: 300px;
  overflow: hidden;
  background-color: #e9ecef;
}

.team-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.team-card:hover .team-card-img img {
  transform: scale(1.05);
}

.team-card-info {
  padding: 20px;
}

.team-card-info h3 {
  font-size: 1.2rem;
  color: var(--primary-blue);
  margin-bottom: 5px;
}

.team-card-info p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* ===== Factory Gallery Section ===== */
.factory-gallery {
  padding: 80px 0;
  background-color: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  height: 300px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 37, 47, 0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  color: var(--white);
  font-weight: 600;
  font-size: 1rem;
}

/* Media Queries */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.8rem;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  nav.desktop-nav {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--white);
    flex-direction: column;
    justify-content: center;
    transition: right 0.4s ease;
  }

  html[dir="ltr"] nav.desktop-nav {
    right: auto;
    left: -100%;
    transition: left 0.4s ease;
  }

  nav.desktop-nav.active {
    right: 0;
  }

  html[dir="ltr"] nav.desktop-nav.active {
    left: 0;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    font-size: 1.2rem;
  }

  .nav-actions {
    margin-top: 30px;
    margin-right: 0;
  }

  html[dir="ltr"] .nav-actions {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero p {
    font-size: 1rem;
  }

  .container {
    padding: 0 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-content {
    padding: 40px 20px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-card {
    grid-template-columns: 1fr;
  }

  /* Hero Slider responsive */
  .hero-slide .hero-content h1 {
    font-size: 2rem;
  }

  .hero-slide .hero-content p {
    font-size: 1rem;
  }

  .hero-slide .hero-content .hero-buttons {
    flex-direction: column;
  }

  .hero-slide {
    background-attachment: scroll;
  }

  /* Team Section responsive */
  .team-grid {
    grid-template-columns: 1fr;
  }

  .team-section {
    padding: 50px 0;
  }

  /* Gallery responsive */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .factory-gallery {
    padding: 50px 0;
  }

  .gallery-item {
    height: 220px;
  }
}