/* 
 * Simple Services Component
 * A clean, horizontal services layout with proper icon display
 */

/* Base styles */
:root {
  --primary-color: #3A6351;
  --accent-color: #65B891;
  --light-bg: #F8F6F0;
  --white: #FFFFFF;
  --text-dark: #333333;
  --border-radius: 16px;
  --shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* Services container - Cross-browser compatible solution */
.services-container {
  margin-bottom: 30px;
  /* Contain the overflow to prevent affecting content below */
  width: 100%;
  position: relative;
  overflow: hidden;
  /* Isolate the scrolling context */
  contain: layout paint;
}

/* Services row - horizontal layout */
.services-row {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 16px;
  padding: 10px 0;
  margin: 0;
  padding-bottom: 20px;
  /* Improved scrolling behavior */
  scroll-behavior: smooth;
  /* Prevent horizontal overflow issues */
  max-width: 100%;
  /* Cross-browser compatible approach */
  position: relative;
  z-index: 1;
  /* Add padding to ensure last card is fully visible */
  padding-right: 20px;
}

/* Hide scrollbar but keep functionality */
.services-row::-webkit-scrollbar {
  height: 6px;
}

.services-row::-webkit-scrollbar-thumb {
  background-color: rgba(58, 99, 81, 0.2);
  border-radius: 20px;
}

/* Service card - Improved to prevent layout issues */
.service-card {
  flex: 0 0 auto;
  width: 180px;
  min-width: 180px; /* Prevent cards from shrinking */
  padding: 20px;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  scroll-snap-align: start;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  /* Ensure content is contained within card */
  overflow: hidden;
}

.service-card.active {
  background-color: rgba(101, 184, 145, 0.1);
}

.service-card.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 10px;
}

/* Service icon */
.service-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.service-icon i {
  font-size: 26px;
}

/* Service title */
.service-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-weight: 600;
}

/* Tags */
.service-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.tag {
  background-color: rgba(101, 184, 145, 0.1);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* Service content - Improved to prevent layout issues */
.service-content {
  margin-top: 40px;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 30px;
  position: relative;
  /* Ensure content is properly contained */
  width: 100%;
  overflow: hidden;
  /* Create a new stacking context */
  z-index: 1;
}

.service-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background-color: var(--accent-color);
  border-radius: 4px 0 0 4px;
}

.service-content-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-content-panel.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-content-panel h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 24px;
}

.service-content-panel p.lead {
  color: var(--text-dark);
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 500;
}

/* Content layout */
.content-grid {
  display: flex;
  flex-wrap: wrap;
  margin-top: 25px;
}

.content-col {
  flex: 0 0 100%;
}

@media (min-width: 768px) {
  .content-col {
    flex: 0 0 50%;
  }
  
  .content-col:first-child {
    padding-right: 15px;
  }
  
  .content-col:last-child {
    padding-left: 15px;
  }
}

/* Feature items */
.feature-list {
  margin-top: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.feature-item i {
  color: var(--accent-color);
  margin-right: 10px;
  font-size: 16px;
}

/* Image container */
.image-container {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .service-card {
    width: 160px;
    padding: 15px;
  }
  
  .service-icon {
    width: 60px;
    height: 60px;
  }
  
  .service-content {
    padding: 20px;
  }
}
