.features {
  position: relative;
  width: 100%;
  background-color: #ffffff;
}

.features__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 96px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.features__title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 48px;
  color: #1b4759;
  text-align: center;
  letter-spacing: -2.88px;
  margin: 0;
}

.features__grid {
  display: grid;
  /* gap is set inline via style attribute */
  width: 100%;
  max-width: 1168px;
  justify-content: center;
}

/* Desktop column options */
.features__grid--cols-1 {
  grid-template-columns: 1fr;
}

.features__grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.features__grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.features__grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.features__grid--cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.features__grid--cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.features__card {
  background-color: #edf7fc;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-height: 352px;
  box-sizing: border-box;
}

/* Vertical layout (default) */
.features__card--vertical {
  flex-direction: column;
}

.features__card--vertical .features__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Horizontal layout - icon and title side-by-side */
.features__card--horizontal {
  flex-direction: column;
  gap: 16px;
}

.features__card--horizontal .features__header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.features__card--horizontal .features__icon {
  flex-shrink: 0;
}

/* Bigger title in horizontal layout */
.features__card--horizontal .features__card-title {
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -0.48px;
  margin: 0;
}

/* Description takes full width below icon in horizontal layout */
.features__card--horizontal .features__description {
  margin-left: 0;
}

/* Side-by-side layout - icon, title and content all next to icon */
.features__card--side-by-side {
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
}

.features__side-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

.features__card--side-by-side .features__icon {
  flex-shrink: 0;
}

.features__text-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.features__card--side-by-side .features__card-title {
  font-size: 20px;
  line-height: 24px;
  letter-spacing: -0.4px;
  margin: 0;
}

.features__card--side-by-side .features__description {
  margin: 0;
}

/* Expanded card functionality */
.features__card--expanded {
  grid-column: span 2;
}

/* When using 1 column, expanded cards take full width */
.features__grid--cols-1 .features__card--expanded {
  grid-column: span 1;
}

/* When using 2 columns, expanded cards take full width */
.features__grid--cols-2 .features__card--expanded {
  grid-column: span 2;
}

/* When using 3 columns, expanded cards take 2 columns */
.features__grid--cols-3 .features__card--expanded {
  grid-column: span 2;
}

/* When using 4 columns, expanded cards take 2 columns */
.features__grid--cols-4 .features__card--expanded {
  grid-column: span 2;
}

/* When using 5 columns, expanded cards take 3 columns */
.features__grid--cols-5 .features__card--expanded {
  grid-column: span 3;
}

/* When using 6 columns, expanded cards take 3 columns */
.features__grid--cols-6 .features__card--expanded {
  grid-column: span 3;
}

/* Tablet expanded card behavior */
@media (max-width: 1279px) {
  .features__grid--cols-tablet-1 .features__card--expanded {
    grid-column: span 1 !important;
  }

  .features__grid--cols-tablet-2 .features__card--expanded {
    grid-column: span 2 !important;
  }

  .features__grid--cols-tablet-3 .features__card--expanded {
    grid-column: span 2 !important;
  }

  .features__grid--cols-tablet-4 .features__card--expanded {
    grid-column: span 2 !important;
  }

  .features__grid--cols-tablet-5 .features__card--expanded {
    grid-column: span 3 !important;
  }

  .features__grid--cols-tablet-6 .features__card--expanded {
    grid-column: span 3 !important;
  }
}

/* Mobile expanded card behavior */
@media (max-width: 767px) {
  .features__grid--cols-mobile-1 .features__card--expanded {
    grid-column: span 1 !important;
  }

  .features__grid--cols-mobile-2 .features__card--expanded {
    grid-column: span 2 !important;
  }

  .features__grid--cols-mobile-3 .features__card--expanded {
    grid-column: span 2 !important;
  }

  .features__grid--cols-mobile-4 .features__card--expanded {
    grid-column: span 2 !important;
  }

  .features__grid--cols-mobile-5 .features__card--expanded {
    grid-column: span 3 !important;
  }

  .features__grid--cols-mobile-6 .features__card--expanded {
    grid-column: span 3 !important;
  }
}

.features__icon {
  width: 56px;
  height: 56px;
  background-color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.features__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.features__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.features__card-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 24px;
  color: #1b4759;
  margin: 0;
  letter-spacing: -0.4px;
}

.features__description {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #1b4759;
  margin: 0;
}

.features__description p {
  margin: 0 0 12px 0;
}

.features__description p:last-child {
  margin-bottom: 0;
}

/* Bullet list styling */
.features__description ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.features__description ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 16px;
}

.features__description ul li:last-child {
  margin-bottom: 0;
}

.features__description ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #1b4759;
  font-weight: 700;
}

/* Bold text styling */
.features__description strong,
.features__description b {
  font-weight: 700;
  color: #1b4759;
}

/* Tablet column options - override desktop columns on tablet and below (1279px and below) */
@media (max-width: 1279px) {
  .features__grid--cols-tablet-1 {
    grid-template-columns: 1fr !important;
  }

  .features__grid--cols-tablet-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .features__grid--cols-tablet-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .features__grid--cols-tablet-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .features__grid--cols-tablet-5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .features__grid--cols-tablet-6 {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}

/* Mobile column options - override tablet columns on mobile and below (767px and below) */
@media (max-width: 767px) {
  .features__grid--cols-mobile-1 {
    grid-template-columns: 1fr !important;
  }

  .features__grid--cols-mobile-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .features__grid--cols-mobile-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .features__grid--cols-mobile-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .features__grid--cols-mobile-5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .features__grid--cols-mobile-6 {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}

/* Responsive Design - Tablet (1279px and below) */
@media (max-width: 1279px) {
  .features__container {
    padding: 60px 40px;
  }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
  .features__container {
    padding: 40px 24px;
    gap: 32px;
  }

  .features__title {
    font-size: 36px;
    line-height: 40px;
    letter-spacing: -1.8px;
  }

  .features__card {
    min-height: auto;
  }

  /* Adjust horizontal layout spacing on mobile */
  .features__card--horizontal .features__header {
    gap: 12px;
  }

  /* Side-by-side layout becomes vertical on mobile */
  .features__card--side-by-side {
    flex-direction: column;
    gap: 16px;
  }

  .features__side-content {
    flex-direction: column;
    gap: 16px;
  }

  /* Expanded cards take full width on mobile */
  .features__card--expanded {
    grid-column: span 1;
  }
}

/* Extra small mobile (360px and below) */
@media (max-width: 360px) {
  .features__container {
    padding: 40px 16px;
    gap: 40px;
  }

  .features__title {
    font-size: 32px;
    line-height: 32px;
    letter-spacing: -1.92px;
  }

  .features__grid {
    gap: 16px !important;
  }

  .features__card {
    padding: 24px;
  }

  .features__card-title {
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -0.4px;
  }

  /* Reduce horizontal title size on mobile */
  .features__card--horizontal .features__card-title {
    font-size: 20px;
    line-height: 24px;
  }

  .features__description {
    font-size: 16px;
    line-height: 20px;
  }

  .features__description ul li {
    margin-bottom: 12px;
  }
}
