/* ============================================
   شركة الصافي الأول لاستيراد الملابس والمنسوجات
   Al Safi Al Awal Company - Main Stylesheet
   ============================================ */

/* ----- CSS Variables ----- */
:root {
  /* Colors */
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --primary-dark: #0f2440;
  --secondary: #c8a96e;
  --secondary-light: #e0c9a0;
  --secondary-dark: #a8884a;
  --accent: #e74c3c;
  --text-dark: #1a1a2e;
  --text-medium: #4a4a5a;
  --text-light: #7a7a8a;
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-gray: #e9ecef;
  --mid-gray: #ced4da;
  --bg-section: #f0f4f8;
  --bg-gradient: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 50%, #1a3a5c 100%);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --shadow-hover: 0 12px 48px rgba(0,0,0,0.2);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: 'Gulf', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Montserrat', 'Gulf', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  color: var(--text-dark);
  line-height: 1.7;
  background-color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

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

.section {
  padding: 100px 0;
}

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

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.section-line {
  width: 80px;
  height: 4px;
  background: linear-gradient(to left, var(--secondary), var(--secondary-light));
  margin: 0 auto 20px;
  border-radius: 4px;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-align: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--white);
  border-color: var(--secondary);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(200, 169, 110, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-secondary:hover {
  background: var(--white);
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  background: transparent;
}

.header.scrolled {
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 10px 0;
}

.header.scrolled .nav-link {
  color: var(--text-dark);
}

.header.scrolled .nav-link.active,
.header.scrolled .nav-link:hover {
  color: var(--secondary-dark);
}

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

.logo {
  flex-shrink: 0;
}

.logo img {
  height: 50px;
  width: auto;
  transition: var(--transition);
}

.header.scrolled .logo img {
  height: 44px;
}

/* ----- Navigation ----- */
.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 20px;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  border-radius: 50px;
  transition: var(--transition);
  position: relative;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--secondary);
  background: rgba(255,255,255,0.1);
}

.header.scrolled .nav-link:hover,
.header.scrolled .nav-link.active {
  background: rgba(26, 58, 92, 0.08);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 6px;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: var(--white);
  border-radius: 3px;
  transition: var(--transition);
}

.header.scrolled .hamburger span {
  background: var(--text-dark);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  overflow: hidden;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 169, 110, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 40px 20px;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.hero-content h2 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--secondary-light);
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.hero-content p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.9;
}

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

/* Hero Wave */
.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  line-height: 0;
  z-index: 2;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}

/* ========== ABOUT SECTION ========== */
.about {
  background: var(--white);
}

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

.about-text p {
  font-size: 1.05rem;
  color: var(--text-medium);
  line-height: 1.9;
  margin-bottom: 20px;
}

.about-text p strong {
  color: var(--primary);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.stat-item {
  text-align: center;
  background: var(--off-white);
  padding: 24px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: 1px solid var(--light-gray);
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary-light);
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--secondary-dark);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 8px;
}

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

.about-image-placeholder {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.about-image-placeholder::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: calc(var(--radius-lg) - 10px);
}

.about-image-placeholder i {
  font-size: 3.5rem;
  color: rgba(255,255,255,0.2);
  position: relative;
  z-index: 1;
}

.about-image-placeholder i:nth-child(1) { font-size: 5rem; color: var(--secondary); opacity: 0.9; }
.about-image-placeholder i:nth-child(2) { font-size: 4rem; color: var(--secondary-light); opacity: 0.7; }
.about-image-placeholder i:nth-child(3) { font-size: 4.5rem; color: var(--secondary); opacity: 0.6; }

/* ========== SERVICES SECTION ========== */
.services {
  background: var(--bg-section);
}

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

.service-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--light-gray);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to left, var(--secondary), var(--secondary-dark));
  transform: scaleX(0);
  transition: var(--transition);
}

.service-card:hover::before {
  transform: scaleX(1);
}

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

.service-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.service-icon i {
  font-size: 2rem;
  color: var(--white);
}

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

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

/* ========== PRODUCTS SECTION ========== */
.products {
  background: var(--white);
}

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

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

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.product-img {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.product-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3) 100%);
}

