/* Universal Box-Sizing for predictable layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* === 1. General & Root Styles === */
/* ... the rest of your css code ... */
/* === 1. General & Root Styles === */

html {
  scroll-behavior: smooth;
}

:root {
  /* Night Mode (Default) */
  --bg-color: #1a2533;
  --header-bg: transparent;
  --header-border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-muted: #bdc3c7;
  --card-bg: #ffffff;
  --card-text: #333;
  --button-bg: rgba(255, 255, 255, 0.1);
  --button-border: rgba(255, 255, 255, 0.2);
  --button-hover: rgba(255, 255, 255, 0.2);
  --link-color: #007BFF;
  --glow-color: rgba(29, 78, 216, 0.15);
  --icon-color: #ffffff;
  --input-bg: rgba(255,255,255,0.05);
  --input-border: rgba(255,255,255,0.2);
  --input-text: #ffffff;
  --section-bg: #212e3e;
  --section-title-color: #ffffff;
  --section-text-color: #bdc3c7;
  --footer-bg: #141d28;
  --footer-text: #a0aec0;
  --footer-title: #ffffff;
  --footer-border: rgba(255,255,255,0.1);
}

body.light-mode {
  /* Day Mode */
  --bg-color: #f4f8ff;
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border-color: #dee2e6;
  --text-primary: #212529;
  --text-muted: #6c757d;
  --card-bg: #ffffff;
  --card-text: #333;
  --button-bg: #f8f9fa;
  --button-border: #dee2e6;
  --button-hover: #e9ecef;
  --link-color: #007BFF;
  --glow-color: rgba(0, 123, 255, 0.08);
  --icon-color: #212529;
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --input-text: #495057;
  --section-bg: #ffffff;
  --section-title-color: #212529;
  --section-text-color: #6c757d;
  --footer-bg: #f8f9fa;
  --footer-text: #6c757d;
  --footer-title: #212529;
  --footer-border: #e9ecef;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#vanta-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* === 2. Header & Navigation === */
header {
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  padding: 2.5rem 2rem 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--header-border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo {
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem;
  position: relative;
}

nav a:hover {
  color: #ffc107;
}

nav a .icon {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background-color: var(--icon-color);
  opacity: 0;
  transition: all 0.3s ease;
  mask-size: contain;
  -webkit-mask-size: contain;
}

nav a:hover .icon {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

nav a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--icon-color);
  bottom: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}

nav a:hover::after {
  transform: scaleX(1);
}

/* === 3. Header Controls: Language & Theme === */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-switcher {
  position: relative;
}

.lang-current {
  background-color: transparent;
  border: 1px solid var(--header-border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.lang-current:hover {
  background-color: var(--button-hover);
}

.lang-icon {
  stroke: var(--text-primary);
}

.lang-dropdown {
  position: absolute;
  top: 130%;
  right: 0;
  background-color: var(--bg-color);
  border: 1px solid var(--header-border-color);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  z-index: 1100;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.lang-switcher.active .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.lang-option:hover,
.lang-option.active {
  background-color: var(--button-hover);
  color: var(--text-primary);
}

.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'></path></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

input:checked + .slider {
  background-color: var(--link-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a2533' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='5'></circle><line x1='12' y1='1' x2='12' y2='3'></line><line x1='12' y1='21' x2='12' y2='23'></line><line x1='4.22' y1='4.22' x2='5.64' y2='5.64'></line><line x1='18.36' y1='18.36' x2='19.78' y2='19.78'></line><line x1='1' y1='12' x2='3' y2='12'></line><line x1='21' y1='12' x2='23' y2='12'></line><line x1='4.22' y1='19.78' x2='5.64' y2='18.36'></line><line x1='18.36' y1='5.64' x2='19.78' y2='4.22'></line></svg>");
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* === 4. Backgrounds, Layout & Titles === */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

body.light-mode #particles-js {
  background-color: var(--bg-color);
}

.interactive-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: radial-gradient(600px at 50% 50%, var(--glow-color), transparent 80%);
  z-index: -1;
  pointer-events: none;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

.section-title, .page-title {
  color: var(--text-primary);
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.section-subtitle, .page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0.5rem auto 3rem auto;
}

main.content-wrapper {
  position: relative;
  z-index: 1;
}

/* === 5. Hero Section (Home Page) === */
.hero {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  pointer-events: none;
  padding: 28vh 0;
}

.hero-content {
  pointer-events: auto;
  max-width: 800px;
  padding: 2.5rem 3rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.light-mode .hero-content {
  background-color: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

.hero-title {
  font-size: 3.0rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  max-width: 650px;
  margin: 0 auto 1.5rem auto; /* Adjusted margin for the new button group */
}

/* Container for both hero buttons */
.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allows buttons to stack on smaller screens if needed */
    gap: 1.5rem; /* Space between the two buttons */
    margin-top: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background-color: var(--link-color);
  border: 2px solid var(--link-color);
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  align-self: center;
}

.cta-button:hover {
  background-color: transparent;
  color: var(--link-color);
  border-color: var(--link-color);
  transform: translateY(-3px);
}

/* Style for the new secondary button */
.cta-button.secondary {
    background-color: transparent;
    color: #ffffff; /* White text for contrast on dark bg */
    border-color: rgba(255, 255, 255, 0.5); /* Semi-transparent border */
}

.cta-button.secondary:hover {
    background-color: white;
    color: var(--bg-color); /* Dark text on hover */
    border-color: white;
}

/* Adjustments for light mode */
body.light-mode .cta-button.secondary {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

body.light-mode .cta-button.secondary:hover {
    background-color: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* === 6. Combined Section (Home Page) - WIDENED LAYOUT === */
.combined-section {
  position: relative;
  background-color: var(--section-bg);
  z-index: 1;
  overflow: hidden;
  padding: 1px 0;
}

#star-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.combined-section .page-container {
  position: relative;
  z-index: 1;

  /* 
    KEY FIX: We are making THIS SPECIFIC container wider.
    Instead of 1200px, it can now be up to 1500px.
    This gives the cards inside room to spread out.
  */
  max-width: 1500px;
}

.combined-section .section-title, .combined-section .section-subtitle {
  color: var(--section-title-color);
}

.section-intro {
  max-width: 800px;
  margin: 0 auto 4rem auto;
  text-align: center;
}

.values-grid-inline {
  display: grid;
  
  /* Now this rule will work, because the container is wider */
  grid-template-columns: repeat(4, 1fr);
  
  gap: 3rem; /* A good gap for this new wide layout */
  margin-bottom: 3rem;
}

.value-card-inline {
  text-align: center;
  padding: 2rem;
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.value-card-inline:hover {
  transform: translateY(-10px);
  background-color: var(--button-hover);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.value-card-inline .value-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--link-color);
  border-radius: 50%;
  color: var(--link-color);
}

.value-card-inline .value-icon svg {
  stroke: var(--link-color);
}

.value-card-inline h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

body.light-mode .value-card-inline h3 {
  color: var(--card-text);
}

.value-card-inline p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

body:not(.light-mode) .value-card-inline {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
}

/* Make it responsive */
@media (max-width: 1200px) {
  .values-grid-inline {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .values-grid-inline {
    grid-template-columns: 1fr;
  }
}



/* === 7. Partners Page === */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.tab-button {
  background-color: var(--button-bg);
  color: var(--text-primary);
  border: 1px solid var(--button-border);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background-color: var(--button-hover);
}

.tab-button.active {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

.partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* CHANGED: Align all items to the center */
  gap: 1.5rem;
}

.partner-link {
  text-decoration: none;
  display: block;
  flex-grow: 0; /* Prevent stretching */
  flex-shrink: 0;
  width: 220px; /* Force a fixed width */
  transition: opacity 0.4s ease, transform 0.4s ease; /* More specific transition */
  transform: scale(1) translateY(0);
  opacity: 1;
}

.partner-link.hide {
  transform: translateY(20px) scale(0.95); /* Animate out downwards */
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  padding: 0;
  margin: -0.75rem;
  overflow: hidden;
}

.partner-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid var(--button-border); /* Use a defined variable */
}

.partner-link:hover .partner-card {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.partner-card img {
  max-height: 60px;
  max-width: 140px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.partner-card h3 {
  color: var(--card-text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* === 8. About Us Page === */
.about-section {
  margin-top: 5rem;
}

.about-page .page-container {
  text-align: center;
  max-width: 1400px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.about-card {
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: left;
}

.card-title {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  border-bottom: 2px solid var(--link-color);
  padding-bottom: 0.75rem;
}

.journey-card .timeline {
  border-left: 2px solid var(--button-border);
  padding-left: 1.5rem;
}

.journey-card .timeline-item {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.journey-card .timeline-item:last-child {
  margin-bottom: 0;
}

.journey-card .timeline-dot {
  position: absolute;
  left: -8px;
  top: 5px;
  width: 14px;
  height: 14px;
  background: var(--link-color);
  border-radius: 50%;
}

.journey-card .timeline-content h3 {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.25rem 0;
}

.journey-card .timeline-content p {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: 0;
}

.activity-item:not(:last-child) {
  margin-bottom: 1.5rem;
}

.activity-item h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
}

.activity-item p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.details-card .details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}

.details-card .detail-item h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: normal;
}

.details-card .detail-item p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* === 9. Contact Page === */
.contact-form {
  max-width: 700px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-text);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--link-color);
  outline: none;
}

.form-group label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s ease;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -0.75rem;
  left: 0.75rem;
  font-size: 0.8rem;
  color: var(--link-color);
  background-color: var(--bg-color);
  padding: 0 0.25rem;
}

/* === 10. Footer === */
.site-footer {
  position: relative;
  z-index: 1;
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 4rem 2rem 2rem;
  margin-top: auto;
  border-top: 1px solid var(--footer-border);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--footer-border);
}

.footer-column .footer-logo {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--footer-title);
  margin-bottom: 1rem;
}

.footer-column p,
.footer-column li {
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-column a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--link-color);
}

.footer-column h4 {
  font-size: 1rem;
  font-weight: bold;
  color: var(--footer-title);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 0.75rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
}

.footer-bottom p {
  font-size: 0.9rem;
  margin: 0;
}

body:not(.light-mode) .footer-container {
  color: #bdc3c7;
}

body.light-mode .site-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

body.light-mode .footer-column a {
  color: var(--text-muted);
}

body.light-mode .footer-column a:hover {
  color: var(--text-primary);
}

/* === 11. Nav SVG Icons === */
.icon-home{-webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8h5z"/></svg>')}
.icon-partners{-webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V18h14v-1.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V18h6v-1.5c0-2.33-4.67-3.5-7-3.5z"/></svg>')}
.icon-about{-webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>')}
.icon-contact{-webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"/></svg>')}
/* UPDATED: Theodolite / Total Station Icon */
.icon-products{-webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8L12 18"></path><path d="M10 20L14 20"></path><path d="M12 4L12 4"></path><path d="M8 8L16 8"></path><path d="M7 13L17 13"></path><path d="M7 16L17 16"></path><path d="M16 4L19 2"></path><path d="M8 4L5 2"></path></svg>')}


/* === 12. Domains Section (FINAL CLEAN LAYOUT - UPSCALED) === */
.domains-section {
  background-color: #2c3a4d;
  padding: 7rem 2rem; /* Increased vertical padding */
}

body.light-mode .domains-section {
  background-color: #f0f4f8; 
}

.domains-section .section-intro {
  margin-bottom: 5rem; /* Increased margin */
}

.domains-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem; /* I slightly reduced the gap for a better balance with the new width */

  /* 
    KEY CHANGE: The grid will now occupy 90% of the page width.
    This ensures it expands on larger screens while leaving a small 5% margin
    on each side, which looks very professional.
  */
  width: 100%; 
  max-width: 1800px; /* An upper limit just in case */
  margin: auto;
}

.domain-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--header-border-color);
  transition: all 0.3s ease-in-out;
}

.domain-card:hover {
    transform: translateY(-15px); /* More lift on hover */
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border-color: var(--link-color);
}

.domain-card img {
  /* UPDATED: Increased image height to make the card much larger */
  /* This value is arbitrary, based on the overall height we want */
  height: 350px; 
  width: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.domain-card:hover img {
    transform: scale(1.05);
}

.domain-card-title-area {
  flex-grow: 1; 
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem; /* More padding in the text area */
}

.domain-card h3 {
  margin: 0;
  color: var(--text-muted);

  /* UPDATED: Larger font to match bigger card */
  font-size: 1.8rem; 
  
  font-weight: 500;
  transition: color 0.3s ease;
}

.domain-card:hover h3 {
    color: var(--text-primary);
}


/* Responsive rules for mobile */
@media (max-width: 992px) {
  .domains-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* === 13. Modal Styles === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.modal-content {
  background-color: var(--section-bg);
  border-radius: 12px;
  max-width: 90vw;
  width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  display: flex;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  border: 1px solid var(--header-border-color);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font-size: 24px;
  line-height: 35px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
  background: rgba(255,0,0,0.8);
  transform: scale(1.1);
}

.modal-body {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: 90vh;
}

.modal-body img {
  width: 55%;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-text {
  padding: 2.5rem;
  overflow-y: auto;
  color: var(--text-muted);
}

.modal-text h2 {
  color: var(--text-primary);
  font-size: 2.2rem;
  margin: 0 0 1.5rem 0;
}

.modal-text h4 {
  color: var(--link-color);
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-text p {
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

body.modal-open {
  overflow: hidden; /* Prevent scrolling background when modal is open */
}

/* === 14. Location Section (NEW) === */
.location-section {
    background-color: var(--bg-color);
    padding: 1px 0; /* Prevents margin collapse */
}
.location-section .page-container {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: center;
    text-align: left;
}

.location-text-content .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.location-address {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.location-text-content .cta-button {
    align-self: flex-start;
}

.location-map-content {
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--header-border-color);
}

.location-map-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}
/* This CSS trick makes the Google Map dark to match the theme */
body:not(.light-mode) .location-map-content iframe {
    filter: invert(100%) hue-rotate(180deg) contrast(90%);
}

/* === 15. Responsive & Mobile Styles (UPDATED) === */
@media (max-width: 992px) {
  nav { display: none; } /* Temporary fix for mobile menu */
  header { padding: 1.5rem; justify-content: space-between; }
  .logo { margin-right: auto; }

  .location-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .location-text-content .section-title {
      text-align: center;
  }
  .location-text-content .cta-button {
      align-self: center;
  }
  .location-map-content {
      margin-top: 2rem;
      height: 350px;
  }
}

@media (max-width: 768px) {
  .hero-content { padding: 1.5rem; }
  .hero-title { font-size: 2.2rem; }
  .section-title, .page-title { font-size: 2rem; }
  
  .values-grid-inline, .domains-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    flex-direction: column;
  }
  .modal-body img {
    width: 100%;
    height: 40%;
    max-height: 250px;
  }
  .modal-text {
    padding: 1.5rem;
  }
  .modal-text h2 {
    font-size: 1.8rem;
  }
}
/* === 16. Legal Pages Layout (Privacy & Terms) === */
.legal-page-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    color: var(--text-muted);
}

.legal-page-content .page-title {
    text-align: center;
}

.legal-page-content .legal-last-updated {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -2.5rem;
    margin-bottom: 3rem;
}

.legal-page-content h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    /* REMOVED: border-bottom: 1px solid var(--header-border-color); */
    padding-bottom: 0.5rem;
}

.legal-page-content p {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.legal-page-content a {
    color: var(--link-color);
    text-decoration: underline;
}
/* === 17. Legal Pages Enhancements === */
.legal-page-content .page-title {
    /* FIX: Adds space below the main title */
    margin-bottom: 1.5rem; 
}

.legal-page-content .legal-last-updated {
    /* FIX: Removed negative margin that caused the overlap */
    margin-top: 0;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* NEW: Styling for the back button */
.back-button {
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center;
    gap: 0.5rem; /* Space between icon and text */
    text-decoration: none;
    color: var(--link-color);
    border: 1px solid var(--button-border);
    background-color: var(--button-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 500;
    margin-bottom: 1.5rem; /* Space between button and last-updated text */
    transition: all 0.3s ease;
    
    /* Center the button */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.back-button:hover {
    background-color: var(--link-color);
    border-color: var(--link-color);
    color: white;
}

.back-button svg {
    transition: transform 0.3s ease;
}

.back-button:hover svg {
    transform: translateX(-3px);
}

/* === 18. Products Page Layout (ULTRA-WIDE & FINAL FIX) === */

/* Make the container on the products page nearly full-width */
.products-page .page-container {
    max-width: 95%;
}

.products-page .page-container .page-title,
.products-page .page-container .page-subtitle {
    /* Keep titles centered within a normal width */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* This is the new wrapper we added */
.product-grid-wrapper {
    width: 100%;
    /* Create the small side margins directly on the wrapper */
    padding: 0 3rem; 
}

.product-categories-grid {
    display: flex; /* Changed from grid to flex */
    justify-content: space-between; /* This is the key change to spread them out */
    align-items: stretch; /* Ensures cards have the same height */
    margin-top: 4rem;
    width: 100%;
}

/* Responsive rules for tablets and phones */
@media (max-width: 1200px) {
    .product-grid-wrapper {
        padding: 0 1.5rem; /* Reduce side margins on smaller screens */
    }
    .product-categories-grid {
        flex-direction: column; /* Stack them vertically instead of horizontally */
        align-items: center; /* Center them when stacked */
        gap: 2.5rem;
    }
}


/* --- Card styling below ensures they look good when large --- */

.category-card {
    width: 30%; /* DECREASED: To increase space between cards */
    background-color: var(--section-bg);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--header-border-color);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none; /* This will remove the underline from all text inside the card */
}

/* On smaller screens, the cards should be much wider */
@media (max-width: 1200px) {
    .category-card {
        width: 100%;
        max-width: 600px; /* Limit max width on tablets */
    }
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.2);
}

.category-card-header {
    height: 382px !important; /* As requested by the user */
    overflow: hidden;
}

.category-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* REVERTED: This will fix the distortion */
    transition: transform 0.4s ease;
}

.category-card:hover .category-card-header img {
    transform: scale(1.1);
}

.category-card-body {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-card-body h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    text-align: center;
}

.category-card-body p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex-grow: 1;
    text-align: center;
    margin-bottom: 2rem;
}

.category-card-body .cta-button {
    margin-top: auto;
    align-self: center;
    background: transparent; color: var(--link-color); border: 2px solid var(--link-color); font-weight: 600; padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: 50px; text-decoration: none; transition: all 0.3s ease-in-out;
}

.category-card-body .cta-button:hover {
    background: var(--link-color); color: white; box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4); transform: translateY(-2px);
}
/* ===== تعديلات لتكبير بطاقات المنتجات ===== */

/* 1. زيادة عرض الشبكة بتقليل الهوامش الجانبية */
.product-grid-wrapper {
    padding: 0 1.5rem; /* كانت 3rem */
}

/* 2. زيادة ارتفاع الصورة وهو ما يزيد ارتفاع البطاقة بشكل عام */
.category-card-header {
    height: 380px; /* كانت 280px */
}

/* 3. زيادة الهوامش الداخلية في قسم النص ليتناسب مع الحجم الجديد */
.category-card-body {
    padding: 3rem 2rem; /* كانت 2.5rem 2rem */
}

/* 4. تكبير حجم خط العنوان */
.category-card-body h2 {
    font-size: 2.2rem; /* كانت 2rem */
}

/* 5. تكبير حجم خط الوصف */
.category-card-body p {
    font-size: 1.2rem; /* كانت 1.1rem */
}
/* ===== تعديل جديد: بطاقات أعرض وأقصر (تملأ الشاشة) ===== */

/* 1. جعل الحاوية الرئيسية تشغل عرض الشاشة بالكامل تقريبًا */
.product-grid-wrapper {
    padding: 0 0rem; /* كانت 3rem - قلّلنا الهامش الجانبي كثيرًا */
}

/* 2. تقليل المسافة بين البطاقات لتوفير مساحة أكبر لها */
.product-categories-grid {
    gap: 1.2rem; /* كانت 5rem */
}

/* 3. تقليل ارتفاع الصورة لجعل البطاقة أقصر بشكل ملحوظ */
.category-card-header {
    height: 220px; /* كانت 280px - الآن أقصر */
}

/* 4. تعديل بسيط في هوامش النص ليتناسب مع الارتفاع الجديد */
.category-card-body {
    padding: 2rem;
}

/* === Product Category Page System === */

.product-filter-container {
  margin-top: 3rem;
  width: 100%;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  border-bottom: 1px solid var(--header-border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.category-tab {
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  color: var(--text-muted);
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-tab:hover {
  background-color: var(--button-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.category-tab.active {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.product-list {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  min-height: 200px; /* يعطي ارتفاعًا للمناطق الفارغة */
}

.product-list.active {
  display: grid;
}

.product-card {
  background-color: var(--section-bg);
  border: 1px solid var(--header-border-color);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  background-color: rgba(255,255,255,0.05); /* لون خلفية خفيف لمكان الصورة */
  border-radius: 8px;
}

.product-card h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.product-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.product-card a {
  display: inline-block;
  text-decoration: none;
  color: var(--link-color);
  border: 1px solid var(--link-color);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 500;
  margin-top: auto;
  transition: all 0.3s ease;
}

.product-card a:hover {
  background-color: var(--link-color);
  color: white;
}
/* === NEW Geospatial Product Page Layout === */

/* --- 1. Category Grid (the visible cards) --- */
/* === NEW Geospatial Product Page Layout (Corrected Centering) === */

/* --- 1. Category Grid (the visible cards) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.category-grid-card {
    background-color: var(--section-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* --- هنا يتم تحقيق التوسيط المطلوب للصف الثاني --- */
.category-grid-card:nth-child(4) {
    /* البطاقة الرابعة (Accessoires) تبدأ من العمود الثاني */
    grid-column: 2 / span 2;
}
.category-grid-card:nth-child(5) {
    /* البطاقة الخامسة (Carnet de Terrain) تبدأ من العمود الرابع */
    grid-column: 4 / span 2;
}

/* للتأكد من أن التصميم يعمل جيدًا على الشاشات الصغيرة */
@media (max-width: 992px) {
    .category-grid {
        /* نعود للتصميم المتجاوب البسيط على الموبايل */
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .category-grid-card:nth-child(4),
    .category-grid-card:nth-child(5) {
        /* نلغي تحديد الأعمدة الخاص على الموبايل */
        grid-column: unset;
    }
}
/* ----- نهاية الكود الجديد ----- */


.category-grid-card:hover {
    transform: translateY(-5px);
}

.category-grid-card.active {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px var(--glow-color);
}

.category-grid-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    background-color: #fff; /* White background for images */
}

.category-grid-card:hover img {
    transform: scale(1.05);
}

.category-grid-title {
    padding: 1.25rem;
    background-color: var(--section-bg);
    margin-top: auto; /* Pushes title to the bottom */
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

/* Scoped styles for IT Products page grid */
.it-category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.it-category-grid .category-grid-card {
    width: 400px;
    flex-shrink: 0;
}

.it-category-grid .category-grid-card img {
    height: 300px;
}

/* Specific layout for the Geospatial Products page grid */
.geospatial-category-grid {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center; /* Center the rows */
    gap: 2rem;
    padding: 1rem 0; /* Vertical padding */
}

/* REMOVED the complex nth-child rules as they are no longer needed */

.geospatial-category-grid .category-grid-card {
    flex: 0 1 350px; /* Do not grow, allow shrinking, start at 350px */
}

.geospatial-category-grid .category-grid-card img {
    height: 331px; /* Set height to 331px as requested */
}

/* Styles for the dynamically shown product content sections */
.products-display-area {
    display: none; /* Hidden by default */
    padding: 3rem 0;
}

.products-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.products-content.show {
    display: block;
}

/* Styles for the new fullscreen overlay */
.products-display-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1100; /* Above header */
    display: none; /* Hidden by default */
    padding: 8rem 2rem 2rem 2rem; /* Padding to avoid header */
    overflow-y: auto;
}

.products-display-overlay.is-visible {
    display: block;
}

body.product-overlay-active {
    overflow: hidden;
}

/* Hide the glowing background when the overlay is active */
body.product-overlay-active .interactive-bg {
    display: none;
}

.back-to-categories-btn {
    position: fixed; /* Use fixed positioning to stay relative to viewport */
    top: 2.5rem;
    left: 2rem;
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    z-index: 1102; /* Ensure it's on top of the overlay content */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* Add shadow to make it pop */
}

.back-to-categories-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.back-to-categories-btn svg {
    stroke: var(--text-primary);
}

/* Professional styling for the content inside the overlay */
.overlay-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 4rem; /* Space below the back button */
}

.product-category-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

.product-placeholder {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 1rem;
    border: 2px dashed var(--header-border-color);
    border-radius: 12px;
    margin-top: 2rem;
}

@media (max-width: 992px) {
  .hero-content { padding: 1.5rem; }
  .hero-title { font-size: 2.2rem; }
  .section-title, .page-title { font-size: 2rem; }
  
  .values-grid-inline, .domains-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    flex-direction: column;
  }
  .modal-body img {
    width: 100%;
    height: 40%;
    max-height: 250px;
  }
  .modal-text {
    padding: 1.5rem;
  }
  .modal-text h2 {
    font-size: 1.8rem;
  }
}

main.content-wrapper {
  position: relative;
  z-index: 1;
}