/* --- 1. Design System Variables --- */
:root {
  /* Palette */
  --primary: #0b1f3a; /* Navy Blue */
  --accent: #17bebb; /* Teal */
  --white: #ffffff;
  --bg-light: #f6f8fb; /* Light Gray */
  --text-dark: #101828; /* Dark */
  --text-muted: #667085; /* Gray */
  --card-bg: #ffffff; /* var(--white) */
  --border: #e5e7eb; /* Light Border */

  /* Typography */
  --font-main: "Cairo", sans-serif;

  /* Spacing */
  --padding-section-desktop: 80px 20px;
  --padding-section-mobile: 48px 16px;
  --max-width: 1120px;
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

/* --- 2. Reset & Base Styles --- */

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(
    0,
    0,
    0,
    0
  ); /* دي "بتقص" العنصر وتخليه مختفي تماماً من غير ما تحدفه يمين أو شمال */
  white-space: nowrap;
}

.skip-link:focus {
  left: 10px; /* 1. هات العنصر من -999px وحطه في بداية الشاشة */
  top: 10px; /* 2. خليه فوق شوية عشان يبان */
  z-index: 9999; /* 3. خليه فوق أي صورة أو لوجو عشان مفيش حاجة تغطيه */

  /* تنسيق الشكل عشان يبان كزرار */
  background: var(--primary);
  color: var(--white);
  padding: 10px;
  width: auto; /* رجع عرضه طبيعي */
  height: auto; /* رجع طوله طبيعي */
  clip: auto; /* الغي القص (لو كنا مستخدمين الطريقة الحديثة) */
}
:focus-visible {
  outline: 3px solid rgba(23, 190, 187, 0.65);
  outline-offset: 3px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Button Back to top */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #001018;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 999;
}

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

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: 32px;
}
h2 {
  font-size: 28px;
}
h3 {
  font-size: 20px;
}

p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

a {
  text-decoration: none;
}
ul {
  list-style: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  border: 2px solid var(--primary);
}

.btn-primary:hover {
  background-color: #162d50;
  border-color: #162d50;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover {
  background-color: var(--bg-light);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--white);
  border: none;
}
.btn-accent:hover {
  opacity: 0.9;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

section {
  padding: var(--padding-section-mobile);
}

/* --- 3. Header / Nav --- */
header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 20px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.nav-links {
  display: none; /* Hidden on mobile */
  gap: 32px;
  align-items: center;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.nav-links a:not(.btn) {
  color: var(--text-dark);
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--accent);
}

.hamburger {
  display: block;
  font-size: 28px;
  cursor: pointer;
  color: var(--primary);
}

/* --- 4. Hero Section --- */
.hero {
  background-color: var(--bg-light);
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

.hero-content h1 {
  color: var(--primary);
  margin-bottom: 24px;
  letter-spacing: -0.4px;
}

.hero-content p {
  font-size: 17px;
  max-width: 54ch;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-card {
  background: var(--card-bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.hero-card ul li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
  font-weight: 600;
}

.check-icon {
  color: var(--accent);
}

/* --- 5. Trust Indicators --- */
.trust {
  background: var(--white);
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.trust-item {
  text-align: center;
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.trust-item h3 {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 8px;
}

.trust-item p {
  margin: 0;
  font-weight: 600;
  color: var(--primary);
}

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

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px auto;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.service-card {
  background: var(--card-bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.3s;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.service-icon {
  font-size: 40px;
  margin-bottom: 20px;
  color: var(--accent);
}

/* --- 7. How It Works --- */
.process {
  text-align: center;
}

.process-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 40px;
}

.step {
  position: relative;
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin: 0 auto 20px auto;
}

/* --- 8. Testimonials --- */
.testimonials {
  background: var(--bg-light);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.review-card {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.client-info h4 {
  color: var(--primary);
  font-weight: 700;
}
.client-info span {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- 9. FAQ Section --- */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-main);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding-right: 20px;
}

.faq-answer p {
  padding-bottom: 20px;
}

/* --- Quote Section --- */
.quote {
  background: var(--white);
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

.quote-info h2 {
  margin-bottom: 12px;
}

.quote-points li {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
  font-weight: 600;
}

.quote-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.quote-form label {
  display: block;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  font-size: 14px;
}

.quote-form input,
.quote-form select,
.quote-form textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
  font-family: var(--font-main);
  font-size: 15px;
}

.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 190, 187, 0.15);
}

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

.form-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0;
}
/* --- 13. Advanced Form Styles (Shipment Mode) --- */

.shipment-mode-box {
  background: #f8f9fa;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.shipment-label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
  font-size: 0.95rem;
  user-select: none;
}

/* تكبير زر الاختيار وتلوينه */
.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent); /* لون التحديد */
  cursor: pointer;
}

/* المنطقة المخفية لتفاصيل الحاويات */
#fcl-details {
  /* display: none;  <-- JS handles this */
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: none; /* Default State */
  gap: 15px;
  flex-wrap: wrap;
}

.container-input-col {
  flex: 1;
  min-width: 140px;
}

.container-input-col label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.container-input-col input {
  margin-bottom: 0; /* Remove default margin */
  background: var(--white);
}

/* --- Dark Mode Support --- */
body.dark-mode .shipment-mode-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .shipment-label {
  color: var(--white);
}

body.dark-mode #fcl-details {
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .container-input-col input {
  background: #1e293b; /* Darker input background */
  border-color: #334155;
  color: var(--white);
}

@media (min-width: 1024px) {
  .quote-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- 10. Final CTA --- */
.final-cta {
  background-color: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 80px 20px;
}

.final-cta h2 {
  color: var(--white);
}
.final-cta p {
  color: #e5e7eb;
  max-width: 600px;
  margin: 0 auto 32px auto;
}

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

.contact {
  background: var(--bg-light);
}

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

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.contact-card a {
  color: var(--primary);
  font-weight: 700;
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Footer --- */
footer {
  background: #081628; /* Darker than primary */
  color: var(--white);
  padding: 60px 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
}

footer h3 {
  color: var(--white);
}

.footer-col h4 {
  color: var(--accent);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 12px;
}
.footer-col a {
  color: #ccc;
}
.footer-col a:hover {
  color: var(--white);
}

/* --- Responsive Desktop Styles (Min-width 1024px) --- */
@media (min-width: 1024px) {
  h1 {
    font-size: 48px;
  }
  h2 {
    font-size: 36px;
  }

  section {
    padding: var(--padding-section-desktop);
  }

  .hamburger {
    display: none;
  }
  .nav-links {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    position: relative;
    overflow: hidden;
  }

  .hero::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(23, 190, 187, 0.12);
    top: -160px;
    right: -160px;
    filter: blur(2px);
    pointer-events: none;
  }

  .hero-content p {
    font-size: 18px;
  }

  .hero-buttons {
    flex-direction: row;
  }

  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .process-steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .testimonial-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* Mobile Menu Active State */
.nav-active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--white);
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border);
  opacity: 1;
  transform: translateY(0);
}

/* Mobile only */
@media (max-width: 1023px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border);
  }

  .nav-links.nav-active {
    display: flex;
  }
}

