:root {
  --primary-color: #1e3a8a;      /* Deep blue */
  --secondary-color: #0ea5e9;    /* Bright blue */
  --accent-color: #f59e0b;       /* Amber */
  --dark-color: #111827;         /* Near-black */
  --muted-bg: #f3f4f6;           /* Light gray background */
  --card-bg: #ffffff;            /* White cards */
  --success-color: #10b981;      /* Green */
  --danger-color: #ef4444;       /* Red */
  --border-subtle: #e5e7eb;      /* Subtle gray border */
}

/* Global layout */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--muted-bg);
  color: var(--dark-color);
  margin: 0;
  padding: 0;
}

/* General container to center content */
#services {
  width: 100%;
  max-width: 1400px;
  margin: -30px 20px;
  padding: 0 16px;
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  padding: 5px 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
}

/* Hero section */
.hero {
  background: linear-gradient(
      rgba(15,23,42,0.7),
      rgba(15,23,42,0.7)
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%231e3a8a" width="1200" height="600"/><path fill="%230ea5e9" opacity="0.7" d="M0 200 Q300 100 600 200 T1200 200 V600 H0 Z"/></svg>');
  background-size: 50px;
  background-position: center;
  color: #ffffff;
  text-align: center;
  padding: 20px 20px;
}

/* Section titles */
.section-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 20px;
  font-weight: 700;
}

/* SERVICES SECTION - FIXED OVERLAY */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  background: teal;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
  overflow: visible;  /* ✅ CRITICAL: Shows dropdowns */
  width: 100%;
  border: 10px solid var(--border-subtle);
  height: 70px;       /* ✅ FIXED HEIGHT - No pushing */
  position: relative;
  z-index: 10;
}

/* FIXED HEIGHT CARDS */
.service-item {
  position: relative;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  height: 100%;       /* ✅ Fill fixed container */
}

.service-item:nth-child(3n),
.service-item:last-child {
  border-right: none;
}

/* Service headers */
.service-trigger {
  width: 100%;
  padding: 10px 14px;        /* slightly smaller to give room */
  background: teal;
  color: white;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;   /* top-align text and arrow */
  transition: all 0.25s ease;
  white-space: normal;       /* allow text to wrap */
  text-wrap: wrap;           /* modern wrap control */
  overflow-wrap: break-word; /* break long words if needed */
  position: relative;
  z-index: 20;
  flex-grow: 1;
  line-height: 1.3;          /* better multi-line spacing */
}

.service-trigger:hover {
  background: #e5f2ff;
  color: var(--primary-color);
  transform: translateY(-1px);
}

.service-trigger .arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.service-trigger.active {
  background: #e0f2fe;
  color: var(--primary-color);
}

.service-trigger.active .arrow {
  transform: rotate(180deg);
}

/* DROPDOWN OVERLAY - OUTSIDE FLOW */
.subservices {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-top: none;
  box-shadow: 0 12px 32px rgba(15,23,42,0.2);
  border-radius: 0 0 12px 12px;
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.service-item.active .subservices {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  padding: 12px 0 8px;
  pointer-events: auto;
}

/* Subservice items */
.subservice-item {
  padding: 10px 40px;
  color: #4b5563;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  position: relative;
  background: #ffffff;
}

.subservice-item:last-child {
  border-bottom: none;
}

.subservice-item:hover {
  background: #eff6ff;
  padding-left: 50px;
  color: var(--primary-color);
}

.subservice-item::before {
  content: '→';
  position: absolute;
  left: 32px;
  opacity: 0;
  transition: all 0.2s ease;
  color: var(--primary-color);
}

.subservice-item:hover::before {
  opacity: 1;
  left: 26px;
}

/* SINGLE HORIZONTAL ROW OF FIVE BUTTONS */
.learn-more-section {
  margin-top: 5px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 29px;  /* Minimal gap to match service-item borders */
  padding: 5 14px;  /* Match service-trigger side padding only (vertical separate) */
  background: transparent;
  border: none;
  width: 100%;
  box-sizing: border-box;
}

.learn-more-btn {
  flex: 1;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 35px;  /* Vertical 10px matches trigger; horizontal adjusted for label fit */
  border-radius: 999px;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  background: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
  margin: 0 0.5px;  /* Simulate 1px service borders between buttons */
}

.learn-more-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15,23,42,0.25);
}

/* REASONS SECTION */
.reasons {
  padding: 40px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.reason {
  flex: 1 1 200px;
  background-color: #eff6ff;
  margin: 0.5rem;
  padding: 1rem;
  border-radius: 18px;
  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
  text-align: justify;
  font-size: 14px;
  border: 1px solid #bbf7d0;
}

.reason h3 {
  color: var(--primary-color);
  font-size: 18px;
  margin: 10px 10px 0.75rem 0;
  text-align: center;
}

.reason p {
  line-height: 1.4;
  font-style: normal;
}

/* TESTIMONIALS SECTION */
.testimonials {
  margin-top: -30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.testimonial {
  flex: 1 1 260px;
  background-color: #eff6ff;
  margin: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
  text-align: justify;
  font-size: 14px;
  border: 1px solid #bfdbfe;
}

.testimonial p {
  font-style: italic;
  line-height: 1.4;
}

.testimonial .author {
  font-weight: 600;
  margin-top: 0.75rem;
  font-size: 14px;
  color: var(--dark-color);
}

.testimonial .position {
  color: var(--primary-color);
  font-size: 12px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
  #services {
    margin: 40px auto;
  }
  
  .learn-more-section {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 12px;
  }
  
  .learn-more-btn {
    flex: 1 1 45%;  /* 2 per row on mobile */
    margin: 0;
  }

  .services-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .service-item {
    border-right: none;
    min-height: 65px;
  }
  
  .service-trigger {
    padding: 14px 18px;
    font-size: 15px;
  }
  
  .subservices {
    left: 4%;
    right: 4%;
    max-height: 280px;
  }

  .subservice-item {
    padding: 10px 28px;
    font-size: 14px;
  }

  .reasons,
  .testimonials {
    flex-direction: column;
  }

  .learn-more-section {
    flex-wrap: wrap;
  }
}
