.module-4 {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.comparison-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
  touch-action: pan-x;
  cursor: grab;
  position: relative;
}

.comparison-table::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 30px;
  background: linear-gradient(to left, var(--background), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.comparison-table.has-overflow::after {
  opacity: 1;
}

.scroll-indicator {
  display: none;
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 12px;
  opacity: 0.7;
  pointer-events: none;
  animation: fadeInOut 2s infinite;
  white-space: nowrap;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Mostrar indicador de scroll solo en móviles */
@media (max-width: 768px) {
  .scroll-indicator {
    display: block;
  }
}

.table-header,
.table-row {
  display: flex;
  min-width: 900px;
}

.table-header {
  background: transparent;
  padding: 24px;
}

.header-cell,
.cell {
  padding: 16px 24px;
}

.header-cell.feature,
.cell.feature {
  width: 25%;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-albert);
  font-size: var(--text-secondary);
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.header-cell.livia,
.cell.livia {
  width: 40%;
  color: var(--text-primary);
}

.cell.livia {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell.livia::before {
  content: url('../img/check.svg');
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--check-color);
}

.header-cell.others {
  width: 35%;
  color: var(--text);
  font-family: var(--font-albert);
  font-size: var(--text-secondary);
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.cell.others {
  width: 35%;
  color: var(--text);
  font-family: var(--font-albert);
  font-size: var(--text-secondary);
  font-style: normal;
  font-weight: 300;
  line-height: normal;
}

.table-row {
  padding: 8px 24px;
  transition: background-color 0.2s ease;
}

.row-color {
  background-color: var(--other-color);
}

.no-row-color {
  background-color: transparent;
}

.highlight {
  font-family: var(--font-albert);
  font-size: var(--text-secondary);
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

@media screen and (max-width: 1200px) {
  .module-4 {
    margin: 100px auto;
  }
}

@media screen and (max-width: 768px) {
  .module-4 {
    margin: 80px auto;
    padding: 0 20px;
  }

  .comparison-table {
    border-radius: 16px;
    /* Añadir sombra para indicar que hay contenido fuera de la vista */
    box-shadow: 10px 0 15px -10px rgba(0, 0, 0, 0.1) inset;
  }

  .table-header,
  .table-row {
    padding: 16px;
    min-width: 700px; /* Reducir el tamaño mínimo para facilitar el scroll */
  }

  .header-cell,
  .cell {
    padding: 12px 16px;
    font-size: 14px;
  }

  .header-cell.livia .logo-text {
    font-size: 20px;
  }
}

@media screen and (max-width: 480px) {
  .module-4 {
    margin: 60px auto;
    padding: 0 15px;
  }

  .comparison-table {
    border-radius: 12px;
  }

  .table-header,
  .table-row {
    padding: 12px;
  }

  .header-cell,
  .cell {
    padding: 10px 12px;
    font-size: 13px;
  }

  .header-cell.livia .logo-text {
    font-size: 18px;
  }

  .highlight {
    display: block;
    margin-bottom: 4px;
  }
}