.theme-toggle {
  background: none;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
}

.theme-toggle:hover {
  background: var(--primary);
  color: var(--white);
}

body,
header,
section,
.service-card,
.review-card,
.hero-card,
.quote-form {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

/* --- Dark Mode --- */
body.dark-mode {
  --white: #0b1220; /* Page background */
  --bg-light: #0f172a; /* Sections background */
  --card-bg: #111c2f; /* Cards */
  --text-dark: #f1f5f9; /* Main text */
  --text-muted: #cbd5e1; /* Muted text */
  --border: #22314a; /* Borders */
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .logo,
body.dark-mode .nav-links a:not(.btn) {
  color: var(--text-dark);
}

/* Titles */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
  color: #ffffff;
}

body.dark-mode .step-number {
  background: var(--accent);
  color: #001018;
  box-shadow: 0 0 12px rgba(23, 190, 187, 0.4);
}

/* Paragraphs */
body.dark-mode p {
  color: var(--text-muted);
}

/* FAQ questions */
body.dark-mode .faq-question {
  color: #ffffff;
}

/* Trust numbers */
body.dark-mode .trust-item h3 {
  color: var(--accent);
}

/* Contact section text */
body.dark-mode .contact-card h3,
body.dark-mode .contact-card p,
body.dark-mode .contact-card a {
  color: #ffffff;
}

/* Testimonials names */
body.dark-mode .client-info h4 {
  color: #ffffff;
}

body.dark-mode .client-info span {
  color: var(--text-muted);
}

body.dark-mode .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #001018;
}

body.dark-mode .btn-secondary {
  color: var(--text-dark);
  border-color: var(--border);
}
body.dark-mode .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .theme-toggle {
  border-color: var(--border);
  color: var(--text-dark);
}
body.dark-mode .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Fix Footer Links in Dark Mode */

body.dark-mode footer a {
  color: #cbd5e1;
  transition: color 0.25s ease;
}

body.dark-mode footer a:hover {
  color: var(--accent);
}

/* Smooth scroll For Safari */
@supports not (scroll-behavior: smooth) {
  html {
    scroll-behavior: auto;
  }
}

/* Print styles */
@media print {
  header,
  .back-to-top,
  .final-cta,
  footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}

/* Reduced motion Sensitive users*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading skeleton (optional) */
.loading {
  background: linear-gradient(
    90deg,
    var(--bg-light) 25%,
    var(--border) 50%,
    var(--bg-light) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --- 12. RTL Support (Arabic) --- */
/* This section overrides specific styles when the html tag has dir="rtl"
   No need for a separate stylesheet.
*/

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Reverse Flex directions or margins where necessary */
[dir="rtl"] .nav-links {
  margin-left: 0;
  margin-right: auto;
  /* If you want the logo on Right and Links on Left, Flexbox usually handles this automatically with space-between. 
     Just ensure no specific margins are forcing it otherwise. */
}

/* Flip Icons and Margins */
[dir="rtl"] .hero-card ul li .check-icon,
[dir="rtl"] .quote-points li .check-icon {
  margin-right: 0;
  margin-left: 10px; /* Flip margin for icons */
}

/* Flip Arrows in links */
[dir="rtl"] .service-card a {
  display: inline-block;
}
[dir="rtl"] .service-card a:hover {
  transform: translateX(-5px); /* Move left on hover instead of right */
}

/* Form Inputs */
[dir="rtl"] .quote-form input,
[dir="rtl"] .quote-form select,
[dir="rtl"] .quote-form textarea {
  text-align: right;
}

/* FAQ Icons position */
[dir="rtl"] .faq-question {
  text-align: right;
}

[dir="rtl"] .faq-answer {
  padding-right: 0;
  padding-left: 20px;
}

/* Footer alignment */
[dir="rtl"] footer {
  text-align: right;
}

/* Mobile Menu Slide direction */
@media (max-width: 1023px) {
  [dir="rtl"] .nav-links {
    left: auto;
    right: 0; /* Slide from right if desired, or keep default */
  }
}

/* Language Switcher Button Style */
.lang-switch {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  border: 1px solid var(--primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-inline-start: 15px; /* Adds space depending on direction */
  transition: all 0.3s ease;
}

.lang-switch:hover {
  background-color: var(--primary);
  color: var(--white);
}

[dir="rtl"] .lang-switch {
  font-family: sans-serif; /* English font for the "English" button */
}
