/* --- Mega Menu & Services Grid Styles --- */

/* --- Mega Menu --- */
.mega-dropdown {
  position: relative;
}

.mega-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mega-toggle i {
  font-size: 0.8rem;
  transition: var(--transition);
}

.mega-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-dropdown:hover .mega-toggle i {
  transform: rotate(180deg);
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 700px;
  background: var(--white);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  border-top: 4px solid var(--action-orange);
  z-index: 1000;
}

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

.mega-column h4 {
  color: var(--primary-navy);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--bg-silver);
  padding-bottom: 10px;
  font-size: 1.1rem;
}

.mega-column ul li {
  margin-bottom: 10px;
}

.mega-column ul li a {
  color: var(--text-grey);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.mega-column ul li a i {
  color: var(--action-orange);
  font-size: 0.9rem;
}

.mega-column ul li a:hover {
  color: var(--action-orange);
  padding-left: 5px;
}

/* --- Services Directory Grid & Accordion --- */
.services-directory {
  background-color: var(--bg-light);
}

.service-category {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  overflow: hidden;
  border-top: 4px solid transparent;
  transition: var(--transition);
}

.service-category:nth-child(2) { border-top-color: var(--primary-navy); }
.service-category:nth-child(3) { border-top-color: var(--secondary-green); }
.service-category:nth-child(4) { border-top-color: var(--action-orange); }

.category-header {
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--bg-silver);
  cursor: default; /* Desktop default */
}

.category-header h3 {
  font-size: 1.5rem;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0;
}

.category-header h3 i {
  color: var(--action-orange);
}

.accordion-icon {
  display: none; /* Hidden on desktop */
  font-size: 1.2rem;
  color: var(--text-grey);
  transition: transform 0.3s ease;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  padding: 30px;
  transition: max-height 0.3s ease;
}

.service-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background-color: var(--bg-light);
  border: 1px solid var(--bg-silver);
  border-radius: var(--radius-pill);
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.service-pill i {
  font-size: 1.15rem;
  transition: var(--transition);
}