.product-img i {
  font-size: 5rem;
  color: rgba(255,255,255,0.2);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.product-card:hover .product-img i {
  transform: scale(1.2);
  color: var(--secondary);
}

.product-info {
  padding: 24px;
}

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

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

/* ========== CONTACT SECTION ========== */
.contact {
  background: var(--bg-section);
}

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

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateX(-5px);
  box-shadow: var(--shadow-md);
}

.contact-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon i {
  font-size: 1.3rem;
  color: var(--white);
}

.contact-details h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.contact-details p,
.contact-details a {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-details a:hover {
  color: var(--secondary-dark);
}

.contact-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.social-link:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ----- Contact Form ----- */
.contact-form {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

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

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 20px;
  font-family: var(--font-primary);
  font-size: 1rem;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  background: var(--off-white);
  transition: var(--transition);
  color: var(--text-dark);
  direction: rtl;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(200, 169, 110, 0.15);
}

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

.btn-submit {
  width: 100%;
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn-submit i {
  font-size: 1.1rem;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to left, var(--secondary), var(--secondary-dark));
}

.footer-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding: 60px 24px;
}

.footer-col h4 {
  color: var(--secondary);
  font-size: 1.1rem;
  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(--secondary);
  border-radius: 3px;
}

.footer-about img {
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-about p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.7);
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links ul li a::before {
  content: '\f053';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--secondary);
  transition: var(--transition);
}

.footer-links ul li a:hover {
  color: var(--secondary);
  padding-right: 6px;
}

.footer-contact ul li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
}

.footer-contact ul li i {
  color: var(--secondary);
  margin-top: 4px;
  width: 16px;
}

.footer-contact ul li a {
  color: rgba(255,255,255,0.7);
}

.footer-contact ul li a:hover {
  color: var(--secondary);
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--secondary);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0;
  text-align: center;
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

.footer-bottom a {
  color: var(--secondary);
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet */
@media (max-width: 992px) {
  .hero-content h1 { font-size: 3rem; }
  .hero-content h2 { font-size: 1.5rem; }
  
  .about-content { grid-template-columns: 1fr; gap: 40px; }
  .about-image-placeholder { max-width: 400px; margin: 0 auto; aspect-ratio: 1; }
  
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  
  .contact-content { grid-template-columns: 1fr; }
  .contact-form { order: -1; }
  
  .footer-container { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}

/* Mobile */
@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .section-title { font-size: 1.8rem; }
  .section-header { margin-bottom: 40px; }

  /* Header */
  .nav-list {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    padding: 100px 30px 30px;
    gap: 4px;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }

  .nav-list.active {
    right: 0;
  }

  .nav-link {
    color: var(--text-dark);
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(26, 58, 92, 0.08);
    color: var(--primary);
  }

  .hamburger {
    display: flex;
  }

  .header.scrolled .hamburger span { background: var(--text-dark); }

  /* Hero */
  .hero-content h1 { font-size: 2.2rem; }
  .hero-content h2 { font-size: 1.2rem; }
  .hero-content p { font-size: 1rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; }
  .hero-wave svg { height: 50px; }

  /* Stats */
  .about-stats { grid-template-columns: 1fr; gap: 12px; max-width: 300px; margin: 30px auto 0; }

  /* Grids */
  .services-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }

  /* Contact */
  .contact-form { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer-container { grid-template-columns: 1fr; gap: 30px; text-align: center; }
  .footer-col h4::after { right: 50%; transform: translateX(50%); }
  .footer-links ul li a { justify-content: center; }
  .footer-social { justify-content: center; }
  .footer-bottom .container { flex-direction: column; gap: 8px; }

  /* Back to top */
  .back-to-top { left: 20px; bottom: 20px; width: 44px; height: 44px; }
}

/* Small Mobile */
@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .hero-content h2 { font-size: 1rem; }
  .container { padding: 0 16px; }
  .contact-form { padding: 20px; }
  .service-card { padding: 28px 20px; }
  .product-info { padding: 16px; }
  .product-img { height: 160px; }
}