/* 4 Recurring Colors for Service Pills */
.service-pill:nth-child(4n+1) { border: 1.5px solid rgba(16, 185, 129, 0.3); }
.service-pill:nth-child(4n+1) i { color: #10B981; }

.service-pill:nth-child(4n+2) { border: 1.5px solid rgba(59, 130, 246, 0.3); }
.service-pill:nth-child(4n+2) i { color: #3B82F6; }

.service-pill:nth-child(4n+3) { border: 1.5px solid rgba(245, 158, 11, 0.3); }
.service-pill:nth-child(4n+3) i { color: #F59E0B; }

.service-pill:nth-child(4n+4) { border: 1.5px solid rgba(139, 92, 246, 0.3); }
.service-pill:nth-child(4n+4) i { color: #8B5CF6; }

.service-pill:hover, .service-pill:active {
  transform: translateY(-2px);
  color: var(--white);
}

.service-pill:nth-child(4n+1):hover { background-color: #10B981; border-color: #10B981; box-shadow: 0 5px 15px rgba(16, 185, 129, 0.25); }
.service-pill:nth-child(4n+2):hover { background-color: #3B82F6; border-color: #3B82F6; box-shadow: 0 5px 15px rgba(59, 130, 246, 0.25); }
.service-pill:nth-child(4n+3):hover { background-color: #F59E0B; border-color: #F59E0B; box-shadow: 0 5px 15px rgba(245, 158, 11, 0.25); }
.service-pill:nth-child(4n+4):hover { background-color: #8B5CF6; border-color: #8B5CF6; box-shadow: 0 5px 15px rgba(139, 92, 246, 0.25); }

.service-pill:active {
  transform: scale(0.95);
}

.service-pill:hover i {
  color: var(--white);
  transform: scale(1.1);
}

/* Mobile Accordion Logic */
@media (max-width: 768px) {
  .category-header {
    cursor: pointer;
    padding: 15px 20px;
  }
  .accordion-icon {
    display: block;
  }
  .category-grid {
    display: none; /* Collapsed by default on mobile */
    padding: 15px;
    gap: 10px;
  }
  .service-category.active .category-grid {
    display: grid;
  }
  .service-category.active .accordion-icon {
    transform: rotate(180deg);
  }
  .category-header h3 {
    font-size: 1.1rem;
  }
  .mega-menu {
    display: none !important; /* Hide mega menu on mobile */
  }
  .service-pill {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

/* --- Detailed Service Cards --- */
.service-card {
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border: 1px solid var(--bg-silver);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
  height: 100%;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* 4 Recurring Colored Borders & Glowing Hover States */
.service-card:nth-child(4n+1) { border: 1px solid rgba(16, 185, 129, 0.4); border-left: 4px solid #10B981; }
.service-card:nth-child(4n+2) { border: 1px solid rgba(59, 130, 246, 0.4); border-left: 4px solid #3B82F6; }
.service-card:nth-child(4n+3) { border: 1px solid rgba(245, 158, 11, 0.4); border-left: 4px solid #F59E0B; }
.service-card:nth-child(4n+4) { border: 1px solid rgba(139, 92, 246, 0.4); border-left: 4px solid #8B5CF6; }

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.service-card:nth-child(4n+1):hover { border-color: #10B981; box-shadow: 0 10px 20px rgba(16, 185, 129, 0.15); }
.service-card:nth-child(4n+2):hover { border-color: #3B82F6; box-shadow: 0 10px 20px rgba(59, 130, 246, 0.15); }
.service-card:nth-child(4n+3):hover { border-color: #F59E0B; box-shadow: 0 10px 20px rgba(245, 158, 11, 0.15); }
.service-card:nth-child(4n+4):hover { border-color: #8B5CF6; box-shadow: 0 10px 20px rgba(139, 92, 246, 0.15); }

.service-card i {
  font-size: 1.8rem;
  margin-bottom: 16px;
  transition: var(--transition);
}

.service-card:nth-child(4n+1) i { color: #10B981; }
.service-card:nth-child(4n+2) i { color: #3B82F6; }
.service-card:nth-child(4n+3) i { color: #F59E0B; }
.service-card:nth-child(4n+4) i { color: #8B5CF6; }

.service-card:hover i {
  transform: scale(1.15);
}

.service-card h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.service-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-card ul li {
  font-size: 0.88rem;
  color: var(--text-grey);
  line-height: 1.4;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.service-card ul li::before {
  content: "•";
  color: var(--action-orange);
  font-weight: bold;
}

/* Adjust category grid for cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  padding: 30px;
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 20px;
  }
}

/* --- Hero Images --- */
.hero-image {
    max-width: 600px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.35), 0 0 30px rgba(249, 115, 22, 0.15);
    margin: 40px auto 0;
    display: block;
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 15px;
}

.hero-image:hover {
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .hero-image {
        max-width: 90%;
        margin-top: 20px;
    }
}
/* --- Service Search Bar --- */
.services-search-wrapper {
  max-width: 600px;
  margin: -20px auto 40px;
  position: relative;
  z-index: 10;
}

.search-input-container {
  display: flex;
  align-items: center;
  background: var(--white);
  padding: 5px 20px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border: 2px solid transparent;
  transition: var(--transition);
}

.search-input-container:focus-within {
  border-color: var(--action-orange);
  box-shadow: 0 15px 35px rgba(249, 113, 22, 0.2);
  transform: translateY(-2px);
}

.search-icon {
  color: var(--text-grey);
  font-size: 1.2rem;
  margin-right: 15px;
}

#service-search {
  width: 100%;
  border: none;
  padding: 12px 0;
  font-size: 1.1rem;
  font-family: var(--font-body);
  outline: none;
  background: transparent;
  color: var(--text-dark);
}

.search-results-count {
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--text-grey);
  font-weight: 500;
  min-height: 20px;
}

.service-pill.hidden, .service-card.hidden {
  display: none !important;
}

.service-category.hidden {
  display: none !important;
}

.search-highlight {
  background-color: var(--action-orange-light);
  color: var(--action-orange);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}
